handle_mm_fault() calling convention cleanup..

Linus Torvalds
2009-06-21T20:42:35Z

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

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: email@kvack.org