Displaying 6 results from an estimated 6 matches for "get_task_struct".
2007 Apr 26
1
[PATCH] Fix lguest oops when guest dies while receiving I/O
...===============================================
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -107,7 +107,8 @@ static int initialize(struct file *file,
setup_regs(lg->regs, args[2]);
setup_guest_gdt(lg);
lg->tsk = current;
- lg->mm = get_task_mm(current);
+ get_task_struct(lg->tsk);
+ lg->mm = get_task_mm(lg->tsk);
lg->last_pages = NULL;
mutex_unlock(&lguest_lock);
@@ -160,6 +161,7 @@ static int close(struct inode *inode, st
mutex_lock(&lguest_lock);
release_all_dma(lg);
free_guest_pagetable(lg);
+ put_task_struct(lg->tsk);
mmput(...
2023 Jun 02
2
[PATCH 1/1] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
Hi Mike,
sorry, but somehow I can't understand this patch...
I'll try to read it with a fresh head on Weekend, but for example,
On 06/01, Mike Christie wrote:
>
> static int vhost_task_fn(void *data)
> {
> struct vhost_task *vtsk = data;
> - int ret;
> + bool dead = false;
> +
> + for (;;) {
> + bool did_work;
> +
> + /* mb paired w/
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 09/13] lguest64 devices
...kes outside locks. */
+void set_wakeup_process(struct lguest_guest_info *linfo,
+ struct task_struct *p)
+{
+ if (p == linfo->wake)
+ return;
+
+ if (linfo->wake) {
+ wake_up_process(linfo->wake);
+ put_task_struct(linfo->wake);
+ }
+ linfo->wake = p;
+ if (linfo->wake)
+ get_task_struct(linfo->wake);
+}
+
+static int dma_transfer(struct lguest_guest_info *srclg,
+ unsigned long udma,
+ struct lguest_dma_info *dst)
+{
+#if 0
+ struct lguest_dma dst_dma, src_dma;
+ struct lguest_guest_info *dstlg;
+ u32 i, dma = 0;
+
+ dstlg = &lguests[dst->guest_id];
+ /* Get our dma...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 09/13] lguest64 devices
...kes outside locks. */
+void set_wakeup_process(struct lguest_guest_info *linfo,
+ struct task_struct *p)
+{
+ if (p == linfo->wake)
+ return;
+
+ if (linfo->wake) {
+ wake_up_process(linfo->wake);
+ put_task_struct(linfo->wake);
+ }
+ linfo->wake = p;
+ if (linfo->wake)
+ get_task_struct(linfo->wake);
+}
+
+static int dma_transfer(struct lguest_guest_info *srclg,
+ unsigned long udma,
+ struct lguest_dma_info *dst)
+{
+#if 0
+ struct lguest_dma dst_dma, src_dma;
+ struct lguest_guest_info *dstlg;
+ u32 i, dma = 0;
+
+ dstlg = &lguests[dst->guest_id];
+ /* Get our dma...
2007 May 09
1
[patch 3/9] lguest: the host code
...to wakeup: helps for batching & wakes outside locks. */
+void set_wakeup_process(struct lguest *lg, struct task_struct *p)
+{
+ if (p == lg->wake)
+ return;
+
+ if (lg->wake) {
+ wake_up_process(lg->wake);
+ put_task_struct(lg->wake);
+ }
+ lg->wake = p;
+ if (lg->wake)
+ get_task_struct(lg->wake);
+}
+
+/* Userspace wants a dma buffer from this guest. */
+unsigned long get_dma_buffer(struct lguest *lg,
+ unsigned long ukey, unsigned long *interrupt)
+{
+ unsigned long ret = 0;
+ union futex_key key;
+ struct lguest_dma_info *i;
+ struct rw_semaphore *fshared = &curre...
2007 May 09
1
[patch 3/9] lguest: the host code
...to wakeup: helps for batching & wakes outside locks. */
+void set_wakeup_process(struct lguest *lg, struct task_struct *p)
+{
+ if (p == lg->wake)
+ return;
+
+ if (lg->wake) {
+ wake_up_process(lg->wake);
+ put_task_struct(lg->wake);
+ }
+ lg->wake = p;
+ if (lg->wake)
+ get_task_struct(lg->wake);
+}
+
+/* Userspace wants a dma buffer from this guest. */
+unsigned long get_dma_buffer(struct lguest *lg,
+ unsigned long ukey, unsigned long *interrupt)
+{
+ unsigned long ret = 0;
+ union futex_key key;
+ struct lguest_dma_info *i;
+ struct rw_semaphore *fshared = &curre...