From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Weiner Subject: Re: [PATCH] mm/memcontrol: exclude @root from checks in mem_cgroup_low Date: Mon, 5 Jun 2017 11:16:22 -0400 Message-ID: <20170605151622.GB10679@cmpxchg.org> References: <1496434412-21005-1-git-send-email-sean.j.christopherson@intel.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmpxchg.org ; s=x; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cpuYlQJ63+e7jijrDDtnR407ptuhwTNqPYBgWu3xvyw=; b=bYPrUSOGUStJK8bzR+/LUdZavO j32uK9bF467JkR2wdCsO/u55WOWakDBZhJbpWZ2Ia+SLaVU7+eWSPLPB1iCg2eIMWP5hVDnzueRu/ Z1H46vhxodNHnNcW0RfV9jWhO3CBcOkLLcRw8DITfa85SlEaMpikj+QU+pDQK9Hr9OYY=; Content-Disposition: inline In-Reply-To: <1496434412-21005-1-git-send-email-sean.j.christopherson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sean Christopherson Cc: mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Andrew Morton On Fri, Jun 02, 2017 at 01:13:32PM -0700, Sean Christopherson wrote: > Make @root exclusive in mem_cgroup_low; it is never considered low > when looked at directly and is not checked when traversing the tree. > In effect, @root is handled identically to how root_mem_cgroup was > previously handled by mem_cgroup_low. > > If @root is not excluded from the checks, a cgroup underneath @root > will never be considered low during targeted reclaim of @root, e.g. > due to memory.current > memory.high, unless @root is misconfigured > to have memory.low > memory.high. > > Excluding @root enables using memory.low to prioritize memory usage > between cgroups within a subtree of the hierarchy that is limited by > memory.high or memory.max, e.g. when ROOT owns @root's controls but > delegates the @root directory to a USER so that USER can create and > administer children of @root. > > For example, given cgroup A with children B and C: > > A > / \ > B C > > and > > 1. A/memory.current > A/memory.high > 2. A/B/memory.current < A/B/memory.low > 3. A/C/memory.current >= A/C/memory.low > > As 'A' is high, i.e. triggers reclaim from 'A', and 'B' is low, we > should reclaim from 'C' until 'A' is no longer high or until we can > no longer reclaim from 'C'. If 'A', i.e. @root, isn't excluded by > mem_cgroup_low when reclaming from 'A', then 'B' won't be considered > low and we will reclaim indiscriminately from both 'B' and 'C'. > > Signed-off-by: Sean Christopherson Good catch, thank you Sean. Acked-by: Johannes Weiner