LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH RFC] use of activate_mm in fs/aio.c:use_mm()?
@ 2006-12-07  1:24 Jeremy Fitzhardinge
  2006-12-07  1:36 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2006-12-07  1:24 UTC (permalink / raw)
  To: Zach Brown, Badari Pulavarty, Nick Piggin, Andrew Morton
  Cc: Linux Kernel Mailing List, Zachary Amsden, Chris Wright,
	Rusty Russell, Jeff Dike

I'm wondering if activate_mm() is the right thing to be using in
use_mm(); shouldn't this be switch_mm()?

On normal x86, they're synonymous, but for the Xen patches I'm adding a
hook which assumes that activate_mm is only used the first time a new mm
is used after creation (I have another hook for dealing with dup_mm).  I
think this use of activate_mm() is the only place where it could be used
a second time on an mm.

>From a quick look at the other architectures I think this is OK (most
simply implement one in terms of the other), but some are doing some
subtly different stuff between the two.

Thanks,
    J

diff -r 455b71ed4525 fs/aio.c
--- a/fs/aio.c	Wed Dec 06 13:16:42 2006 -0800
+++ b/fs/aio.c	Wed Dec 06 17:17:43 2006 -0800
@@ -588,7 +588,7 @@ static void use_mm(struct mm_struct *mm)
 	 * Note that on UML this *requires* PF_BORROWED_MM to be set, otherwise
 	 * it won't work. Update it accordingly if you change it here
 	 */
-	activate_mm(active_mm, mm);
+	switch_mm(active_mm, mm);
 	task_unlock(tsk);
 
 	mmdrop(active_mm);



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC] use of activate_mm in fs/aio.c:use_mm()?
  2006-12-07  1:24 [PATCH RFC] use of activate_mm in fs/aio.c:use_mm()? Jeremy Fitzhardinge
@ 2006-12-07  1:36 ` Jeremy Fitzhardinge
  2006-12-08 23:45   ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2006-12-07  1:36 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: Zach Brown, Badari Pulavarty, Nick Piggin, Andrew Morton,
	Linux Kernel Mailing List, Zachary Amsden, Chris Wright,
	Rusty Russell, Jeff Dike

Jeremy Fitzhardinge wrote:
> I'm wondering if activate_mm() is the right thing to be using in
> use_mm(); shouldn't this be switch_mm()?
>
> On normal x86, they're synonymous, but for the Xen patches I'm adding a
> hook which assumes that activate_mm is only used the first time a new mm
> is used after creation (I have another hook for dealing with dup_mm).  I
> think this use of activate_mm() is the only place where it could be used
> a second time on an mm.
>
> From a quick look at the other architectures I think this is OK (most
> simply implement one in terms of the other), but some are doing some
> subtly different stuff between the two.
>
> Thanks,
>     J
>
>
>   
Er, lets try that again:

diff -r 455b71ed4525 fs/aio.c
--- a/fs/aio.c	Wed Dec 06 13:16:42 2006 -0800
+++ b/fs/aio.c	Wed Dec 06 17:17:43 2006 -0800
@@ -588,7 +588,7 @@ static void use_mm(struct mm_struct *mm)
 	 * Note that on UML this *requires* PF_BORROWED_MM to be set, otherwise
 	 * it won't work. Update it accordingly if you change it here
 	 */
-	activate_mm(active_mm, mm);
+	switch_mm(active_mm, mm, tsk);
 	task_unlock(tsk);
 
 	mmdrop(active_mm);



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC] use of activate_mm in fs/aio.c:use_mm()?
  2006-12-07  1:36 ` Jeremy Fitzhardinge
@ 2006-12-08 23:45   ` Andrew Morton
  2006-12-09 22:03     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2006-12-08 23:45 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: Zach Brown, Badari Pulavarty, Nick Piggin,
	Linux Kernel Mailing List, Zachary Amsden, Chris Wright,
	Rusty Russell, Jeff Dike, Linus Torvalds, linux-arch, linux-aio

On Wed, 06 Dec 2006 17:36:02 -0800
Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Jeremy Fitzhardinge wrote:
> > I'm wondering if activate_mm() is the right thing to be using in
> > use_mm(); shouldn't this be switch_mm()?
> >
> > On normal x86, they're synonymous, but for the Xen patches I'm adding a
> > hook which assumes that activate_mm is only used the first time a new mm
> > is used after creation (I have another hook for dealing with dup_mm).  I
> > think this use of activate_mm() is the only place where it could be used
> > a second time on an mm.
> >
> > From a quick look at the other architectures I think this is OK (most
> > simply implement one in terms of the other), but some are doing some
> > subtly different stuff between the two.
> >
> > Thanks,
> >     J
> >
> >
> >   
> Er, lets try that again:
> 
> diff -r 455b71ed4525 fs/aio.c
> --- a/fs/aio.c	Wed Dec 06 13:16:42 2006 -0800
> +++ b/fs/aio.c	Wed Dec 06 17:17:43 2006 -0800
> @@ -588,7 +588,7 @@ static void use_mm(struct mm_struct *mm)
>  	 * Note that on UML this *requires* PF_BORROWED_MM to be set, otherwise
>  	 * it won't work. Update it accordingly if you change it here
>  	 */
> -	activate_mm(active_mm, mm);
> +	switch_mm(active_mm, mm, tsk);
>  	task_unlock(tsk);
>  
>  	mmdrop(active_mm);

That to me sounds like a reasonable description of the difference between
activate_mm() and switch_mm().  And the change appears reasonable as well.

But it is a change which the architecture maintainers would need to have a
think about, please.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC] use of activate_mm in fs/aio.c:use_mm()?
  2006-12-08 23:45   ` Andrew Morton
@ 2006-12-09 22:03     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2006-12-09 22:03 UTC (permalink / raw)
  To: akpm
  Cc: jeremy, zach.brown, pbadari, nickpiggin, linux-kernel, zach,
	chrisw, rusty, jdike, torvalds, linux-arch, linux-aio

From: Andrew Morton <akpm@osdl.org>
Date: Fri, 8 Dec 2006 15:45:22 -0800

> On Wed, 06 Dec 2006 17:36:02 -0800
> Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> 
> > Jeremy Fitzhardinge wrote:
> > > I'm wondering if activate_mm() is the right thing to be using in
> > > use_mm(); shouldn't this be switch_mm()?
> > >
> > > On normal x86, they're synonymous, but for the Xen patches I'm adding a
> > > hook which assumes that activate_mm is only used the first time a new mm
> > > is used after creation (I have another hook for dealing with dup_mm).  I
> > > think this use of activate_mm() is the only place where it could be used
> > > a second time on an mm.
> > >
> > > From a quick look at the other architectures I think this is OK (most
> > > simply implement one in terms of the other), but some are doing some
> > > subtly different stuff between the two.
> > >
> > > Thanks,
> > >     J
> > >
> > >
> > >   
> > Er, lets try that again:
> > 
> > diff -r 455b71ed4525 fs/aio.c
> > --- a/fs/aio.c	Wed Dec 06 13:16:42 2006 -0800
> > +++ b/fs/aio.c	Wed Dec 06 17:17:43 2006 -0800
> > @@ -588,7 +588,7 @@ static void use_mm(struct mm_struct *mm)
> >  	 * Note that on UML this *requires* PF_BORROWED_MM to be set, otherwise
> >  	 * it won't work. Update it accordingly if you change it here
> >  	 */
> > -	activate_mm(active_mm, mm);
> > +	switch_mm(active_mm, mm, tsk);
> >  	task_unlock(tsk);
> >  
> >  	mmdrop(active_mm);
> 
> That to me sounds like a reasonable description of the difference between
> activate_mm() and switch_mm().  And the change appears reasonable as well.
> 
> But it is a change which the architecture maintainers would need to have a
> think about, please.

This looks absolutely correct to me.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-09 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-07  1:24 [PATCH RFC] use of activate_mm in fs/aio.c:use_mm()? Jeremy Fitzhardinge
2006-12-07  1:36 ` Jeremy Fitzhardinge
2006-12-08 23:45   ` Andrew Morton
2006-12-09 22:03     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).