Re: [PATCH 1/3] mm: Minor clean-up of page flags in mm/page_alloc.c v4

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Russ Anderson <rja@...>
Cc: <linux-kernel@...>, <linux-ia64@...>, Andrew Morton <akpm@...>, Tony Luck <tony.luck@...>, Christoph Lameter <clameter@...>
Date: Wednesday, May 14, 2008 - 4:28 pm

On Tue, 13 May 2008, Russ Anderson wrote:

Could we (a) make the naming reflect the *use* rather than the flags 
involved and (b) perhaps add a comment about that use at the point of 
definition?


Because here I'm now otherwise looking at the code, and I wonder
 - why the extra odd parenthesis?
 - what does PAGE_FLAG_RECLAIM mean?

and it would be much nicer (I think) if the mask was instead called 
something that reflected what it was all about, ie something along the 
lines of PAGE_FLAG_CLEAR_WHEN_BAD instead.


Same exact thing. I wonder
 - why are those parenthesis there
 - what does "PAGE_FLAGS_RESERVE" mean?

Woudln't it be much more readable if it was called 
"PAGE_FLAGS_CHECK_AT_FREE" or something? That says "those flags will be 
checked when the page is free'd", and now the use _and_ the definition 
hopefully makes some sense?


And again - parenthesis, and perhaps "PAGE_FLAGS_CHECK_AT_PREP"?


This part would also be more explainable - rather than being a random 
collection of flags, wouldn't it be more natural to think of them as 
"flags I check at free", or "flags that I clear when they are corrupt" or 
"flags that I check before I pass on a new page allocation".

Right now it is _totally_ unclear why we should call something 
PAGE_FLAGS_DIRTY when it has a lot of other bits set than just PG_dirty. 
Hmm?

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/3] mm: Minor clean-up of page flags in mm/page_..., Linus Torvalds, (Wed May 14, 4:28 pm)