From patchwork Wed Jan 9 19:14:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10754845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67BC86C2 for ; Wed, 9 Jan 2019 19:18:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5872E289BF for ; Wed, 9 Jan 2019 19:18:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A40A289CB; Wed, 9 Jan 2019 19:18:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12630289BF for ; Wed, 9 Jan 2019 19:18:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 393938E009E; Wed, 9 Jan 2019 14:18:51 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 36B968E0038; Wed, 9 Jan 2019 14:18:51 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 280A88E009E; Wed, 9 Jan 2019 14:18:51 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id D9DCE8E0038 for ; Wed, 9 Jan 2019 14:18:50 -0500 (EST) Received: by mail-pf1-f199.google.com with SMTP id u20so5947638pfa.1 for ; Wed, 09 Jan 2019 11:18:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=8XCIJfqelyCc8vq4TfoTZne/96LBokAk2miuT+Bctcc=; b=BMMkVxMMaG5MzJxUb5zqZAOwWSmwKfipblp58SfCfZglMLgOw4oRzKaEeLa4xCNCN7 qVek2eczxkjVQWyPJ1B8BQloILOnyrAb0W/y+YZTsi35AW0LeTO7xZCNPaT5HIkzp32n W8x6qA2Bhto+kqmSiFOECT6QeDFYJIozFB4Y+RCDZouygTJoTmPBV5s5aSSp26TFTXYi 8CZrW3HphCnUI2bjwxgJqv2hkWWUVF5XLJ5PC4ZaD9EL2bejXEPOxOuhpuiiNbVDA1aL eMzF+KN3V2tuaH8fUwGr80OnJXqLWX0T3poDhzqD/aCeq+kfjkvZnhHwaFzgK2dTA78o 6INg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Gm-Message-State: AJcUukeaQl3+tO6RRLCaQy6rdKWUqpCW6C+/C0C/ZX+Srq5FtJYjboNA eJWfcIUoGVKFMLEs03yIOmETJVHka7ZQlmh45M8kTTQw2cYLbfHSAJWcIrWv1agQXpQ47vfwA0K kIEYF2mRMSIMo/x++hF7jp4m6Gaa7nz09u85HMCiu7afo2fvIdh/K64xIlh/NsagSsg== X-Received: by 2002:a62:a1a:: with SMTP id s26mr7237964pfi.31.1547061530558; Wed, 09 Jan 2019 11:18:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN6jH5VJIGk7DTIY5jxAIvrQM56ZYzBqDjGCNg2ciY02a84WTOUOYJ6WiJ9WHtMimhhzIilc X-Received: by 2002:a62:a1a:: with SMTP id s26mr7237916pfi.31.1547061529393; Wed, 09 Jan 2019 11:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547061529; cv=none; d=google.com; s=arc-20160816; b=gkv9YwYiZquThoSCUBYpBw8z90Z9603mHSuD647K9Gcs5JmSCDv6UpDlmhCGNgL8UB Zl5peHNs2DtVEG/9bmQe9NYlN0gX0quXrOZXlJs0muDGbsUzSeP4jc8qYYD7mc/xVRLo ILa8T8lttwC2rFSqHj4M7xWk8UoiRlMUrrNfARTzAh2HXINvIzppYsG2kVT4rVUhjlRf Ma33iowkmuzhb0wGtDFn+iWUVUXiObTYpYzSW6azCTxCHa6KAP86/0xZjh4Wtmn3P4tU VQNyTvNZLPUPtP7xliOjRZhT103+7S4/dfmkHKsxY9s14lfIlQFVNZgi2wcxfgaUSUBX YOyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=8XCIJfqelyCc8vq4TfoTZne/96LBokAk2miuT+Bctcc=; b=SyZ4xR7oS7lghDeA667ccwtZ0IrHLnnjKwHcI6ZbteQ8lufGouqhP3C1RvktEY6ZeR Br4CfsGpEQDLcbnpHPX1g49og5XwBaehMNsj0VZ3oNw9CzSTGeVujYFoBatGSdHqU5xI f6W7qXyPpZskRbcbZPxF8z1U7diQNBx8gL/W6Bdj15L9wD6xyeAhFed1BCn6McW1eoGr GB15faxBzrQbFMjI6Em5cmu5lrX61Hvlic55gVER6IQPWInZ+rl0UURTE1VAdKPesBa4 AmDxg/uSiegpM34c57zP4o9XHIZymeh1obOzAHiWWW+LBqIgvQ4QfuBgDkDowxJCbFh1 jFRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com. [115.124.30.132]) by mx.google.com with ESMTPS id p14si5220131pfi.12.2019.01.09.11.18.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 11:18:49 -0800 (PST) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.132 as permitted sender) client-ip=115.124.30.132; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04446;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0THtvvDg_1547061291; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0THtvvDg_1547061291) by smtp.aliyun-inc.com(127.0.0.1); Thu, 10 Jan 2019 03:14:59 +0800 From: Yang Shi To: mhocko@suse.com, hannes@cmpxchg.org, shakeelb@google.com, akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 1/5] doc: memcontrol: fix the obsolete content about force empty Date: Thu, 10 Jan 2019 03:14:41 +0800 Message-Id: <1547061285-100329-2-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1547061285-100329-1-git-send-email-yang.shi@linux.alibaba.com> References: <1547061285-100329-1-git-send-email-yang.shi@linux.alibaba.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP We don't do page cache reparent anymore when offlining memcg, so update force empty related content accordingly. Reviewed-by: Shakeel Butt Acked-by: Michal Hocko Cc: Johannes Weiner Signed-off-by: Yang Shi --- Documentation/cgroup-v1/memory.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/cgroup-v1/memory.txt b/Documentation/cgroup-v1/memory.txt index 3682e99..8e2cb1d 100644 --- a/Documentation/cgroup-v1/memory.txt +++ b/Documentation/cgroup-v1/memory.txt @@ -70,7 +70,7 @@ Brief summary of control files. memory.soft_limit_in_bytes # set/show soft limit of memory usage memory.stat # show various statistics memory.use_hierarchy # set/show hierarchical account enabled - memory.force_empty # trigger forced move charge to parent + memory.force_empty # trigger forced page reclaim memory.pressure_level # set memory pressure notifications memory.swappiness # set/show swappiness parameter of vmscan (See sysctl's vm.swappiness) @@ -459,8 +459,9 @@ About use_hierarchy, see Section 6. the cgroup will be reclaimed and as many pages reclaimed as possible. The typical use case for this interface is before calling rmdir(). - Because rmdir() moves all pages to parent, some out-of-use page caches can be - moved to the parent. If you want to avoid that, force_empty will be useful. + Though rmdir() offlines memcg, but the memcg may still stay there due to + charged file caches. Some out-of-use page caches may keep charged until + memory pressure happens. If you want to avoid that, force_empty will be useful. Also, note that when memory.kmem.limit_in_bytes is set the charges due to kernel pages will still be seen. This is not considered a failure and the From patchwork Wed Jan 9 19:14:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10754843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B0C7E6C2 for ; Wed, 9 Jan 2019 19:18:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A16C228CEF for ; Wed, 9 Jan 2019 19:18:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9420028FA6; Wed, 9 Jan 2019 19:18:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B510228CEF for ; Wed, 9 Jan 2019 19:18:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D5808E009D; Wed, 9 Jan 2019 14:18:17 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 985A88E0038; Wed, 9 Jan 2019 14:18:17 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8725B8E009D; Wed, 9 Jan 2019 14:18:17 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by kanga.kvack.org (Postfix) with ESMTP id 4293F8E0038 for ; Wed, 9 Jan 2019 14:18:17 -0500 (EST) Received: by mail-pl1-f197.google.com with SMTP id m13so4713924pls.15 for ; Wed, 09 Jan 2019 11:18:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=EN+sxvfh+Jvfs8kApQQJpfLqOm7GMQaU4B1T4WVue8o=; b=g+AbmeSGGoAjkYVMojXHc963gk+dizS+MdAsLiV4q2/p04hc/3+jlUgnzCFQdfS1eR 6JIkm7M/bRaGdxt1qwUTrMNbWyRPCjwWKyR0mycQV0yOIuWVpAxuSavsVTUnV2rFfn16 Vmh1SJWBECLQUEfvs/aZqq78Wy121yPnuB2oDeWB9na7B+D9zn82nxKaRItobTZv9OUO spoxuVH3ue5tQMCLlUzFumX4YFedXivxCfEzfnt5hGqbHK2459C04FV0eiOTEhCs6nSh 7FsY7DZGOB7yMugv2VaMaNvDNcatdLTm82m4V8yObt5BPiacWGx0JP+3o5sIi2bvxjRz FhWQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.37 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Gm-Message-State: AJcUukcoTkUckIB6eTOja1jBZV1U8VFHCx0PM9rbgM79e98LspZte+kp 62fPlHd1XB0updJhGwjGRapDmLmcbw5CLyaaMkBiv1Y/e84BPeIo/8Rkw2aA9ZQg3Z8zhRcUnsp FaFOOQbfgNbRc9VI5K5+xSHLGLRyTcZcqX20o0gguWuai3DOa1ITDVNmiMDkjCXNwNg== X-Received: by 2002:a63:e247:: with SMTP id y7mr4145811pgj.84.1547061496878; Wed, 09 Jan 2019 11:18:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN63BzAdbRx0P3fxrpx6TLy7xgnenvRSIOyUVOYdW8FU/MRk4Gt6kq29xwx6uUkvQGcNJx62 X-Received: by 2002:a63:e247:: with SMTP id y7mr4145756pgj.84.1547061495824; Wed, 09 Jan 2019 11:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547061495; cv=none; d=google.com; s=arc-20160816; b=Z5dmv/m1TjcfA2ObpqQ3oHGNMDjmZ1Oc32jd8UAlUkwcc2gzUCzcbO5LI0b011gqMU CcVv203/mKdDGvGxfEW1Wu2YeVd7bj+4tWn5lWMtccBBE05SqHN3RPNACYgzTcnzU7HF jhGvKPZ3/Czaj5pQKB0InkyNoKOxpAwbwIldNK6SrAd3rOwiwi6MmDj1cG+MzSc3fWEY og4dSrfMe6gaiOaYj8+ctn09DgmlieRx2DK6OpS4E5K7y5tQHkU4gexX79lgDnOsJwJq Lfe/rWBrnh3ExYNp1QrH02SPOMmTcSGGfnDb0KUNp2j1tZpnpSgesL2WX9gtKWd2xVX2 ZpnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=EN+sxvfh+Jvfs8kApQQJpfLqOm7GMQaU4B1T4WVue8o=; b=GBrjoc9uCb6vG6ZwC2SUMY8EgcFdIn7FtFPmpZXLcvhS2SmKkrKg5rkQnpDkZ9UKKh P289UCRGCiSDTlbLpJ/+oY7JJ7Zx4xat3K1JQepLF5P+oljgM9nJLBsCvtwtTPKix7qx gdPQTgzVqXTRL6vCz8qdccMjyBdhKM2+Fnt+E0Ctq2Rw+iBTH0yVF/op2JE2VYY1ar0u +04iSxSV2G1qN/xq8wzpYXNanXMZSTyuwZTU9GVlHk3k6tHBa+d5LDOAZYjvsF3hVFeZ hD++ADdxrhc0o4Os6E+LNL6W9Gzb9Ytd9NG8vW8QoNXjyUhozvXV7+CCeuq6Cb+VCUqF QaWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.37 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out4437.biz.mail.alibaba.com (out4437.biz.mail.alibaba.com. [47.88.44.37]) by mx.google.com with ESMTPS id q16si22876825pgh.185.2019.01.09.11.18.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 11:18:15 -0800 (PST) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.37 as permitted sender) client-ip=47.88.44.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.37 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0THtvvDg_1547061291; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0THtvvDg_1547061291) by smtp.aliyun-inc.com(127.0.0.1); Thu, 10 Jan 2019 03:14:59 +0800 From: Yang Shi To: mhocko@suse.com, hannes@cmpxchg.org, shakeelb@google.com, akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 3/5] mm: memcontrol: introduce wipe_on_offline interface Date: Thu, 10 Jan 2019 03:14:43 +0800 Message-Id: <1547061285-100329-4-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1547061285-100329-1-git-send-email-yang.shi@linux.alibaba.com> References: <1547061285-100329-1-git-send-email-yang.shi@linux.alibaba.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP We have some usecases which create and remove memcgs very frequently, and the tasks in the memcg may just access the files which are unlikely accessed by anyone else. So, we prefer force_empty the memcg before rmdir'ing it to reclaim the page cache so that they don't get accumulated to incur unnecessary memory pressure. Since the memory pressure may incur direct reclaim to harm some latency sensitive applications. Force empty would help out such usecase, however force empty reclaims memory synchronously when writing to memory.force_empty. It may take some time to return and the afterwards operations are blocked by it. Although this can be done in background, some usecases may need create new memcg with the same name right after the old one is deleted. So, the creation might get blocked by the before reclaim/remove operation. Delaying memory reclaim in cgroup offline for such usecase sounds reasonable. Introduced a new interface, called wipe_on_offline for both default and legacy hierarchy, which does memory reclaim in css offline kworker. Writing to 1 would enable it, writing 0 would disable it. Suggested-by: Michal Hocko Cc: Johannes Weiner Cc: Shakeel Butt Signed-off-by: Yang Shi --- include/linux/memcontrol.h | 3 +++ mm/memcontrol.c | 53 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 83ae11c..2f1258a 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -311,6 +311,9 @@ struct mem_cgroup { struct list_head event_list; spinlock_t event_list_lock; + /* Reclaim as much as possible memory in offline kworker */ + bool wipe_on_offline; + struct mem_cgroup_per_node *nodeinfo[0]; /* WARNING: nodeinfo must be the last member here */ }; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index eaa3970..ff50810 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2918,6 +2918,35 @@ static ssize_t mem_cgroup_force_empty_write(struct kernfs_open_file *of, return mem_cgroup_force_empty(memcg, true) ?: nbytes; } +static int wipe_on_offline_show(struct seq_file *m, void *v) +{ + struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); + + seq_printf(m, "%lu\n", (unsigned long)memcg->wipe_on_offline); + + return 0; +} + +static int wipe_on_offline_write(struct cgroup_subsys_state *css, + struct cftype *cft, u64 val) +{ + int ret = 0; + + struct mem_cgroup *memcg = mem_cgroup_from_css(css); + + if (mem_cgroup_is_root(memcg)) + return -EINVAL; + + if (val == 0) + memcg->wipe_on_offline = false; + else if (val == 1) + memcg->wipe_on_offline = true; + else + ret = -EINVAL; + + return ret; +} + static u64 mem_cgroup_hierarchy_read(struct cgroup_subsys_state *css, struct cftype *cft) { @@ -4283,6 +4312,11 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of, .write = mem_cgroup_reset, .read_u64 = mem_cgroup_read_u64, }, + { + .name = "wipe_on_offline", + .seq_show = wipe_on_offline_show, + .write_u64 = wipe_on_offline_write, + }, { }, /* terminate */ }; @@ -4569,11 +4603,20 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css) page_counter_set_min(&memcg->memory, 0); page_counter_set_low(&memcg->memory, 0); + /* + * Reclaim as much as possible memory when offlining. + * + * Do it after min/low is reset otherwise some memory might + * be protected by min/low. + */ + if (memcg->wipe_on_offline) + mem_cgroup_force_empty(memcg, false); + else + drain_all_stock(memcg); + memcg_offline_kmem(memcg); wb_memcg_offline(memcg); - drain_all_stock(memcg); - mem_cgroup_id_put(memcg); } @@ -5694,6 +5737,12 @@ static ssize_t memory_oom_group_write(struct kernfs_open_file *of, .seq_show = memory_oom_group_show, .write = memory_oom_group_write, }, + { + .name = "wipe_on_offline", + .flags = CFTYPE_NOT_ON_ROOT, + .seq_show = wipe_on_offline_show, + .write_u64 = wipe_on_offline_write, + }, { } /* terminate */ }; From patchwork Wed Jan 9 19:14:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10754847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07DD714E5 for ; Wed, 9 Jan 2019 19:20:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E874929058 for ; Wed, 9 Jan 2019 19:20:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9B7D2900C; Wed, 9 Jan 2019 19:20:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDF012900C for ; Wed, 9 Jan 2019 19:20:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E42438E009F; Wed, 9 Jan 2019 14:20:04 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E16F68E0038; Wed, 9 Jan 2019 14:20:04 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2F2A8E009F; Wed, 9 Jan 2019 14:20:04 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by kanga.kvack.org (Postfix) with ESMTP id 92E028E0038 for ; Wed, 9 Jan 2019 14:20:04 -0500 (EST) Received: by mail-pl1-f197.google.com with SMTP id 4so4722287plc.5 for ; Wed, 09 Jan 2019 11:20:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=6Y4P+RH7kDCKB72PEaSDSCp4FAo31tuO+VrSZguuKT0=; b=HuWKuFvvMOu4d3+Qi5cUe7qpY6ciwM0nHKtehcwFDJkund1y+FuGCSFDIVNLwar6+u yQnPH2O5WHfDJm1M2yJQS4iriYcHIZKZqPChWaxhhJhoXpKbHnjjsshF07R//aJ7RWuL htzUMUzg8ya+AynmQoQ0NRg47PTI7A/ENcSMfKILVNIFnoo3q82xA64f8oZJHDBtNA1A NDJlRnw+eKPHbmpaaWp6ekQltfUOcCq1OT3ePUsB2FgTVLQRmT0bd/jnKRcASflpiZNc lvWBEoy8PuQMxjaOWj8/pRmYszl75F5tDJevlzz5/nE3jFZzLbqjQdmYtwfA0yfSa6aE AMNQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Gm-Message-State: AJcUukfJFnd4pjNcH0+EwNAeNIJEAtSX1+lJ1ND/T8IFtA2TPNWDrXT+ lVTDhHfAmRJ69tAlfZg2ya96TWfklG1Z/ViAQNBaW3tlJGkSB1YWkk0kHYLQ5BMrO7LkoVByJfP SXb1TDCpxmYh14xI1SRt0Yl2xVlbwXWccr8FVMTiqFTTHbc5J0/u3Sh/SUTYZZvkXsg== X-Received: by 2002:a63:1d59:: with SMTP id d25mr6681366pgm.180.1547061604264; Wed, 09 Jan 2019 11:20:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN7ekJsAKldr1LEHiKI8YrfmohuZ3uz5y/gltUTFYG11L7YZU+QKl7k/gui1ZTbaKFuXPTXl X-Received: by 2002:a63:1d59:: with SMTP id d25mr6681303pgm.180.1547061602947; Wed, 09 Jan 2019 11:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547061602; cv=none; d=google.com; s=arc-20160816; b=ntnX0xf5Wgev7pGUHjwk5/SsohBRsMzHL5fmN5yjTAkz2WxtRxbu1dETeXFcFgsPVw yeNPHEf4KrZN7in4S78ZcME8/hDR0j+j7oeTlnK8lmpYb28/erADweq10lQDC7WNsmtn qp2DaRnMWjuu3N3GYMRSLbbxI0jIVkpFTTdXE7TwWOY0g4M225Z1ouCZsHuJ73R7vTqC GZX2PHFUfTDsUb/a0yPX5o6T8AGnXGMX+v/F6l0HWhlrBren6LkI05Qyt5gvUCD+PB3i GomMLbwROuAkh+tImSV2I5t5B4V7ZiFcUxYwYHJ5U6oBtLORwqcJvkgoLXM4ZSIXP6xU FGSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=6Y4P+RH7kDCKB72PEaSDSCp4FAo31tuO+VrSZguuKT0=; b=gEOqlKnQHJwUiAHnElj8xiGKB20S14ic1RXce4PYQe9M+ihz4YX3oGVb8uGGrdpMfF o2f8fbjE0V4WyiPJ5sSibO7q/BOUzscocwDdN40ArNwY185zG9Cmd8QvyW0IJXOXd8xx 8ylG8k/rONGektvE4mo2A3kr8oOqTz5a7+ZAoI0uRp7W1tOu8qi0LKDEPWM/Ti/VfaRl u6L8SCLOc8yjT/xmFuFU+KEdh37USYN4P1q7EsNVMy5WnRnpO3w/zUkdF4ELLfVYIl62 W68/i0UXRqmzkycOVnzHe1I8vBlc8/t+fx8EA1MEMRCc0RB4s+bd1B74yyGAf+NwhOwO Xj0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com. [115.124.30.132]) by mx.google.com with ESMTPS id x5si7000951pga.440.2019.01.09.11.20.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 11:20:02 -0800 (PST) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.132 as permitted sender) client-ip=115.124.30.132; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0THtvvDg_1547061291; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0THtvvDg_1547061291) by smtp.aliyun-inc.com(127.0.0.1); Thu, 10 Jan 2019 03:14:59 +0800 From: Yang Shi To: mhocko@suse.com, hannes@cmpxchg.org, shakeelb@google.com, akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 4/5] mm: memcontrol: bring force_empty into default hierarchy Date: Thu, 10 Jan 2019 03:14:44 +0800 Message-Id: <1547061285-100329-5-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1547061285-100329-1-git-send-email-yang.shi@linux.alibaba.com> References: <1547061285-100329-1-git-send-email-yang.shi@linux.alibaba.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The default hierarchy doesn't support force_empty, but there are some usecases which create and remove memcgs very frequently, and the tasks in the memcg may just access the files which are unlikely accessed by anyone else. So, we prefer force_empty the memcg before rmdir'ing it to reclaim the page cache so that they don't get accumulated to incur unnecessary memory pressure. Since the memory pressure may incur direct reclaim to harm some latency sensitive applications. There is another patch which introduces asynchronous memory reclaim when offlining, but the behavior of force_empty is still needed by some usecases which want to get the memory reclaimed immediately. So, bring force_empty interface in default hierarchy too. Cc: Michal Hocko Cc: Johannes Weiner Cc: Shakeel Butt Signed-off-by: Yang Shi --- Documentation/admin-guide/cgroup-v2.rst | 14 ++++++++++++++ mm/memcontrol.c | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index 7bf3f12..0290c65 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1289,6 +1289,20 @@ PAGE_SIZE multiple when read back. Shows pressure stall information for memory. See Documentation/accounting/psi.txt for details. + memory.force_empty + This interface is provided to make cgroup's memory usage empty. + When writing anything to this + + # echo 0 > memory.force_empty + + the cgroup will be reclaimed and as many pages reclaimed as possible. + + The typical use case for this interface is before calling rmdir(). + Though rmdir() offlines memcg, but the memcg may still stay there due to + charged file caches. Some out-of-use page caches may keep charged until + memory pressure happens. If you want to avoid that, force_empty will be + useful. + Usage Guidelines ~~~~~~~~~~~~~~~~ diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ff50810..5d42a19 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5743,6 +5743,10 @@ static ssize_t memory_oom_group_write(struct kernfs_open_file *of, .seq_show = wipe_on_offline_show, .write_u64 = wipe_on_offline_write, }, + { + .name = "force_empty", + .write = mem_cgroup_force_empty_write, + }, { } /* terminate */ }; From patchwork Wed Jan 9 19:14:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10754861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFD0B14E5 for ; Wed, 9 Jan 2019 19:27:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFF1129430 for ; Wed, 9 Jan 2019 19:27:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A349429456; Wed, 9 Jan 2019 19:27:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E670229430 for ; Wed, 9 Jan 2019 19:27:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B7EC8E00A1; Wed, 9 Jan 2019 14:27:41 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 16A128E0038; Wed, 9 Jan 2019 14:27:41 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 009798E00A1; Wed, 9 Jan 2019 14:27:40 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by kanga.kvack.org (Postfix) with ESMTP id B165C8E0038 for ; Wed, 9 Jan 2019 14:27:40 -0500 (EST) Received: by mail-pg1-f197.google.com with SMTP id f9so4723798pgs.13 for ; Wed, 09 Jan 2019 11:27:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=YvHbbFTQGKzu1yoPcOk6gELXGq0DpSPHtmrDxZOcDa4=; b=LsNVq0Ba5RnIHV0Ea8ZQr9erA2pbCh9LULKGtZ0GPTh1eajKV4lHdk7E0SYPiB6BMl ekOqcB7DZrusDlLYC8UmlQLtTSm9vRck7AKBx61mIK08P2UTWT0150vgDvAma7N4zJLS R2h3T/xNC1kWjrzWRibIx9l7WnBtqQ9UMQE5icmD3pFs15opqIbhvLHs3ivvO8ssJemU wpd5abkZT1+AennENbA4calau4jg+nCrjuwhMhoFBzAEqoj6ninpKV236fr2WVpHNdgP ifJjfTZ2wi6r2VzVW5FwhUbH6Ui5jrm8R80HxCliydcRnk4kW+hQR33YdhH5C4UkylmG VsbQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Gm-Message-State: AJcUukdH4M2JAfw0RNnMAeZEnm/M8V76d0nO1c+cvZR/xSclDzCWnoc1 I25vixIM0Bu7T51KwyxQhB06oa2erB8Tnoabt+TicLCO8iqZOdfDM3FpeVQgGPKJogG0A02sNH0 Q3F3AieDPuUiMnqsCapx95ycm9RuHbkKQ6yL6O8ZyKi63ad9xJ0t3eWNWrnNW9L3npw== X-Received: by 2002:a63:f844:: with SMTP id v4mr6554405pgj.82.1547062060359; Wed, 09 Jan 2019 11:27:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4+URTajkmDU2T74IU6TAb7wm8vDXipKCyr0jJMM0fxN6opty+8UKXPo3fNE5ixc47zwKNM X-Received: by 2002:a63:f844:: with SMTP id v4mr6554350pgj.82.1547062059156; Wed, 09 Jan 2019 11:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547062059; cv=none; d=google.com; s=arc-20160816; b=JhQKx6eM44jJK1OIi6zj/HUppfttn1HYe1fOrVSIKBqz/tTYfZOw0npZ1u2NkpBdm6 HmeD2LLbaLAS+PlB86y75byydUE0/HTNlOHFDXvq7sy2HdrqizVvqbnMG5sEOH26Q1XR al+dkzx91ngAUkUO9ZFn+uLMA4qgXGbTGizkgHW6fo65RLEid/ENGu3kzQndWn2cWIqV CqmrStEA3zNWhIW2KmlLPcxNzEHe4LFG64LfXfGqsAOOCDNwXjBBpUDBt07/U50V45Ci TQerzAjIECxm+LWb2TDeaXPESlPkF9Su0nQYG9CIF111xPXY7RBIXaVv887Zk+7up9Rs 29EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=YvHbbFTQGKzu1yoPcOk6gELXGq0DpSPHtmrDxZOcDa4=; b=OIhLVUFWnoOkRVbangY6fm5/UWvtfme/PmhT3YNIO7EPMBun+bMfd/B4mz1Blq4Fl8 k7boqf0PKp1oOkFJUl10C25OZUFVYlLji/J/JqlHqb6o3wHL4ka27b7HkTglwq8zy22g OmNAPgAuSaq7NHR/OOC0GP3ZTtVwI9YJLDZ6rKgUac+8Q0EuGjlvnuQcwdLqJyd2pDUf LefN2q4MMuyr17RA3Is++fDtA74E0DSXI6LtgMX6t7Jae1sbBrUD9DSzsKMLIpLhExCx NpoBYZI4a+0UUgYiwQWf9upNwnUCeG2mU/Ntd2H5iTAtYzQ6Xl0nSEmrMDTqoz68V2Cm 1TRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com. [115.124.30.131]) by mx.google.com with ESMTPS id f24si10448757pgj.315.2019.01.09.11.27.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 11:27:38 -0800 (PST) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.131 as permitted sender) client-ip=115.124.30.131; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R231e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07486;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0THtvvDg_1547061291; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0THtvvDg_1547061291) by smtp.aliyun-inc.com(127.0.0.1); Thu, 10 Jan 2019 03:14:59 +0800 From: Yang Shi To: mhocko@suse.com, hannes@cmpxchg.org, shakeelb@google.com, akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 5/5] doc: memcontrol: add description for wipe_on_offline Date: Thu, 10 Jan 2019 03:14:45 +0800 Message-Id: <1547061285-100329-6-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1547061285-100329-1-git-send-email-yang.shi@linux.alibaba.com> References: <1547061285-100329-1-git-send-email-yang.shi@linux.alibaba.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Add desprition of wipe_on_offline interface in cgroup documents. Cc: Michal Hocko Cc: Johannes Weiner Cc: Shakeel Butt Signed-off-by: Yang Shi --- Documentation/admin-guide/cgroup-v2.rst | 9 +++++++++ Documentation/cgroup-v1/memory.txt | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index 0290c65..e4ef08c 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1303,6 +1303,15 @@ PAGE_SIZE multiple when read back. memory pressure happens. If you want to avoid that, force_empty will be useful. + memory.wipe_on_offline + + This is similar to force_empty, but it just does memory reclaim + asynchronously in css offline kworker. + + Writing into 1 will enable it, disable it by writing into 0. + + It would reclaim as much as possible memory just as what force_empty does. + Usage Guidelines ~~~~~~~~~~~~~~~~ diff --git a/Documentation/cgroup-v1/memory.txt b/Documentation/cgroup-v1/memory.txt index 8e2cb1d..1c6e1ca 100644 --- a/Documentation/cgroup-v1/memory.txt +++ b/Documentation/cgroup-v1/memory.txt @@ -71,6 +71,7 @@ Brief summary of control files. memory.stat # show various statistics memory.use_hierarchy # set/show hierarchical account enabled memory.force_empty # trigger forced page reclaim + memory.wipe_on_offline # trigger forced page reclaim when offlining memory.pressure_level # set memory pressure notifications memory.swappiness # set/show swappiness parameter of vmscan (See sysctl's vm.swappiness) @@ -581,6 +582,15 @@ hierarchical_= N0= N1= ... The "total" count is sum of file + anon + unevictable. +5.7 wipe_on_offline + +This is similar to force_empty, but it just does memory reclaim asynchronously +in css offline kworker. + +Writing into 1 will enable it, disable it by writing into 0. + +It would reclaim as much as possible memory just as what force_empty does. + 6. Hierarchy support The memory controller supports a deep hierarchy and hierarchical accounting.