Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1039884rdb; Wed, 1 Nov 2023 09:36:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqngWQlxHAWJf6ftxCn3E92OZEMzDAlLCC3KM09S949St5goXMOhKBVaJ7hJp86NZwvylv X-Received: by 2002:a05:6870:9d0c:b0:1ea:9898:c07f with SMTP id pp12-20020a0568709d0c00b001ea9898c07fmr19235414oab.22.1698856588892; Wed, 01 Nov 2023 09:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698856588; cv=none; d=google.com; s=arc-20160816; b=g1zkowS6thy8cLIV7ScwM5Klld5SYAfyjSiq1y6DiaXCar/wUh7bBzE8zZzTx1zs/6 5fDIlJR52PkpqktpC2cxSlEQqSPvkjnnQ3iHUHGsITt3KM5sbH+fk7IJm65y1lkeytBV TPe16huRQL/C3glRaKW+3TTVKFrdVzj01Z9jfpWxPSOcwEIghv/efnwBOm6i4fgQCD6R hyaHnkm5ez5rrxIEEIvy1pyheGVMKxAizlFKNHqVws6nmL3gpYKjexCnn8NqBdfow7BX HP+NO0YGJaRTzJ2+a/Up9vs80fcJ5HV4ZpDMvTMsMZUg1X4VxgeVIWbeXE5raF/UYoK4 EqwA== 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=N5O9yVzr2Fp86pXITTg5XMjcbZYAb2UKlWEjGDcWW0Q=; fh=p0N3yJq+MbLnpZUKxStw8a02E83G+LuMAx3OkhRWvi0=; b=Rb046PlksNhujvH3+uCasl9olR8AyqA3a7dTlDLhRJ9ep7TZVHXPBgtbKC5lUQZ9GI oAngcBsxfdduXkQvLzX6DsbQVfvGZRFrrtM2bzh8FqXds2Mo7FmFkUL+pC+iUwZJm3Og CmjplUzI/XTBri9AHYDywTf8zBUa0ar7UwIHxv8teAoPqeQS0xO8nbn4fS9SYLOnz3rx wpZ3z7v2wC25w+PD0ldD4srdQDXnmuEeEzK92eFMYZALJQVFF4QHAW52ehy36euSVWZc KOSrf4tKieomaJXrHTqIm/BpjH8KVzQPGkWcGaSf9mEzu/GQa/ABZHGuRFVTMtp12lTZ xPyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NtrqpV4e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y11-20020a656c0b000000b005bd04873387si289315pgu.105.2023.11.01.09.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 09:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NtrqpV4e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B6E5C8077A5B; Wed, 1 Nov 2023 09:35:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231759AbjKAQfF (ORCPT + 99 others); Wed, 1 Nov 2023 12:35:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbjKAQfD (ORCPT ); Wed, 1 Nov 2023 12:35:03 -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 CEB31101; Wed, 1 Nov 2023 09:34:57 -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 7DAC82184B; Wed, 1 Nov 2023 16:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1698856496; 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=N5O9yVzr2Fp86pXITTg5XMjcbZYAb2UKlWEjGDcWW0Q=; b=NtrqpV4eaS2cWFNn/HdGMpva2UjRENBzj77si+MHz9/1qQiSc4atEySayNGBnNSEfRR/FO re3LZE2XdFx4+mVhuB3k+Pl3aTmb5c0XgLLlhShRPGWxoqmho/RcAONpdsvD1x59pY5he5 sk4CjMH7S6ZHr6rYXznEQgrOQaNXHNo= 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 3B17113460; Wed, 1 Nov 2023 16:34:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KLJuDTB+QmUiRAAAMHmgww (envelope-from ); Wed, 01 Nov 2023 16:34:56 +0000 Date: Wed, 1 Nov 2023 17:34:54 +0100 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Waiman Long Cc: Tejun Heo , Zefan Li , Johannes Weiner , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Juri Lelli , Peter Zijlstra , Ingo Molnar , Qais Yousef , Hao Luo , Dietmar Eggemann , Steven Rostedt , Xia Fukun Subject: Re: [PATCH v2] cgroup/cpuset: Change nr_deadline_tasks to an atomic_t value Message-ID: References: <20231024141834.4073262-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z6dp2g4bz4jcl4rk" Content-Disposition: inline In-Reply-To: <20231024141834.4073262-1-longman@redhat.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 01 Nov 2023 09:35:30 -0700 (PDT) --z6dp2g4bz4jcl4rk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 24, 2023 at 10:18:34AM -0400, Waiman Long = wrote: > The nr_deadline_tasks field in cpuset structure was introduced by > commit 6c24849f5515 ("sched/cpuset: Keep track of SCHED_DEADLINE task > in cpusets"). Unlike nr_migrate_dl_tasks which is only modified under > cpuset_mutex, nr_deadline_tasks can be updated under two different > locks - cpuset_mutex in most cases or css_set_lock in cgroup_exit(). As > a result, data races can happen leading to incorrect nr_deadline_tasks > value. The effect is that dl_update_tasks_root_domain() processes tasks unnecessarily or that it incorrectly skips dl_add_task_root_domain()? > Since it is not practical to somehow take cpuset_mutex in cgroup_exit(), > the easy way out to avoid this possible race condition is by making > nr_deadline_tasks an atomic_t value. If css_set_lock is useless for this fields and it's going to be atomic, could you please add (presumably) a cleanup that moves dec_dl_tasks_cs() =66rom under css_set_lock in cgroup_exit() to a (new but specific) cpuset_cgrp_subsys.exit() handler? Thanks, Michal --z6dp2g4bz4jcl4rk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQpEWyjXuwGT2dDBqAGvrMr/1gcjgUCZUJ+LAAKCRAGvrMr/1gc jgZ4APwOEmqWSHl49Yb8odlBYPzqkB5OTy1xHY0CjMcLKHeN6QD+IpxKJC/9OTpe rm9cRwaVk5bAFTh8Z83s86WFr73Zgg4= =1DEk -----END PGP SIGNATURE----- --z6dp2g4bz4jcl4rk--