Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2888647ybl; Thu, 19 Dec 2019 23:49:58 -0800 (PST) X-Google-Smtp-Source: APXvYqzW8PII34KwxKFBlflDeMwgNntFLZQPybVHfunCEGdAt2GSvaAB3/AJ7Y0hTnLjsCUvYJUX X-Received: by 2002:a05:6830:128e:: with SMTP id z14mr13003473otp.184.1576828198329; Thu, 19 Dec 2019 23:49:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576828198; cv=none; d=google.com; s=arc-20160816; b=PxXo70GybQ73nxGCRLHNl4RijNoZZmJwR9OzWUEhil7p36C9btw06qCnRlr3XdDJdN BtfUNPLyl851A63DdS8wDuR5WzwGsTBXbf+ZaO60I/W+NYUJbjs+naz2vWwQYT1ttwCZ Gklp+0vdnPVYxGd3CBA8ZV2UHzz56lXxftSdBw8pvwscl8yP3/lO8VDmSXaTsyuh53Sb OPtsZk0a0OBKteQs68IqLxTsiNeRln/69wVSXweUP5Ph9o91ClSruGt+hxAcgF60XEJR GJ63ZgKh38nI8kvM1ioGjRo5NRrr8rD5I3+a5w2BKEXOsgUf/8BhsEOzKME4JLv6nM/g tcuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=Ryft0t1jaaRRgpPa1+HDWlXGDwDm4zqGCF4NyTPqBGw=; b=CYthx50bH4qFYjswuGfjTeVwyMGnyAdaPzoPyiWu29KWWM+t5wQ5zaDvBHiu/HF+31 V//EHc9tkUi7wdO9le0j4Oo282HqBkZmzaaNMAAfuA0DUbnzHhWF3yWbXGU7EkeeR0tw ZNl5ZchWbnJQtbsEGmRCFUsru0bky3ZnYw8Mi6efIrdaQjI7mrqUMCh3vZqu5b1GE8O0 jJdn/tdP1mDZH3dyKxwvuwwGMbCxjUTzy9oJE1HJJEBRUnd5kwJ8mclgTX4EjJKcIbhP 5cBKmQB7NEmk71okh9ZNr4XBbefhzpUp6ucLozF61H2V2q0NbEhgpTHchoMlz2hAjpgn TghA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si4770937otk.226.2019.12.19.23.49.46; Thu, 19 Dec 2019 23:49:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727169AbfLTHsy convert rfc822-to-8bit (ORCPT + 99 others); Fri, 20 Dec 2019 02:48:54 -0500 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:37385 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbfLTHsy (ORCPT ); Fri, 20 Dec 2019 02:48:54 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=teawaterz@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0TlPlhLn_1576828129; Received: from 30.30.208.24(mailfrom:teawaterz@linux.alibaba.com fp:SMTPD_---0TlPlhLn_1576828129) by smtp.aliyun-inc.com(127.0.0.1); Fri, 20 Dec 2019 15:48:50 +0800 Content-Type: text/plain; charset=gb2312 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH] mm: vmscan: memcg: Add global shrink priority From: teawater In-Reply-To: <20191219112618.GA72828@chrisdown.name> Date: Fri, 20 Dec 2019 15:48:49 +0800 Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Roman Gushchin , shakeelb@google.com, Yang Shi , tj@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Content-Transfer-Encoding: 8BIT Message-Id: <1A189775-3B43-4C49-B827-15D001C2D2FC@linux.alibaba.com> References: <1576662179-16861-1-git-send-email-teawaterz@linux.alibaba.com> <20191218140952.GA255739@chrisdown.name> <25AA9500-B249-42C2-B162-2B8D4EE83BB0@linux.alibaba.com> <20191219112618.GA72828@chrisdown.name> To: Chris Down X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > ?? 2019??12??19?գ?19:26??Chris Down д???? > > Hi Hui, > > teawater writes: >> Memory.min, low, high can affect the global shrink behavior. They can help task keep some pages to help protect performance. >> >> But what I want is the low priority tasks (the tasks that performance is not very important) do more shrink first. And when low priority tasks doesn??t have enough pages to be dropped and system need more free page, shrink the high priority task??s pages. Because at this time, system??s stable is more important than the performance of priority task. >> With memory.min and memory.low, I have no idea to config them to support this. That is why I add global shrink priority. > > For sure, that's what I'm suggesting you use memory.{min,low} for -- you define some subset of the cgroup hierarchy as "protected", and then you bias reclaim away from protected cgroups (and thus *towards* unprotected cgroups) by biasing the size of LRU scanning. See my patch that went into 5.4 and the examples in 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 study[0]. It's not exactly equivalent technically to your solution, but the end goals are similar. > > Thanks, > > Chris > > 0: https://facebookmicrosites.github.io/cgroup2/docs/overview.html#case-study-the-fbtax2-project Hi Chris, Really appreciate for your help. I will try to use it handle my problem. Best, Hui