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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8465C433FE for ; Mon, 21 Nov 2022 18:50:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230132AbiKUSus (ORCPT ); Mon, 21 Nov 2022 13:50:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbiKUSuq (ORCPT ); Mon, 21 Nov 2022 13:50:46 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A445C67E9; Mon, 21 Nov 2022 10:50:45 -0800 (PST) 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 EB5D31F8B5; Mon, 21 Nov 2022 18:50:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1669056643; 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=kOkPtxy1B+aPiwWUMn6zq0m1QzdZL/48YTvASqRGnL4=; b=eWMES88FsBzrH40LiK+qYy1lxRyYmEbH8g8dpl52Ug6pzifOHVL20SZLjKE2E6+eGQlmQq 0SPeOxmtxbUghhnfMAFejUqhU2tnuReqkc/p/TwqTbR1ON2k0YK3Fv2aPRmcUvuLGo6Egc 3ToqnD7s5N+41BcgKlBBW/cdlMD2+vs= 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 C01F01377F; Mon, 21 Nov 2022 18:50:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vtqHLYPIe2N0KwAAMHmgww (envelope-from ); Mon, 21 Nov 2022 18:50:43 +0000 Date: Mon, 21 Nov 2022 19:50:42 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Waiman Long Cc: Tejun Heo , Zefan Li , Johannes Weiner , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Andrzej Siewior Subject: Re: [PATCH 2/2] cgroup/cpuset: Optimize cpuset_attach() on v2 Message-ID: <20221121185042.GA15225@blackbody.suse.cz> References: <20221112221939.1272764-1-longman@redhat.com> <20221112221939.1272764-3-longman@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <20221112221939.1272764-3-longman@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Nov 12, 2022 at 05:19:39PM -0500, Waiman Long wrote: > + /* > + * In the default hierarchy, enabling cpuset in the child cgroups > + * will trigger a number of cpuset_attach() calls with no change > + * in effective cpus and mems. In that case, we can optimize out > + * by skipping the task iteration and update. > + */ > + if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys) && > + !cpus_updated && !mems_updated) { I'm just wondering -- why is this limited to the default hierarchy only? IOW why can't v1 skip too (when favorable constness between cpusets). Thanks, Michal --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTrXXag4J0QvXXBmkMkDQmsBEOquQUCY3vIfwAKCRAkDQmsBEOq ueSvAQCyC6t+4Kgc9Ku5M0Twd+wYTQLyFcMCodNhZGs2DG56GQEA96Cg26FgHBCF 4fx2Ow2jpg02roncB1d72afOmf7dwwc= =Py+0 -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--