linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Chris Down <chris@chrisdown.name>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	"Michal Koutný" <mkoutny@suse.com>
Subject: Re: [PATCH] mm, memcg: prevent missed memory.low load tears
Date: Mon, 15 Jun 2020 08:42:19 +0200	[thread overview]
Message-ID: <20200615064219.GA25296@dhcp22.suse.cz> (raw)
In-Reply-To: <20200612174437.GA391453@chrisdown.name>

On Fri 12-06-20 18:44:37, Chris Down wrote:
> Looks like one of these got missed when massaging in f86b810c2610 ("mm,
> memcg: prevent memory.low load/store tearing") with other linux-mm
> changes.
> 
> Reported-by: Michal Koutný <mkoutny@suse.com>
> Signed-off-by: Chris Down <chris@chrisdown.name>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/memcontrol.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 0b38b6ad547d..f7cc66a80348 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -6416,7 +6416,7 @@ enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root,
>  
>  	if (parent == root) {
>  		memcg->memory.emin = READ_ONCE(memcg->memory.min);
> -		memcg->memory.elow = memcg->memory.low;
> +		memcg->memory.elow = READ_ONCE(memcg->memory.low);
>  		goto out;
>  	}
>  
> @@ -6428,7 +6428,8 @@ enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root,
>  			atomic_long_read(&parent->memory.children_min_usage)));
>  
>  	WRITE_ONCE(memcg->memory.elow, effective_protection(usage, parent_usage,
> -			memcg->memory.low, READ_ONCE(parent->memory.elow),
> +			READ_ONCE(memcg->memory.low),
> +			READ_ONCE(parent->memory.elow),
>  			atomic_long_read(&parent->memory.children_low_usage)));
>  
>  out:
> -- 
> 2.27.0
> 

-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2020-06-15  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12 17:44 Chris Down
2020-06-15  6:42 ` Michal Hocko [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=20200615064219.GA25296@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=chris@chrisdown.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mkoutny@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