Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp761871imn; Tue, 26 Jul 2022 08:36:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sxExAlkm7N0Ub4S0+NFcGCKJsuStAMLncBdpdwVsUqAypdAEF+ZdUhqgL7KsJH1FVomOQ8 X-Received: by 2002:a05:6830:410f:b0:61c:9be6:5b2e with SMTP id w15-20020a056830410f00b0061c9be65b2emr6864836ott.174.1658849795728; Tue, 26 Jul 2022 08:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658849795; cv=none; d=google.com; s=arc-20160816; b=uEVmmidZIMvlp6YCUx8o2a4s24FS+8PRFLneSAsVeH4hOVsVGv+j4Mexff5Z52R2OP ZxojOzXvv/2oC9HrxHY/Y8Qvd/n0LQNDP4VazQegtI1lA+7QnUdtGNR+2IZPtHBEQ0IP YTGZQOz3ETSZlWVKkQRsSpjR6EH9pZwLufiFjh2QnseAoIEFM0G6griHKd4ABOYuBKt8 fW+vMjkRZXTKfCKyPfE77EB2zbdgyiSh4J4susEXMcJO4Smj/P5jQNJl0GGgE51mB8gh 2Q87dD+LsiD+X0AOhsdRBPcmbKFhmtUhmMFWQr8ajjHsG/NSpt8mZ4e/3TSxBkyZay/X lq8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=3bsbGkr+ml3ccu5dQDVYwxJTp4j0IzVNFei719oDR5g=; b=a0zRe+s89gSzDk0zC32IGDaAzmDG5KxL7qkak/SZblUm7Qm4Pnyd+UAGXFVHS7lwvM Cvek28MV8De4DSJJGgAfn085ZkWSVqiqVlb3pM0mfrFkU+kK25vlZ+K+TIs8smIfithT DHh6M70UDLWwOhQQlua8ZY+t/h8qBXvtmFKIgGrK3u2wVV84N/dbpBSPqv/nX6l9bwMy sk5MIT9bHP00obKraeaEMF5uYy7Q8SlENxbE+W1oIsjbP9Alv9er4tnTYmd0wAQsSwuW 8z/V+91QpgL/I2CO5agpjG7uE5f+0hP6BeRz90vdYSqGVWFeZTF+wDXvp3DyMs0hwXJ5 tAPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=STBJKCut; 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 e1-20020a4ab141000000b00435961a0b5asi9315750ooo.44.2022.07.26.08.36.21; Tue, 26 Jul 2022 08:36:35 -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=STBJKCut; 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 S236727AbiGZOcE (ORCPT + 99 others); Tue, 26 Jul 2022 10:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232995AbiGZOcC (ORCPT ); Tue, 26 Jul 2022 10:32:02 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABA2C32C; Tue, 26 Jul 2022 07:31:59 -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-out1.suse.de (Postfix) with ESMTPS id 58AE537809; Tue, 26 Jul 2022 14:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1658845918; 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=3bsbGkr+ml3ccu5dQDVYwxJTp4j0IzVNFei719oDR5g=; b=STBJKCutDeRpcV4piN3dyy6Q7s+/PZX/QfVLGhYZGPG/3K5mGwgF5D6Qgmr8Lqyp7B9MLp XZnivzHP6JzcJkMqM+lNYANR4ZblsmElZxeIlorLvwjEcq0phL02P+zBf0qtagFOo0NDIA 76C370KAMi/SpSKUDQlogfZj6DS5DQ4= 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 292A713322; Tue, 26 Jul 2022 14:31:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LPQWCd7632IHPwAAMHmgww (envelope-from ); Tue, 26 Jul 2022 14:31:58 +0000 Date: Tue, 26 Jul 2022 16:31:56 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Tejun Heo Cc: Christian Brauner , Peter Zijlstra , John Stultz , Dmitry Shmidt , Oleg Nesterov , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH 1/3 cgroup/for-5.20] cgroup: Elide write-locking threadgroup_rwsem when updating csses on an empty subtree Message-ID: <20220726143156.GA14370@blackbody.suse.cz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello. On Thu, Jul 14, 2022 at 06:38:15PM -1000, Tejun Heo wrote: > However, if the subtree doesn't contain any tasks, there aren't gonna > be any cgroup migrations. Nice catch. > This condition can be trivially detected by testing whether > mgctx.preloaded_src_csets is empty. Elide write-locking > threadgroup_rwsem if the subtree is empty. This check is perhaps even more robust than, e.g. cgroup_is_populated() due to possible zombie cases. > kernel/cgroup/cgroup.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) Reviewed-by: Michal Koutn=FD --UugvWAfsgieZRqgk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTrXXag4J0QvXXBmkMkDQmsBEOquQUCYt/6twAKCRAkDQmsBEOq ubXRAQD90uqCtIlSRrYwhHsL3H1Goqr3zq/aW3zZtjBIDp5HWQD/c2FILXRb5yDW GMTSvPlWlLg8Q8IgL0Exn+tuoQwgDwM= =yafZ -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk--