[lkml]   [2009]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [V4][PATCH 0/4]page fault retry with NOPAGE_RETRY

On Mon, 13 Apr 2009, Linus Torvalds wrote:
> Well, have you tried the obvious optimization of _not_ doing the RETRY
> path when atomic_read(&mm->counter) == 1?
> After all, if it's not a threaded app, and it doesn't have a possibility
> of concurrent mmap/fault, then why release the lock?

Ok, so the counter is called 'mm_users', not 'counter'.

Anyway, I would try that in the arch patch, and just see what happens when
you change the

unsigned int fault_flags = FAULT_FLAG_RETRY;


unsigned int fault_flags;


fault_flags = atomic_read(&mm->mm_users) > 1 ? FAULT_FLAG_RETRY : 0;

where you should probably do that mm dereference only after checking that
you're not in atomic context or something like that (so move the
assignment down).

The reason I'd suggest doing it in the caller of handle_mm_fault() rather
than anywhere deeper in the call chain is that some callers _might_ really
want to get the retry semantics even if they are the only ones. Imagine,
for example, some kind of non-blocking "get_user_pages()" thing.


 \ /
  Last update: 2009-04-13 22:31    [W:0.043 / U:3.504 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site