lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0904131314090.26713@localhost.localdomain>
Date:	Mon, 13 Apr 2009 13:19:50 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Ying Han <yinghan@...gle.com>
cc:	linux-mm@...ck.org, linux-kernel <linux-kernel@...r.kernel.org>,
	akpm <akpm@...ux-foundation.org>, Ingo Molnar <mingo@...e.hu>,
	Mike Waychison <mikew@...gle.com>,
	Rohit Seth <rohitseth@...gle.com>,
	Hugh Dickins <hugh@...itas.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"H. Peter Anvin" <hpa@...or.com>,
	Török Edwin <edwintorok@...il.com>,
	Lee Schermerhorn <lee.schermerhorn@...com>,
	Nick Piggin <npiggin@...e.de>,
	Wu Fengguang <fengguang.wu@...el.com>
Subject: Re: [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;

into

	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.

			Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ