Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1565212pxb; Thu, 4 Feb 2021 17:01:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3n3bhB7OKr0VAsg+FhChU1dzN4LGs/R3Ti21b9/WFpxktCb42Vb2MjfIjXiMlV4HSNFt0 X-Received: by 2002:a05:6402:13cd:: with SMTP id a13mr1196703edx.87.1612486915469; Thu, 04 Feb 2021 17:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612486915; cv=none; d=google.com; s=arc-20160816; b=HGHFCrfBoCTX4NIXP8TrBnIJeHqL6wKUH6b3REdLYXKCfPCiWTUJuBDpmYkdsfFJtJ X57QBNnyR25hpcxMh3plOaWPFZm6bzO5tLODRq8biXHbNE7vTg5+0yN5/+CKwmrrYz7o mWEx0l8Bt+g0GQEuErWBSD+pXPONMtyKsrW2ck0HxIsckYikJsBpaqlKoo+2thlFpqYB b+PeRAQS3almxhr9te5GwlYRrLK4acsZrIYgwD0wBkO0ZpboEwmvxnfPLpTbf2bpwznx cGNNId5wmtQ+jrI6cJHjvbwapi/ruAvFrB3ORJ8M3d1lmZCyTolYcZjOb17ikvGmjy2z CR/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wsgw8MnfsGuS5yxbjBVn1LDBc6ZqPnfi34fb3SCAx6k=; b=C1DhP/j8R9aZmFhMM2DV9vvOInvEcqn2nHq6j0iroZmzuKCl6tSkntmz1rWWsurWEr ur5EWRFsVDtjUbBxeqkazNYiB0w7TPnkYqt0jH9dvPLFkR7YtM2BEptbPH/93gwDRoi7 +yUzQHsT2idZvUHicXSLqbc6WS5bT+Ot4q5XakKRF5NyNIqqDRp2VYZ4FFiO/bm40i7c QVcayda2Gn+Dk8JVvhyDxhnOt2zYOCj54b8bMzNz3z48UXi4YForRUaTOruWsleXcs9f r4N2HKmmrzraURoGChtRKaQLiGgfku9dzdeiESvIei48IaF/D4xl9uLnZzBHXBv9Yyym SiZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NgWdQMly; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si4081117ede.90.2021.02.04.17.01.30; Thu, 04 Feb 2021 17:01:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NgWdQMly; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237799AbhBDQpN (ORCPT + 99 others); Thu, 4 Feb 2021 11:45:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:40810 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238019AbhBDQnL (ORCPT ); Thu, 4 Feb 2021 11:43:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1612456944; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wsgw8MnfsGuS5yxbjBVn1LDBc6ZqPnfi34fb3SCAx6k=; b=NgWdQMlyE3luXm8XWKjVOe9zxEg7WQv8SecLlF4cS78MHz5/hEi4X7DpQCw0sW1QSTz4hN nktjmzFeN8/ZAV74ArRlOObu1QFbDkAvWW+gvQ0q7FaQ1W8UipbvtGwvyayYl/wCbxfbkn Sjl3ubKHaA2GT9ueS1b9xCOOoCMP6GU= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E8941ABD5; Thu, 4 Feb 2021 16:42:23 +0000 (UTC) Date: Thu, 4 Feb 2021 17:42:23 +0100 From: Michal Hocko To: Johannes Weiner Cc: Andrew Morton , Tejun Heo , Roman Gushchin , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 4/7] cgroup: rstat: support cgroup1 Message-ID: References: <20210202184746.119084-1-hannes@cmpxchg.org> <20210202184746.119084-5-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 04-02-21 11:01:30, Johannes Weiner wrote: > On Thu, Feb 04, 2021 at 02:39:25PM +0100, Michal Hocko wrote: > > On Tue 02-02-21 13:47:43, Johannes Weiner wrote: > > > Rstat currently only supports the default hierarchy in cgroup2. In > > > order to replace memcg's private stats infrastructure - used in both > > > cgroup1 and cgroup2 - with rstat, the latter needs to support cgroup1. > > > > > > The initialization and destruction callbacks for regular cgroups are > > > already in place. Remove the cgroup_on_dfl() guards to handle cgroup1. > > > > > > The initialization of the root cgroup is currently hardcoded to only > > > handle cgrp_dfl_root.cgrp. Move those callbacks to cgroup_setup_root() > > > and cgroup_destroy_root() to handle the default root as well as the > > > various cgroup1 roots we may set up during mounting. > > > > > > The linking of css to cgroups happens in code shared between cgroup1 > > > and cgroup2 as well. Simply remove the cgroup_on_dfl() guard. > > > > > > Linkage of the root css to the root cgroup is a bit trickier: per > > > default, the root css of a subsystem controller belongs to the default > > > hierarchy (i.e. the cgroup2 root). When a controller is mounted in its > > > cgroup1 version, the root css is stolen and moved to the cgroup1 root; > > > on unmount, the css moves back to the default hierarchy. Annotate > > > rebind_subsystems() to move the root css linkage along between roots. > > > > I am not familiar with rstat API and from this patch it is not really > > clear to me how does it deal with memcg v1 use_hierarchy oddness. > > That's gone, right? > > static int mem_cgroup_hierarchy_write(struct cgroup_subsys_state *css, > struct cftype *cft, u64 val) > { > if (val == 1) > return 0; > > pr_warn_once("Non-hierarchical mode is deprecated. " > "Please report your usecase to linux-mm@kvack.org if you " > "depend on this functionality.\n"); > > return -EINVAL; > } Ohh, right! I have completely forgot it hit the Linus tree. -- Michal Hocko SUSE Labs