From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CB91C43603 for ; Thu, 19 Dec 2019 11:26:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4DCB021D7D for ; Thu, 19 Dec 2019 11:26:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="Nj6BUQEZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DCB021D7D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E6C3E8E0166; Thu, 19 Dec 2019 06:26:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E1C8B8E00F5; Thu, 19 Dec 2019 06:26:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D32798E0166; Thu, 19 Dec 2019 06:26:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id BB6AA8E00F5 for ; Thu, 19 Dec 2019 06:26:21 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 5F6E48249980 for ; Thu, 19 Dec 2019 11:26:21 +0000 (UTC) X-FDA: 76281662562.25.mask52_71a2543def70c X-HE-Tag: mask52_71a2543def70c X-Filterd-Recvd-Size: 4645 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Thu, 19 Dec 2019 11:26:20 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id j42so5566891wrj.12 for ; Thu, 19 Dec 2019 03:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ZxINuY2pTedRL5AOR8tT78C1M2jclzElPJ7W9Ytee4A=; b=Nj6BUQEZ+CRfeqS8i/TOUwhdSD/LqqktFae+t7JfgDcNBTv07sDWW+AN6qK4jJxq2b bD96kwCBm+NCxbmhwMq95YWUG6nwJtQUz+B0gWcpUboDbYAvGxtqalmKIIDrPQsdQakD 0vumq1+lukQ7gHQ8kRlgoND+EH8XGHRzhB5Qw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ZxINuY2pTedRL5AOR8tT78C1M2jclzElPJ7W9Ytee4A=; b=sCTZLXlSdu86qQomrVWLz97gNBUlTpA8Z9iJv0oUc5sdSBTyM9G65cHISAALMFhWNv XlKRZjr1oQK4Jxk7V8Inq71adRZRmM33T7uLJAHB5lXYxbTBxwpQvOGVlb/3CDCVgbWY taEUyvPyA/b1IVewT3qBz68PE1u3sA1yH9vd0QpBuSUYi90fhkcAMjN6r5PHDw9r7x31 /SHlGmMjLDFeMQ5aCbiK4MwRg6HIv3iiboohWRFz0jrpQy44V5Dc2gybbeN6B6XHMcnB 8swGSzPyfBnchiFkeTZU+uoD3wlHIuQ/t2yhQPkdBb2cNpBXuF4aKrJmnp7rHbu66KG2 OWaA== X-Gm-Message-State: APjAAAVCOueUmwNxGL1fhiii+xbURKzf78u7LCrR7EtF2eEPcTf67nlk 9OOKUV7ObnTDMIUx8dmYgIgmEg== X-Google-Smtp-Source: APXvYqzYYXrskQ1fe2mPfv0sYrehg6SOYYoZVfiW64/lsm4OI0an3dqEGvYMZJ/Hh5HOscaWldIplg== X-Received: by 2002:a05:6000:12ce:: with SMTP id l14mr9363595wrx.342.1576754779511; Thu, 19 Dec 2019 03:26:19 -0800 (PST) Received: from localhost ([2620:10d:c092:200::1:c2e5]) by smtp.gmail.com with ESMTPSA id a16sm6039042wrt.37.2019.12.19.03.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 03:26:18 -0800 (PST) Date: Thu, 19 Dec 2019 11:26:18 +0000 From: Chris Down To: teawater Cc: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, guro@fb.com, shakeelb@google.com, Yang Shi , tj@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: vmscan: memcg: Add global shrink priority Message-ID: <20191219112618.GA72828@chrisdown.name> References: <1576662179-16861-1-git-send-email-teawaterz@linux.alibaba.com> <20191218140952.GA255739@chrisdown.name> <25AA9500-B249-42C2-B162-2B8D4EE83BB0@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <25AA9500-B249-42C2-B162-2B8D4EE83BB0@linux.alibaba.com> Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000132, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Hui, teawater writes: >Memory.min, low, high can affect the global shrink behavior. They can h= elp=20 >task keep some pages to help protect performance. > >But what I want is the low priority tasks (the tasks that performance is= not=20 >very important) do more shrink first. And when low priority tasks doesn= =E2=80=99t=20 >have enough pages to be dropped and system need more free page, shrink t= he=20 >high priority task=E2=80=99s pages. Because at this time, system=E2=80=99= s stable is more=20 >important than the performance of priority task. >With memory.min and memory.low, I have no idea to config them to support= this. =20 >That is why I add global shrink priority. For sure, that's what I'm suggesting you use memory.{min,low} for -- you = define=20 some subset of the cgroup hierarchy as "protected", and then you bias rec= laim=20 away from protected cgroups (and thus *towards* unprotected cgroups) by b= iasing=20 the size of LRU scanning. See my patch that went into 5.4 and the example= s in=20 the commit message: commit 9783aa9917f8ae24759e67bf882f1aba32fe4ea1 Author: Chris Down Date: Sun Oct 6 17:58:32 2019 -0700 mm, memcg: proportional memory.{low,min} reclaim You can see how we're using memory.{low,min} to achieve this in this case= =20 study[0]. It's not exactly equivalent technically to your solution, but t= he end=20 goals are similar. Thanks, Chris 0: https://facebookmicrosites.github.io/cgroup2/docs/overview.html#case-s= tudy-the-fbtax2-project