linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Xunlei Pang <xlpang@linux.alibaba.com>
To: Roman Gushchin <guro@fb.com>
Cc: Michal Hocko <mhocko@suse.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH 1/3] mm/memcg: Fix min/low usage in propagate_protected_usage()
Date: Wed, 5 Dec 2018 16:58:31 +0800	[thread overview]
Message-ID: <03652447-d9ba-45ea-3365-46a4caf96748@linux.alibaba.com> (raw)
In-Reply-To: <20181203180008.GB31090@castle.DHCP.thefacebook.com>

Hi Roman,

On 2018/12/4 AM 2:00, Roman Gushchin wrote:
> On Mon, Dec 03, 2018 at 04:01:17PM +0800, Xunlei Pang wrote:
>> When usage exceeds min, min usage should be min other than 0.
>> Apply the same for low.
>>
>> Signed-off-by: Xunlei Pang <xlpang@linux.alibaba.com>
>> ---
>>  mm/page_counter.c | 12 ++----------
>>  1 file changed, 2 insertions(+), 10 deletions(-)
>>
>> diff --git a/mm/page_counter.c b/mm/page_counter.c
>> index de31470655f6..75d53f15f040 100644
>> --- a/mm/page_counter.c
>> +++ b/mm/page_counter.c
>> @@ -23,11 +23,7 @@ static void propagate_protected_usage(struct page_counter *c,
>>  		return;
>>  
>>  	if (c->min || atomic_long_read(&c->min_usage)) {
>> -		if (usage <= c->min)
>> -			protected = usage;
>> -		else
>> -			protected = 0;
>> -
>> +		protected = min(usage, c->min);
> 
> This change makes sense in the combination with the patch 3, but not as a
> standlone "fix". It's not a bug, it's a required thing unless you start scanning
> proportionally to memory.low/min excess.
> 
> Please, reflect this in the commit message. Or, even better, merge it into
> the patch 3.

The more I looked the more I think it's a bug, but anyway I'm fine with
merging it into patch 3 :-)

> 
> Also, please, make sure that cgroup kselftests are passing after your changes.

Sure, will do and send v2. Thanks for your inputs.

  reply	other threads:[~2018-12-05  8:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03  8:01 Xunlei Pang
2018-12-03  8:01 ` [PATCH 2/3] mm/vmscan: Enable kswapd to reclaim low-protected memory Xunlei Pang
2018-12-03 11:56   ` Michal Hocko
2018-12-03 15:20     ` Xunlei Pang
2018-12-03 17:22       ` Michal Hocko
2018-12-04  2:40         ` Xunlei Pang
2018-12-04  7:25           ` Michal Hocko
2018-12-04  8:44             ` Xunlei Pang
2018-12-03  8:01 ` [PATCH 3/3] mm/memcg: Avoid reclaiming below hard protection Xunlei Pang
2018-12-03 11:57   ` Michal Hocko
2018-12-04  2:53     ` Xunlei Pang
2018-12-03 11:54 ` [PATCH 1/3] mm/memcg: Fix min/low usage in propagate_protected_usage() Michal Hocko
2018-12-03 14:49   ` Xunlei Pang
2018-12-03 18:00 ` Roman Gushchin
2018-12-05  8:58   ` Xunlei Pang [this message]
2018-12-05 23:11     ` Roman Gushchin

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=03652447-d9ba-45ea-3365-46a4caf96748@linux.alibaba.com \
    --to=xlpang@linux.alibaba.com \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    /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