From: Linus Torvalds <torvalds@linux-foundation.org>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Ying Han" <yinghan@google.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
"Ingo Molnar" <mingo@elte.hu>,
"Mike Waychison" <mikew@google.com>,
"Rohit Seth" <rohitseth@google.com>,
"Hugh Dickins" <hugh@veritas.com>,
"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
"H. Peter Anvin" <hpa@zytor.com>,
"Török Edwin" <edwintorok@gmail.com>,
"Lee Schermerhorn" <lee.schermerhorn@hp.com>,
"Nick Piggin" <npiggin@suse.de>
Subject: Re: [PATCH][1/2]page_fault retry with NOPAGE_RETRY
Date: Fri, 10 Apr 2009 09:01:18 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.00.0904100835150.4583@localhost.localdomain> (raw)
In-Reply-To: <20090410073042.GB21149@localhost>
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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-04-10 16:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-08 20:02 Ying Han
2009-04-09 7:47 ` Wu Fengguang
2009-04-09 16:21 ` Ying Han
2009-04-10 0:25 ` Wu Fengguang
2009-04-10 6:02 ` Andrew Morton
2009-04-10 6:32 ` Ying Han
2009-04-10 6:48 ` Wu Fengguang
2009-04-10 7:30 ` Wu Fengguang
2009-04-10 16:01 ` Linus Torvalds [this message]
2009-04-10 16:04 ` [PATCH 1/2] Remove internal use of 'write_access' in mm/memory.c Linus Torvalds
2009-04-10 16:09 ` [PATCH 2/2] Move FAULT_FLAG_xyz into handle_mm_fault() callers Linus Torvalds
2009-04-10 19:15 ` Ying Han
2009-04-10 19:22 ` Linus Torvalds
2009-04-14 7:09 ` Nick Piggin
2009-04-10 17:57 ` [PATCH][1/2]page_fault retry with NOPAGE_RETRY Ying Han
2009-04-08 20:06 Ying Han
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.00.0904100835150.4583@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=edwintorok@gmail.com \
--cc=fengguang.wu@intel.com \
--cc=hpa@zytor.com \
--cc=hugh@veritas.com \
--cc=lee.schermerhorn@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mikew@google.com \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=rohitseth@google.com \
--cc=yinghan@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox