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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 024E3C2D0DC for ; Wed, 25 Dec 2019 14:05:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9F9882077B for ; Wed, 25 Dec 2019 14:05:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="dj9kUX7c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F9882077B 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 0D6AE8E0005; Wed, 25 Dec 2019 09:05:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 088348E0001; Wed, 25 Dec 2019 09:05:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDFE18E0005; Wed, 25 Dec 2019 09:05:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id D62D88E0001 for ; Wed, 25 Dec 2019 09:05:50 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 7E13E4427 for ; Wed, 25 Dec 2019 14:05:50 +0000 (UTC) X-FDA: 76303837260.26.foot09_6d1f45c6e7651 X-HE-Tag: foot09_6d1f45c6e7651 X-Filterd-Recvd-Size: 4209 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Dec 2019 14:05:49 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id j42so21807056wrj.12 for ; Wed, 25 Dec 2019 06:05:49 -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:in-reply-to; bh=PaDmMxkiRy/WmC12erbAUHsnmEtdYs1r3ps1zkcgWAw=; b=dj9kUX7cO9CfQ0vYnu5g3KXmO6JhCagGhOV4IqNaW87UuclAEzzGxEeHbcInmbtxqV OTO0VWnbb+87Kf8YZB5UqxkkEHoCB1F/RLgqzLcQJiMEBmz9yznlTFDsFGo9tW626Hnj O3+BJexc5zq7YN4nzlzC/8FHKHufQKUeyGKzU= 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:in-reply-to; bh=PaDmMxkiRy/WmC12erbAUHsnmEtdYs1r3ps1zkcgWAw=; b=J+DIB/07fJBrAYscsEdZ20eBjw+DYD/S9LtxLxXDf9pBRUpohrzMM/Yjygqax8ubuu /Qk8cQpWRfIl16w1Ycja4MwZa76Q7N84/Y77ZPp9Rljt6H+VpEvfcZAlSWohgx1EgWXk 2IW0ueHkKXcDLOFiqTp+Tb/igxfEdctQ8IYk8b4wTChFIV/4OlWO0G21ncUsQ0vGzyv/ RDFWB0LmkeTkS7QZwi1w2Qr1kuP0kJSN0AysNPxVXq5/LW796vAtymLLY5Y1lvaOaHxp o2DfrQhuTxHVLFc1TL8H5t2bD+oSE/UVRptVyDbmwBtjOHRc27YUHcMWGHlsZ4kot9VB AOhg== X-Gm-Message-State: APjAAAVUORCcY71Nd11B5ihLbslcw81ZM/7KwDQySlGMOjkU8zlnOW/E fUzDjjDFH1NzqQatDIPa+Oi41w== X-Google-Smtp-Source: APXvYqz5NZ/Z9pXVDdxcMgmQvd60J/zQ3ZAGiDufUZ/QmKwuXQsKbS8TnZLdl3bs9e8BAZqJmF/8dg== X-Received: by 2002:a5d:538e:: with SMTP id d14mr41544340wrv.358.1577282748332; Wed, 25 Dec 2019 06:05:48 -0800 (PST) Received: from localhost (host-92-23-123-10.as13285.net. [92.23.123.10]) by smtp.gmail.com with ESMTPSA id u22sm28958411wru.30.2019.12.25.06.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Dec 2019 06:05:47 -0800 (PST) Date: Wed, 25 Dec 2019 14:05:46 +0000 From: Chris Down To: Hui Zhu Cc: 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, Hui Zhu Subject: Re: [RFC] memcg: Add swappiness to cgroup2 Message-ID: <20191225140546.GA311630@chrisdown.name> References: <1577252208-32419-1-git-send-email-teawater@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1577252208-32419-1-git-send-email-teawater@gmail.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: Hi Hui, Hui Zhu writes: >Even if cgroup2 has swap.max, swappiness is still a very useful config. >This commit add swappiness to cgroup2. When submitting patches like this, it's important to explain *why* you want it and what evidence there is. For example, how should one use this to compose a reasonable system? Why aren't existing protection controls sufficient for your use case? Where's the data? Also, why would swappiness be something cgroup-specific instead of hardware-specific, when desired swappiness is really largely about the hardware you have in your system? I struggle to think of situations where per-cgroup swappiness would be useful, since it's really not a workload-specific setting. Thanks, Chris >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 > >