mm: fix misleading __GFP_REPEAT related comments

The definition and use of __GFP_REPEAT, __GFP_NOFAIL and __GFP_NORETRY in the
core VM have somewhat differing comments as to their actual semantics.
Annoyingly, the flags definition has inline and header comments, which might
be interpreted as not being equivalent.  Just add references to the header
comments in the inline ones so they don't go out of sync in the future.  In
their use in __alloc_pages() clarify that the current implementation treats
low-order allocations and __GFP_REPEAT allocations as distinct cases.

To clarify, the flags' semantics are:

__GFP_NORETRY means try no harder than one run through __alloc_pages

__GFP_REPEAT means __GFP_NOFAIL

__GFP_NOFAIL means repeat forever

order <= PAGE_ALLOC_COSTLY_ORDER means __GFP_NOFAIL

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
这个提交包含在:
Nishanth Aravamudan
2008-04-29 00:58:23 -07:00
提交者 Linus Torvalds
父节点 86051ca5ea
当前提交 ab857d0938
修改 2 个文件,包含 6 行新增5 行删除

查看文件

@@ -1611,8 +1611,9 @@ nofail_alloc:
* Don't let big-order allocations loop unless the caller explicitly
* requests that. Wait for some write requests to complete then retry.
*
* In this implementation, __GFP_REPEAT means __GFP_NOFAIL for order
* <= 3, but that may not be true in other implementations.
* In this implementation, either order <= PAGE_ALLOC_COSTLY_ORDER or
* __GFP_REPEAT mean __GFP_NOFAIL, but that may not be true in other
* implementations.
*/
do_retry = 0;
if (!(gfp_mask & __GFP_NORETRY)) {