linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeelb@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Roman Gushchin" <guro@fb.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Linux MM" <linux-mm@kvack.org>, "Michal Hocko" <mhocko@suse.com>,
	"Michal Koutný" <mkoutny@suse.com>,
	mm-commits@vger.kernel.org, stable@vger.kernel.org,
	"Tejun Heo" <tj@kernel.org>,
	"Linus Torvalds" <torvalds@linux-foundation.org>
Subject: Re: [patch 06/19] mm: memcontrol: prevent starvation when writing memory.high
Date: Sun, 24 Jan 2021 10:01:51 -0800	[thread overview]
Message-ID: <CALvZod7vf=NF40xSFqtugaZUaVx7X75LS10dpF6Q8LR=R=JhDA@mail.gmail.com> (raw)
In-Reply-To: <20210124050119.34lm1Gw1Q%akpm@linux-foundation.org>

On Sat, Jan 23, 2021 at 9:01 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> From: Johannes Weiner <hannes@cmpxchg.org>
> Subject: mm: memcontrol: prevent starvation when writing memory.high
>
> When a value is written to a cgroup's memory.high control file, the
> write() context first tries to reclaim the cgroup to size before putting
> the limit in place for the workload.  Concurrent charges from the workload
> can keep such a write() looping in reclaim indefinitely.
>
> In the past, a write to memory.high would first put the limit in place for
> the workload, then do targeted reclaim until the new limit has been met -
> similar to how we do it for memory.max.  This wasn't prone to the
> described starvation issue.  However, this sequence could cause excessive
> latencies in the workload, when allocating threads could be put into long
> penalty sleeps on the sudden memory.high overage created by the write(),
> before that had a chance to work it off.
>
> Now that memory_high_write() performs reclaim before enforcing the new
> limit, reflect that the cgroup may well fail to converge due to concurrent
> workload activity.  Bail out of the loop after a few tries.
>
> Link: https://lkml.kernel.org/r/20210112163011.127833-1-hannes@cmpxchg.org
> Fixes: 536d3bf261a2 ("mm: memcontrol: avoid workload stalls when lowering memory.high")
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> Reviewed-by: Shakeel Butt <shakeelb@google.com>
> Reported-by: Tejun Heo <tj@kernel.org>
> Acked-by: Roman Gushchin <guro@fb.com>
> Reviewed-by: Michal Koutný <mkoutny@suse.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: <stable@vger.kernel.org>    [5.8+]
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Johannes requested to replace this patch with
https://lore.kernel.org/linux-mm/20210122184341.292461-1-hannes@cmpxchg.org/


  reply	other threads:[~2021-01-24 18:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24  5:00 incoming Andrew Morton
2021-01-24  5:00 ` [patch 01/19] x86/setup: don't remove E820_TYPE_RAM for pfn 0 Andrew Morton
2021-01-24  5:01 ` [patch 02/19] mm: fix initialization of struct page for holes in memory layout Andrew Morton
2021-01-24  5:01 ` [patch 03/19] mm: memcg/slab: optimize objcg stock draining Andrew Morton
2021-01-24  5:01 ` [patch 04/19] mm: memcg: fix memcg file_dirty numa stat Andrew Morton
2021-01-24  5:01 ` [patch 05/19] mm: fix numa stats for thp migration Andrew Morton
2021-01-24  5:01 ` [patch 06/19] mm: memcontrol: prevent starvation when writing memory.high Andrew Morton
2021-01-24 18:01   ` Shakeel Butt [this message]
2021-01-24 18:35     ` Linus Torvalds
2021-01-24  5:01 ` [patch 07/19] kasan: fix unaligned address is unhandled in kasan_remove_zero_shadow Andrew Morton
2021-01-24  5:01 ` [patch 08/19] kasan: fix incorrect arguments passing in kasan_add_zero_shadow Andrew Morton
2021-01-24  5:01 ` [patch 09/19] kasan: fix HW_TAGS boot parameters Andrew Morton
2021-01-24  5:01 ` [patch 10/19] kasan, mm: fix conflicts with init_on_alloc/free Andrew Morton
2021-01-24  5:01 ` [patch 11/19] kasan, mm: fix resetting page_alloc tags for HW_TAGS Andrew Morton
2021-01-24  5:01 ` [patch 12/19] ubsan: disable unsigned-overflow check for i386 Andrew Morton
2021-01-24  5:01 ` [patch 13/19] mm: fix page reference leak in soft_offline_page() Andrew Morton
2021-01-24  5:01 ` [patch 14/19] sparc/mm/highmem: flush cache and TLB Andrew Morton
2021-01-24  5:02 ` [patch 15/19] mm/highmem: prepare for overriding set_pte_at() Andrew Morton
2021-01-24  5:02 ` [patch 16/19] mips/mm/highmem: use set_pte() for kmap_local() Andrew Morton
2021-01-24  5:02 ` [patch 17/19] powerpc/mm/highmem: use __set_pte_at() " Andrew Morton
2021-01-24  5:02 ` [patch 18/19] proc_sysctl: fix oops caused by incorrect command parameters Andrew Morton
2021-01-24  5:02 ` [patch 19/19] MAINTAINERS: add a couple more files to the Clang/LLVM section Andrew Morton

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='CALvZod7vf=NF40xSFqtugaZUaVx7X75LS10dpF6Q8LR=R=JhDA@mail.gmail.com' \
    --to=shakeelb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mkoutny@suse.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).