From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (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 48E90322DD1 for ; Thu, 27 Nov 2025 10:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764239979; cv=none; b=kmDt/uAL7/xAiUOVjbf7A5TU5LAP8n07ePheGiIYMnB0/K6BAB9MkOr8iSdTaZjCOvvYx7XoqqRlxyumjGlwwaGAJPpsNOsELRbj6S+Zzb05kZtax++9qTKB0GH+55eh82Yp7hj4Q/Kns1Y8PZ6L+FCgBHarkDKcgyyoXh6n680= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764239979; c=relaxed/simple; bh=9psqYrIv0eFQ6vtEA+yo7se3T74TLPtnsKpZBy8r/v0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=mC8KN13c/Oxv/I7NyXnZCf6/IuwydPDnOetx+YxdmaaVpYsYHtKORdn1NcRzH0Mmy9PR4HOP9oZmCtfnCC/XmxDk2vgemE6MqydB3lENGRyaTx6XXoQTHa4Wz1h1yVgSBpMYfFyZ8GgWCVFAZxTGkrm+IBtTH9jXmPyQ8JNyM1U= 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=buqHh2u4; arc=none smtp.client-ip=209.85.128.74 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="buqHh2u4" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-47106a388cfso4216715e9.0 for ; Thu, 27 Nov 2025 02:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1764239976; x=1764844776; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=lqAp9KVCPquz913n77B6yJ7OoUi8d/Wkn+xOGKClAHw=; b=buqHh2u4jlA94b+Xsw6cph7L0SRvP+kpq/SkoqV06/pOWaQjerAm4KPbjoCOFtuLEb gywdqvoBWrO6oLPvFf/y3JgYdyT76q/HLwGGfh3V6nBzjyD9goFvAnfFSlYLcMFLCc3n dUn/Gvae2vRI5Ctzhk4q0y4JqQRezKYsdLQKghKprv2n6yvqCXwcnu83JkazISaZojbu PwylUB8b4RxlHHgmb4XQmiZgZ6Yz6Krq26CFMNOAoSmgl9EBscda8633Rcb/uGB2kOPd h/m2TylP8M137gxlGK6z7b41fiPIVfJacIii8BOe/6lKz8tRLxOEiMVNP+HHMBHFZXhK ffDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764239976; x=1764844776; h=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; bh=lqAp9KVCPquz913n77B6yJ7OoUi8d/Wkn+xOGKClAHw=; b=ryOAqHGrIJzeM/1ZldUV5VcvvclkPVoqcxO/FWDNGICKnzBSx5ojRpeICgpXA9LSqR mxM5NbLStnsof2AnHl9HIXzZ0b9J7PozriSgkeBxH3uRCxreXmIuPrpBzC5+jaI7+GZG QiMpjTKQbxd2W8I3Sgg5/eA8PwgG6Gz9txDkGq7YM9cLP6LGz6JdYthJvSAf3HK3twj5 oyX8P4/kFE+q2fL19BVq3J6GlVeyq/Lbvk90QzTYGqnNbW/pciHBI7Ymr8r3GX4+VTM9 +K9NcDTyd10AbWzDFDbHK7ouJJ2OhumdQ1nkazp+8WEz1aC7ewyURQJ4S6r1336yy66v L+dA== X-Gm-Message-State: AOJu0YxjhvN9HYvR3o98CNbhv9Hgd18jWbWwdj2SXzHXXYm1Ju2xnd3U EOPfkoW+BxH42PtoCsZQVCF+ED6rClDoQ6J/y8Dq2zR/OMxFgoqrw5M7FUYkmpsUbaufR379HvW KB9djhTiZzdiU+w== X-Google-Smtp-Source: AGHT+IFOu1KDxS4wOpjUJIiOlRei4monHQlN4TXIIv6EXMYnI0d7/4TU+UcTmPQbCkMIeBY6k7kgsQpI859Wlw== X-Received: from wmbjp25.prod.google.com ([2002:a05:600c:5599:b0:477:a181:1922]) (user=jpiecuch job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:46cf:b0:477:561f:6fc8 with SMTP id 5b1f17b1804b1-477c1103015mr202856565e9.5.1764239976616; Thu, 27 Nov 2025 02:39:36 -0800 (PST) Date: Thu, 27 Nov 2025 10:39:35 +0000 In-Reply-To: <7e9b27d70e31c243da3ce77e622b0af5@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251025001849.1915635-1-tj@kernel.org> <7e9b27d70e31c243da3ce77e622b0af5@kernel.org> X-Mailer: aerc 0.20.1 Message-ID: Subject: Re: [PATCH v3 3/3] sched_ext: Allow scx_bpf_reenqueue_local() to be called from anywhere From: Kuba Piecuch To: Tejun Heo , David Vernet , Andrea Righi , Changwoo Min Cc: , , Peter Zijlstra , Wen-Fang Liu Content-Type: text/plain; charset="UTF-8" On Wed Oct 29, 2025 at 3:49 PM UTC, Tejun Heo wrote: > Schedulers can now use standard BPF mechanisms like the sched_switch tracepoint > to detect and handle CPU preemption. Correct me if I'm wrong, but I think using the sched_switch tracepoint still leaves us with no preemption notification in the following scenario: 1. An RT task is running on the CPU and blocks. 2. pick_task_scx() briefly drops the rq lock in balance_one() and the RT task is woken up. 3. SCX sees the enqueue and returns RETRY_TASK from pick_task_scx(). 4. The RT task is picked. 5. Since prev == next, we don't enter the is_switch branch in __schedule() and the sched_switch tracepoint isn't reached. The BPF scheduler could hook into trace_sched_exit_tp() to work around this, but that tracepoint seems to be for testing and debugging purposes only.