RE: Prefetch mmap_sem in ia64_do_page_fault()

From: Christoph Lameter <clameter_at_sgi.com>
Date: 2006-03-29 18:16:12
On Tue, 28 Mar 2006, Chen, Kenneth W wrote:

> > +	/* mmap_sem is performance critical.... */
> > +	prefetchw(&mm->mmap_sem);
> > +
> 
> I would say push that a couple of lines down after checking !mm
> 
>         if (in_atomic() || !mm)
>                 goto no_context;

I initially also thought that would be better.
 
> If you insist on prefetching mmap_sem at the very beginning of the
> function, then use speculative load, it will "nat" right away with
> null pointer without generating any exception at all.  It is super
> fast because of nat page.

I saw David Mosberger's patch from last year

http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=458f935527372499b714bf4f8e646a68bb0f52e3

and it seems that he implemented fast handling of these NULL cases?

mm == NULL is very rare so I think we can try to prefetch as 
early as possible.
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Mar 29 18:17:05 2006

This archive was generated by hypermail 2.1.8 : 2006-03-29 18:17:13 EST