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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Apr 2009 09:01:18 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Wu Fengguang <fengguang.wu@...el.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Ying Han <yinghan@...gle.com>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	linux-kernel <linux-kernel@...r.kernel.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>
Subject: Re: [PATCH][1/2]page_fault retry with NOPAGE_RETRY



On Fri, 10 Apr 2009, Wu Fengguang wrote:

> On Fri, Apr 10, 2009 at 02:02:05PM +0800, Andrew Morton wrote:
> 
> > Can we please redo this as:
> > 
> > 
> > 	int write;
> > 	unsigned int flags;
> > 
> > 	/*
> > 	 * Big fat comment explaining the next three lines goes here
> > 	 */
> 
> Basically it's doing a
>         (is_write_access  | FAULT_FLAG_RETRY) =>
>         (FAULT_FLAG_WRITE | FAULT_FLAG_RETRY)
> by extracting the bool part:
> > 	write = write_access & ~FAULT_FLAG_RETRY;
> convert bool to a bit flag:
> > 	unsigned int flags = (write ? FAULT_FLAG_WRITE : 0);

The point is, we shouldn't do that. 

Your code is confused, because it uses "write_access" as if it had the old 
behaviour (boolean to say "write") _plus_ the new behavior (bitmask to say 
"retry"), and that's just wrong.

Just get rid of "write_access" entirely, and switch it over to something 
that is a pure bitmask.

Yes, it means a couple of new preliminary patches that switch all callers 
of handle_mm_fault() over to using the VM_FLAGS, but that's not a big 
deal.

I'm following up this email with two _example_ patches. They are untested, 
but they look sane. I'd like the series to _start_ with these, and then 
you can pass FAULT_FLAGS_WRITE | FAULT_FLAGS_RETRY down to 
handle_mm_fault() cleanly.

Hmm? Note the _untested_ part on the patches to follow. It was done very 
mechanically, and the patches look sane, but .. !!!

			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