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