Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8775703ybl; Wed, 25 Dec 2019 06:06:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxDvImySTHSHRBP0ZmGTnEfJXVXIOT0QDG1tnUqEOWatbFKhIA6SwbfKLrE+7Bww4N+4+bA X-Received: by 2002:a05:6830:596:: with SMTP id c22mr41052644oth.188.1577282803815; Wed, 25 Dec 2019 06:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577282803; cv=none; d=google.com; s=arc-20160816; b=chKnKKxK9jDRdwmOnobQbnIqDlrllHQKeTAyVffpeRMxgVZE64C+HflhrHWyuBqGcm IvKIKQb+QnTHAgS13MVllY4iHw1oXCtnFha7MrJgw02UpgqYrBSlkY7QbrBNpZkb4DuX 8dk/wz4tRKZ5es/2AnEwKOOiHpl2sFynNb2CDaZzUDXNNxwn5OsF6sK853jUn6fjoB1X W9o4yMmkgre2jKRxQ3gS1z6xX/rjg0LMM8Ok4uZLQIia76MVnCjpr41OGUOJk3NlRAW+ Gx1XvlF5aDR5EvA3wDX12B5esjr/F9crVuYf8luQDhWyeUGjEetbF2FFSB0edpiFbDi9 ZSlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PaDmMxkiRy/WmC12erbAUHsnmEtdYs1r3ps1zkcgWAw=; b=ckLVvbx50bIvY5JqapkV5Zr0SzqMcivdgETJ0bPOk1Pco3+kgXF0gUk6H81eWPkrEp cWzthhTXuFzZCFoHQStpa8lRXQ86m9qPIPadJh06OFtrZklS5KqTAnABsFaRITPQI5AZ 50NRpov8c3h6gToGVX2bFObKyatL/YHP1FYZNesOjgNSHapNUWckRHip+ebGUaplXDHu HVUYlEvZn6rJdqqzyAp2xraVEpg/ROUxzpjPOBlffpm1+GdmziWOifM7Smro1IVzc0rO 5NTNwZ7g/D93F8SFFBdjJAqKbF7kZc8GI7dhJSRsLoOIJr4RMaGprJD8aGBl7KmJpU2Y uYzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=dj9kUX7c; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a19si7823799oic.77.2019.12.25.06.06.31; Wed, 25 Dec 2019 06:06:43 -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; dkim=pass header.i=@chrisdown.name header.s=google header.b=dj9kUX7c; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726420AbfLYOFu (ORCPT + 99 others); Wed, 25 Dec 2019 09:05:50 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42717 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726397AbfLYOFu (ORCPT ); Wed, 25 Dec 2019 09:05:50 -0500 Received: by mail-wr1-f66.google.com with SMTP id q6so21798632wro.9 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=CR3f1BetYqWVedBwFPS2sgFfQl1GZDN3ghpBp5kXeQH5T04XM6/21ALCWbkEtCakpo M//BJWRgKBUadBl5U5ECsVckLExGQmHv1t/stBJGD1O4LR3066hdr9G6wXdjV958/UtT IzHFcRTl4uSIke234/O9cYRpqZKtzz5die5nrmifUt0rEYRC1INqp61iLW+V8ecuJaoi 8kZmwKcQKmpf2+DFjexeWPhid2LOweR4Cnpjw447LK2XFa4+3sbpAM5H0kYlW+Hbhd/6 V/G+iS1pyxRTFsMiB8zQUq3beDyX5Y8eWxTP95tgkIZ9Y0BufrIRpdpBRWpj5Y0t1LC0 MK2w== X-Gm-Message-State: APjAAAUpTOVpouI9l13nKzzBn38HD/Ukc221jbQmK99RNJ+j6ORwnD// nUqGO47YBj2Os6bCzLbsQYcJcg== 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > >