linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-arch@vger.kernel.org, Hugh Dickins <hugh@veritas.com>,
	Nick Piggin <npiggin@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Wu Fengguang <fengguang.wu@intel.com>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: handle_mm_fault() calling convention cleanup..
Date: Sat, 04 Jul 2009 09:35:07 +1000	[thread overview]
Message-ID: <1246664107.7551.11.camel@pasglop> (raw)
In-Reply-To: <alpine.LFD.2.01.0906211331480.3240@localhost.localdomain>

On Sun, 2009-06-21 at 13:42 -0700, Linus Torvalds wrote:
> Just a heads up that I committed the patches that I sent out two months 
> ago to make the fault handling routines use the finer-grained fault flags 
> (FAULT_FLAG_xyzzy) rather than passing in a boolean for "write".
> 
> That was originally for the NOPAGE_RETRY patches, but it's a general 
> cleanup too. I have this suspicion that we should extend this to 
> "get_user_pages()" too, instead of having those boolean "write" and 
> "force" flags (and GUP_FLAGS_xyzzy as opposed to FAULT_FLAGS_yyzzy).

BTW. I'd like to extend these if there's no objection one of these days
to also pass whether it was an exec fault, and pass the full flags to
ptep_set_access_flags().

That would (finally) give us a better hook for architectures that need
to do it to handle i$/d$ coherency. Right now, I go dig for the current
fault type inside the current pt_regs from ptep_set_access_flags() which
is positively ugly.

Ben.

> We should probably also get rid of the insane FOLL_xyz flags too. Right 
> now the code in fact depends on FOLL_WRITE being the same as 
> FAULT_FLAGS_WRITE, and while that is a simple dependency, it's just crazy 
> how we have all these different flags for what ends up often boiling down 
> to the same fundamental issue in the end (even if not all versions of the 
> flags are necessarily always valid for all uses).
> 
> I fixed up all architectures that I noticed (at least microblaze had been 
> added since the original patches in April), but arch maintainers should 
> double-check. Arch maintainers might also want to check whether the 
> mindless conversion of
> 
> 	'is_write' => 'is_write ? FAULT_FLAGS_WRITE : 0'
> 
> might perhaps be written in some more natural way (for example, maybe 
> you'd like to get rid of 'iswrite' as a variable entirely, and replace it 
> with a 'fault_flags' variable).
> 
> It's pushed out and tested on x86-64, but it really was such a mindless 
> conversion that I hope it works on all architectures. But I thought I'd 
> better give people a shout-out regardless.
> 
> 		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>

--
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>

  parent reply	other threads:[~2009-07-03 23:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-21 20:42 Linus Torvalds
2009-06-22  2:20 ` David Miller
2009-06-22  8:10 ` Ingo Molnar
2009-06-22  9:26 ` Martin Schwidefsky
2009-06-22 14:22 ` David Howells
2009-06-22 14:58 ` James Bottomley
2009-06-22 15:49 ` Russell King
2009-06-23  7:18 ` Nick Piggin
2009-06-23 12:49 ` [PATCH] hugetlb: fault flags instead of write_access Hugh Dickins
2009-06-23 12:56   ` Wu Fengguang
2009-06-23 21:36   ` Rik van Riel
2009-06-29 12:29   ` Mel Gorman
2009-06-23 12:52 ` [PATCH] mm: don't rely on flags coincidence Hugh Dickins
2009-06-23 13:00   ` Wu Fengguang
2009-06-23 21:38   ` Rik van Riel
2009-07-03 23:35 ` Benjamin Herrenschmidt [this message]
2009-07-04 16:44   ` handle_mm_fault() calling convention cleanup Linus Torvalds
2009-07-04 21:08     ` Benjamin Herrenschmidt
2009-07-06  7:31       ` Nick Piggin
2009-07-06 10:56         ` Benjamin Herrenschmidt
2009-07-06 11:53           ` Nick Piggin

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=1246664107.7551.11.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=hugh@veritas.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    --cc=torvalds@linux-foundation.org \
    /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