linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: hughd@google.com, mhocko@suse.cz, vbabka@suse.cz,
	rientjes@google.com, linux-mm@kvack.org
Subject: Re: [PATCH] mm,ksm: add __GFP_HIGH to the allocation in alloc_stable_node()
Date: Wed, 28 Sep 2016 10:38:45 +0800	[thread overview]
Message-ID: <57EB2D35.4070006@huawei.com> (raw)
In-Reply-To: <20160920140639.2f1ea83784d994699e713c2e@linux-foundation.org>

On 2016/9/21 5:06, Andrew Morton wrote:
> On Tue, 20 Sep 2016 14:54:44 +0800 zhongjiang <zhongjiang@huawei.com> wrote:
>
>> From: zhong jiang <zhongjiang@huawei.com>
>>
>> Accoding to HUgh's suggestion, alloc_stable_node() with GFP_KERNEL
>> will cause the hungtask, despite less possiblity.
>>
>> At present, if alloc_stable_node allocate fails, two break_cow may
>> want to allocate a couple of pages, and the issue will come up when
>> free memory is under pressure.
>>
>> we fix it by adding the __GFP_HIGH to GFP. because it grant access to
>> some of meory reserves. it will make progess to make it allocation
>> successful at the utmost.
>>
>> --- a/mm/ksm.c
>> +++ b/mm/ksm.c
>> @@ -299,7 +299,7 @@ static inline void free_rmap_item(struct rmap_item *rmap_item)
>>  
>>  static inline struct stable_node *alloc_stable_node(void)
>>  {
>> -	return kmem_cache_alloc(stable_node_cache, GFP_KERNEL);
>> +	return kmem_cache_alloc(stable_node_cache, GFP_KERNEL | __GFP_HIGH);
>>  }
>>  
>>  static inline void free_stable_node(struct stable_node *stable_node)
> It is very hard for a reader to understand why this __GFP_HIGH is being
> used here, so we should have a code comment explaining the reasoning,
> please.
  ok,  I will add  some code comment later.
> --
> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
>


--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2016-09-28  2:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20  6:54 [PATCH] mm,ksm: add __GFP_HIGH to the allocation in alloc_stable_node() zhongjiang
2016-09-20 20:35 ` Hugh Dickins
2016-09-20 21:06 ` Andrew Morton
2016-09-28  2:38   ` zhong jiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57EB2D35.4070006@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).