Re: [PATCH] mm, page_alloc: warn about empty nodemask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Sep 9, 2016, at 07:26, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> 
> On Wed, 07 Sep 2016 08:41:26 +0800 Li Zhong <zhong@xxxxxxxxxxxxxxxxxx> wrote:
> 
>> Warn about allocating with an empty nodemask, it would be easier to
>> understand than oom messages. The check is added in the slow path.
>> 
>> Suggested-by: Vlastimil Babka <vbabka@xxxxxxx>
>> Signed-off-by: Li Zhong <zhong@xxxxxxxxxxxxxxxxxx>
>> --- 
>> mm/page_alloc.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>> 
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index a2214c6..d624ff3 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -3448,6 +3448,12 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
>> 	if (page)
>> 		goto got_pg;
>> 
>> +	if (ac->nodemask && nodes_empty(*ac->nodemask)) {
>> +		pr_warn("nodemask is empty\n");
>> +		gfp_mask &= ~__GFP_NOWARN;
>> +		goto nopage;
>> +	}
>> +
> 
> Wouldn't it be better to do
> 
> 	if (WARN_ON(ac->nodemask && nodes_empty(*ac->nodemask)) {
> 		...
> 
> so we can identify the misbehaving call site?

I think with __GFP_NOWARN cleared, we could know the call site from warn_alloc_failed(). 
And the message “nodemask is empty” makes the error obvious without going to the source. 

Thanks, Zhong

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]