Linux filesystem development
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: xemul-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	mingo-X9Un+BFzKDI@public.gmane.org,
	torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
Subject: [PATCH 6/9] exec_path 6/9: add struct spu::tsk
Date: Thu, 4 Jun 2009 03:06:56 +0400	[thread overview]
Message-ID: <20090603230656.GG853@x200.localdomain> (raw)
In-Reply-To: <20090603230422.GB853-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>

Pass down task_struct too.

Signed-off-by: Alexey Dobriyan <adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 arch/powerpc/include/asm/spu.h            |    3 ++-
 arch/powerpc/platforms/cell/spu_base.c    |   11 ++++++-----
 arch/powerpc/platforms/cell/spufs/sched.c |    4 ++--
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/include/asm/spu.h b/arch/powerpc/include/asm/spu.h
index 0ab8d86..f9b1bcf 100644
--- a/arch/powerpc/include/asm/spu.h
+++ b/arch/powerpc/include/asm/spu.h
@@ -135,6 +135,7 @@ struct spu {
 	u64 class_1_dsisr;
 	size_t ls_size;
 	unsigned int slb_replace;
+	struct task_struct *tsk;
 	struct mm_struct *mm;
 	struct spu_context *ctx;
 	struct spu_runqueue *rq;
@@ -212,7 +213,7 @@ static inline void crash_register_spus(struct list_head *list)
 #endif
 
 extern void spu_invalidate_slbs(struct spu *spu);
-extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
+extern void spu_associate_task(struct spu *spu, struct task_struct *tsk);
 int spu_64k_pages_available(void);
 
 /* Calls from the memory management to the SPU */
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 9abd210..46f4a63 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -117,17 +117,18 @@ static inline void mm_needs_global_tlbie(struct mm_struct *mm)
 	bitmap_fill(cpumask_bits(mm_cpumask(mm)), nr);
 }
 
-void spu_associate_mm(struct spu *spu, struct mm_struct *mm)
+void spu_associate_task(struct spu *spu, struct task_struct *tsk)
 {
 	unsigned long flags;
 
 	spin_lock_irqsave(&spu_full_list_lock, flags);
-	spu->mm = mm;
+	spu->tsk = tsk;
+	spu->mm = tsk ? tsk->mm : NULL;
 	spin_unlock_irqrestore(&spu_full_list_lock, flags);
-	if (mm)
-		mm_needs_global_tlbie(mm);
+	if (tsk && tsk->mm)
+		mm_needs_global_tlbie(tsk->mm);
 }
-EXPORT_SYMBOL_GPL(spu_associate_mm);
+EXPORT_SYMBOL_GPL(spu_associate_task);
 
 int spu_64k_pages_available(void)
 {
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 9fbd87a..2f7e497 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -230,7 +230,7 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
 	ctx->stats.slb_flt_base = spu->stats.slb_flt;
 	ctx->stats.class2_intr_base = spu->stats.class2_intr;
 
-	spu_associate_mm(spu, ctx->owner->mm);
+	spu_associate_task(spu, ctx->owner);
 
 	spin_lock_irq(&spu->register_lock);
 	spu->ctx = ctx;
@@ -470,7 +470,7 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx)
 	spu->ctx = NULL;
 	spin_unlock_irq(&spu->register_lock);
 
-	spu_associate_mm(spu, NULL);
+	spu_associate_task(spu, NULL);
 
 	ctx->stats.slb_flt +=
 		(spu->stats.slb_flt - ctx->stats.slb_flt_base);

  parent reply	other threads:[~2009-06-03 23:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090526113618.GJ28083@us.ibm.com>
     [not found] ` <20090526162415.fb9cefef.akpm@linux-foundation.org>
     [not found]   ` <20090531215427.GA29534@x200.localdomain>
     [not found]     ` <20090531151953.8f8b14b5.akpm@linux-foundation.org>
     [not found]       ` <20090531151953.8f8b14b5.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2009-06-03 23:04         ` [PATCH 1/9] exec_path 1/9: introduce ->exec_path and switch /proc/*/exe Alexey Dobriyan
2009-06-03 23:05           ` [PATCH 2/9] exec_path 2/9: switch audit to ->exec_path Alexey Dobriyan
2009-06-03 23:06           ` [PATCH 5/9] exec_path 5/9: make struct spu_context::owner task_struct Alexey Dobriyan
     [not found]           ` <20090603230422.GB853-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-06-03 23:05             ` [PATCH 3/9] exec_path 3/9: switch TOMOYO to ->exec_path Alexey Dobriyan
2009-06-03 23:06             ` [PATCH 4/9] exec_path 4/9: switch oprofile " Alexey Dobriyan
2009-06-03 23:06             ` Alexey Dobriyan [this message]
2009-06-03 23:07           ` [PATCH 7/9] exec_path 7/9: switch cell SPU thing " Alexey Dobriyan
2009-06-03 23:07           ` [PATCH 8/9] exec_path 8/9: remove ->exe_file et al Alexey Dobriyan
2009-06-03 23:08           ` [PATCH 9/9] exec_path 9/9: remove VM_EXECUTABLE Alexey Dobriyan
2009-06-04  7:24             ` Matt Helsley
2009-06-03 23:36           ` [PATCH 1/9] exec_path 1/9: introduce ->exec_path and switch /proc/*/exe Linus Torvalds
2009-06-04  7:55           ` Matt Helsley
2009-06-04  8:10             ` Matt Helsley
2009-06-04 15:07             ` Linus Torvalds
2009-06-04 21:30               ` Matt Helsley
2009-06-04 22:42                 ` Alexey Dobriyan
2009-06-05  3:49                   ` Matt Helsley
2009-06-05 10:45           ` Christoph Hellwig
2009-06-05 15:10             ` Linus Torvalds
2009-06-05 15:41               ` Alexey Dobriyan
2009-06-05 15:49                 ` Linus Torvalds
2009-06-05 16:09                   ` Alexey Dobriyan
     [not found]                     ` <20090605160943.GA5262-2ev+ksY9ol182hYKe6nXyg@public.gmane.org>
2009-06-05 16:48                       ` Linus Torvalds
2009-06-05 17:46                         ` Alexey Dobriyan
2009-06-06  7:22           ` Al Viro
2009-06-15 22:10             ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090603230656.GG853@x200.localdomain \
    --to=adobriyan-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mingo-X9Un+BFzKDI@public.gmane.org \
    --cc=torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=xemul-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox