Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1221087rwr; Fri, 5 May 2023 10:44:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6s+79PWAyi3mxuDs5U5srMAMCrWEIuO2HHCc1z7duhWUCc/mZJ+tWnuoUw/uIcAAEU28pa X-Received: by 2002:a05:6a21:980d:b0:f6:28de:89e1 with SMTP id ue13-20020a056a21980d00b000f628de89e1mr2187335pzb.33.1683308666375; Fri, 05 May 2023 10:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683308666; cv=none; d=google.com; s=arc-20160816; b=SEFyiuCNUz1gVLe4UdhfOoudZj+5q1t7fxJlbDbKfMMKjz694NELeB659Do5awITn+ VnDO8Hv+tphQlzBma8cQbrEW1z4c6qiqjwL+1EI1UxPyTLOyeNC59KhI1UttKjgPzjc9 9TsTb+MORC7h6KFEYWFWRdDINYB/mTFeCGKvws6BlpxKCAjl4fJhtPh8wqRNcGx6Y+Z8 de6XX+bTsdDRYjF36OTxxJaeuWGcdimR31NgP5FMQM0M81eHhmGOB6MwAzDe0F82ERjU FyKFd/EX0lh3igGy8eVAPl/UndNhjAKqesAYcG+dhXKX9ze+lVS0riccfHOzmRZMeGcM nQmA== 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=08FuX13wN9U4YYw2axhJqWpBUnoUcHOE2BMKcuHHIII=; b=HhYkLXfBtfAyhrR8olW81yMfzgSfUG8/xTVljOw1ALl6i/BStXYWp8Thd2jbdqijq0 nTWdxbk8h0hyxSifRBEBv6QxIaA95tiCahBmCWKuPNrd47SO/0jgusZ9oHotFKlOEYLQ VOafe54B1UiUIJYR+2OqRMWi+21mdw/4ZmgkIcbc+fDWJqhdMRR0W9KZseCtchLSU97Z USv4kkcWZPqsJsIrDS0wezHTu9O/WLOSqV/e/k1UjBnzjVQ+oe583aFJJNLDlTAyj+5z C98bYVDjt/xj9vScdvie8zcGz4HKwnKbmsmlPMWqJTY1Qz4xcEuHGiu/cBiCnxiWeWmx i0fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=dSvKo4gr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a63e70f000000b0052c5d8db0ddsi2744236pgi.790.2023.05.05.10.44.11; Fri, 05 May 2023 10:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=dSvKo4gr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231920AbjEERdH (ORCPT + 99 others); Fri, 5 May 2023 13:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbjEERdF (ORCPT ); Fri, 5 May 2023 13:33:05 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 603171A4B5; Fri, 5 May 2023 10:32:43 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F271F1FE20; Fri, 5 May 2023 17:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1683307962; 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=08FuX13wN9U4YYw2axhJqWpBUnoUcHOE2BMKcuHHIII=; b=dSvKo4grqGLt7OmzVg7CvER57EhkmRq43a6GttLWDA5VsTzGOjkr03cZx88FUETDQfnQKQ +6cC/JbCvornmP+fW+kmIflQXd0nBQ67ryVRD/tVNdVe9L3/bISJGQv+7ggjZLE7hzD8fN UuFbRmICbHw5Y0K1bER7vze628L+ysM= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BCB1413513; Fri, 5 May 2023 17:32:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tiArLbk9VWSnRAAAMHmgww (envelope-from ); Fri, 05 May 2023 17:32:41 +0000 Date: Fri, 5 May 2023 19:32:40 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Tejun Heo Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Alexander Viro , Christian Brauner , Zefan Li , Johannes Weiner , Dave Chinner , Rik van Riel , Jiri Wiesner Subject: Re: [RFC PATCH 3/3] cgroup: Do not take css_set_lock in cgroup_show_path Message-ID: References: <20230502133847.14570-1-mkoutny@suse.com> <20230502133847.14570-4-mkoutny@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rylaem3izw3vqdtr" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --rylaem3izw3vqdtr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 05, 2023 at 05:45:58AM -1000, Tejun Heo wrote: > > There are three relevant nodes for each cgroupfs entry: > >=20 > > R ... cgroup hierarchy root > > M ... mount root > > C ... reader's cgroup NS root > >=20 > > mountinfo is supposed to show path from C to M. >=20 > At least for cgroup2, the path from C to M isn't gonna change once NS is > established, right? Right. Although, the argument about M (when C above M or when C and M in different subtrees) implicitly relies on the namespace_sem. > Nothing can be moved or renamed while the NS root is there. If so, > can't we just cache the formatted path and return the same thing > without any locking? Here I find the caching complexity not worth it for v2 only (also C is in the eye of the beholder) -- because then css_set_lock can be dropped =66rom cgroup_show_path with simpler reasoning. (Sadly, the bigger benefit would be on hybrid setups multiplied by the number of v1 hierarchies listed.) (OTOH, the caching argument and weights for it may be different for /proc/$pid/cgroup.) > The proposed changes seem a bit too brittle to me. OK, I'll look into separate cgroup_show_path and cgroup1_show_path approach. Thanks, Michal --rylaem3izw3vqdtr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTrXXag4J0QvXXBmkMkDQmsBEOquQUCZFU9swAKCRAkDQmsBEOq uSoLAQD754ptzc5v4SJdwNDmNSnDSByFIjlKbnAxKHci/pO4ywD+MIDAb1A+syAS I2WGGvHWDmD2tCQtQb85PVVcokfqkQ0= =uY1H -----END PGP SIGNATURE----- --rylaem3izw3vqdtr--