From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B138C30F819 for ; Sat, 1 Aug 2026 10:35:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785580529; cv=none; b=E7ccB2r1vedPa9GBXQM6bUoti2Tnu9GKDfowA0LaAHjGCcLj9YfGpTX/02L4KVnfYTjUrOPi/5MMR4L3Y6b8PF+3kltEjO31yeax9wAG6IPI0wFnWSlLq054l5PpJaCOv+aIQ4znlToDikeWTLYrLF5rNU2eHcjy1jwSynkKzSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785580529; c=relaxed/simple; bh=bwlUSI7TgtwbSZUG1kvau3EDCZuauBS7kN5yVJx+KeU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=QV6fLyr85OEpzK9FwiFYhpqVbzwU1xkLbgJMlEohTv+UnFuQh0ePCYZieMLDs2eX520ppUm1caK0pflr416LIogNRvzCmTu0oCRoSwRP40gD+oAgYp+nshPQ/FUdnO5N6Rox0AxKJ5nrqsJ0gBt0l72Ip0+SjqR3gifQVVSw8U8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jpiecuch.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=RePb0fpA; arc=none smtp.client-ip=209.85.128.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jpiecuch.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="RePb0fpA" Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4954b1c6310so5553885e9.0 for ; Sat, 01 Aug 2026 03:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785580526; x=1786185326; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=bwlUSI7TgtwbSZUG1kvau3EDCZuauBS7kN5yVJx+KeU=; b=RePb0fpALRmPIs83NLPkndbQCZu4+uktXUswLS2GFSjwydnZP7D8hbXsrHRZfghMsa T8eZ6lnQrIw3BN0kHnfNSXobMVMQP6MyTI/lqC4X6IitVSQh/Uen2iWvOFPPRfFvD0VZ BWtb4x02qoyO3SXMsaop4j1zZR4UNto7SBNf78h7s2QulJmrF1AJyUsmJIbaGbTd44q8 m+2MCwl+7cHM2ypBtaPBWkW/3UWFBHObiDzLHRXxpnIJuB/XlqIJYltSOeZ1Xxbf54+r S/fdyyaojzrrtdmIa7+Sde73a7Ocxhhz4BY7KWOd1XqqY2eE0kNQWCAsSo56Q0HpK1yR KlbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785580526; x=1786185326; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=bwlUSI7TgtwbSZUG1kvau3EDCZuauBS7kN5yVJx+KeU=; b=es0H8Q5KPux3VIz1fY6zy9AlWtJCOoQUbmTTQ1Z4Gnki4PthzvmWI72AkXhs77HO/K 7CjOLU4nJoxw+poOX8NyS6RATLdca2jFLuzLBpEBlZ57h7gDe3FLAGIGcF1jD5jeZBX1 7y/5wrZjLwp6O6Pxo/iZjI9EG/HU0KxuHfFLtnKhx9Ffsqd34W35/W2rabR2JNCtLiQ7 cZNUY646lhRlxxfORVOF6jge1xGH6vpAYtzPfx7CYbqaUOtiCqUFVEvFBAQu2oUR9K9Q 96myEzkkB8DH98pdeZOHwvkzMjq2vQnRyVC2o7TRuYOP4n7OhHqnGhFXIfJU+C0qru0+ Uysw== X-Forwarded-Encrypted: i=1; AHgh+RpAj6bobvAsmzZUKL9m3+DSrh/PnJL9666in2feESrMNEXcAnQd2/a46FFoJscz+9mdb9uFeOeWb112tpI=@vger.kernel.org X-Gm-Message-State: AOJu0YxUVyFU8nSO4swkpneWU4Mr3bmIzmW0Rg5Zo/Na0popmg5JPAd4 WQ4QOaMh1dqQvr+y4wmwbstxzFTKEPIbCtlSF4nqWgw8EANOnoFKXltxkhb4HcxOWQJmuVwSqXt WBfoMCRKrC/+CVw== X-Received: from wmoi20.prod.google.com ([2002:a05:600c:4814:b0:495:6708:efe5]) (user=jpiecuch job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:2294:b0:492:4e09:9fc1 with SMTP id 5b1f17b1804b1-4980c67af97mr31980915e9.15.1785580525709; Sat, 01 Aug 2026 03:35:25 -0700 (PDT) Date: Sat, 01 Aug 2026 10:35:24 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260731090334.2911948-1-arighi@nvidia.com> <20260731090334.2911948-3-arighi@nvidia.com> X-Mailer: aerc 0.21.0-0-g5549850facc2 Message-ID: Subject: Re: [PATCH 2/2] selftests/sched_ext: Make allowed_cpus idle validation race-free From: Kuba Piecuch To: Andrea Righi , Kuba Piecuch Cc: Tejun Heo , David Vernet , Changwoo Min , , Content-Type: text/plain; charset="UTF-8" On Fri Jul 31, 2026 at 3:26 PM UTC, Andrea Righi wrote: > On Fri, Jul 31, 2026 at 11:12:09AM +0000, Kuba Piecuch wrote: >> Could we check a stronger invariant by also checking that the bit in the idle >> mask is set if we're running an idle task? We can get the idle cpumask through >> scx_bpf_get_idle_cpumask() and check bits without clearing them using >> bpf_cpumask_test_cpu(). > > I don't think the other direction always holds: an idle CPU can be claimed by > another BPF idle CPU selection helper, which can clear the idle bit before the > CPU necessarily stops running the idle task. In that case, observing an idle > task with a clear idle bit is legitimate. Right, thanks for pointing that out.