Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8401847ybl; Tue, 24 Dec 2019 21:40:46 -0800 (PST) X-Google-Smtp-Source: APXvYqz7ddNcCbybYHNIFSx5mEK+5WANYLbmXI3Asdd0ukRyykioX2V9pwsc+YMTDwdzuy8uR+uf X-Received: by 2002:a05:6830:1e21:: with SMTP id t1mr23291205otr.194.1577252446206; Tue, 24 Dec 2019 21:40:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577252446; cv=none; d=google.com; s=arc-20160816; b=brYOAfhcF46a5+T6z5gzRbWYpSW8kLFT4E+fkHeuHpkZ+2AkTIM4JsU2YRLBmhxdx3 9mgvR3g+8SG/LFJwF2fukkqBIN85+LsFTR3BFAXhiYHDWFdgDoxpsWeTu1UXiA0syLb1 M4tsg78BYypuZ8ftP6iiFTo3gNmMw+G4k9+guCBLCVuSSONnjN77bLA2zaKkpABQ07r0 QasV00AeJcxVNFqmnjGD/7COfL9OJP0kGcQ7jKifRH8MP3ydhB40m57wgb4/SBLb3D/a y2RD0/3BXVQGzWh3fxucgMY/AM8iUE2xeuZIjsSd21N7Vk6vrlNAw9NsiW1tulwICF20 FXlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=+STPmP6QsY4aipfV48qjW+iz0qFn1ouQiGz0t1OBy2Q=; b=x7HtvkLF5WQE1OkBypS7LuFMBdlV9R8b2YBzV4vzmK4Nb+XUM27yqjmRLVdHRDFD1B 56qsWvHEKGo35WuqH5PQITadDMCZzkHZytqMJpGgoPCoL7vvc98RL+0NKrmO3+oCpamJ wHYZxQuWn0iagnWJbViwQmSxDIWofVnNCdJzL2ovaSStyGvKhsT/Fx3vAgxmEP2kgUP/ 8rkwYItu/U/vexYN/VVAYRlxPWdJbaW80ifzO4obFk7yAM8gV08VtXwytpg1zN0ARgQC OEdQi9k27nXDXbSdcShOeC6otlskRV59AAKgP/S8BbZFe0KpYn8teTkfBEv/Sd9bT69D cimQ== 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si16112838otg.248.2019.12.24.21.40.21; Tue, 24 Dec 2019 21:40:46 -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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725935AbfLYFhA (ORCPT + 99 others); Wed, 25 Dec 2019 00:37:00 -0500 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:60365 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725798AbfLYFhA (ORCPT ); Wed, 25 Dec 2019 00:37:00 -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=e01e04426;MF=teawaterz@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0TlsqoyK_1577252212; Received: from localhost(mailfrom:teawaterz@linux.alibaba.com fp:SMTPD_---0TlsqoyK_1577252212) by smtp.aliyun-inc.com(127.0.0.1); Wed, 25 Dec 2019 13:36:57 +0800 From: Hui Zhu To: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Hui Zhu , Hui Zhu Subject: [RFC] memcg: Add swappiness to cgroup2 Date: Wed, 25 Dec 2019 13:36:48 +0800 Message-Id: <1577252208-32419-1-git-send-email-teawater@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Even if cgroup2 has swap.max, swappiness is still a very useful config. This commit add swappiness to cgroup2. Signed-off-by: Hui Zhu --- mm/memcontrol.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c5b5f74..e966396 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7143,6 +7143,11 @@ static struct cftype swap_files[] = { .file_offset = offsetof(struct mem_cgroup, swap_events_file), .seq_show = swap_events_show, }, + { + .name = "swappiness", + .read_u64 = mem_cgroup_swappiness_read, + .write_u64 = mem_cgroup_swappiness_write, + }, { } /* terminate */ }; -- 2.7.4