From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f73.google.com (mail-ej1-f73.google.com [209.85.218.73]) (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 058B82DAFA5 for ; Thu, 5 Feb 2026 17:20:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770312014; cv=none; b=a5mr8vhGRhcgKIomq7BXK35XvbJXsVapKF5Kkh/ZDefZmNzlnrUznbQ24k9vJIWNHVzsWriuGD99llWCqczD9vQu3vRSBGYHm1GhH3DVTyRfv7nW9Cl9fI2ytvuP9yyY3vYapHySm8eVZE/2m4B0KDr8vATkgL3Lq1kKkuMEq1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770312014; c=relaxed/simple; bh=N+O5b3okJf58AQ08ZBJ3usQJByw853lkyTtyp3tH3oo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=TCMQxjNr9pnD6xCIwr5DynaPv4GHOBacbhY9vHaGAgFHvlD3PoeNOHRwzblIex4pjp6W5Er5GNjsfy6vHsrRCSO7S8Z74vy3mHz2vA5yXpDlqny2dNA9tqpcWvyl0Nqwf2cJsuYpgA3sj8rGd1YXpPkNa1do08jBU16rNhTEjtU= 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=pCc80Oi/; arc=none smtp.client-ip=209.85.218.73 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="pCc80Oi/" Received: by mail-ej1-f73.google.com with SMTP id a640c23a62f3a-b8839f45c3aso208344266b.1 for ; Thu, 05 Feb 2026 09:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770312012; x=1770916812; 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=8uZLSyUXyfuziZ3N+5Sv1fvm6p2ygn8U5LDj189v4+k=; b=pCc80Oi/Xq6jMd+iie0MgbPCLRt8Pqoo28n2dLDibJPSQfbm4jScyyWBS//XCbKmEQ 7SBUtN/ekUwRpPtQzha3WECuDQGoxUbpgpVpwbptGgfSXOTIZ4KRPHf9LXjxc2KnpbH3 NLGe93YTzgaXA3mrZl+t8KS2PTvJNRVVvF8k9oOb4m10dB9mgor/X6mQn0h+syHpZ16q XgsY5W9F6gzWoDta6SIbSiR11TFpgzT4VnboatpBcGFUMKXITv44TNy7W8vq7B3Ymy27 EMn88WWYY6ypDZIMMIPEcNSQHh1bXIbDW2IOPiHJbAHAxB+Ayb3d/SSDSNFrNaxcSKWh N8DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770312012; x=1770916812; 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=8uZLSyUXyfuziZ3N+5Sv1fvm6p2ygn8U5LDj189v4+k=; b=wKis1WQp2VWo0/6YS/E5nLcoUNYNnGwABRAkFlL7VcvwvusaoIwiKK6XOJLjiZ1fM0 hq5Q0bJ9Fa67sS852X9tvFusSQJgoUhdbNPURm3Woek7yXAHr81e5/reRRtLxuhrQij+ X4ztkwj0h4a0uD+pLgq1BK2cHSipyTa1NpaN656EBxYYAHq3VOT17wzNvYAtSQwx3Lyb URv2kLjlYhI7ln3hYbw4h6ztPbIB+bVaPQKhP6gNw32rk5TW6Ht9szXdv7xxIvjCC3j/ a7kX9x1GyUX8ng2HN6/agRtVbTZgyrbljz4EODHY2bl+33UFrMR74ZCBV9DjxdDWIScm C8eQ== X-Forwarded-Encrypted: i=1; AJvYcCWm0FItk+zXj1HUpyxlit/7wkME9vqBHG9FMFHmIL++fhW3zfm2Cjq7NgQw7Z4+1hlZ26WZPjNkUTdAt3Q=@vger.kernel.org X-Gm-Message-State: AOJu0YyzHOEU+HfPFSnqsRv44Y6YzPkoqYKEkfftEm0tvqFhnVK7lGpY fPjJRgkv/AjCTomXoyyrGKCApa+F96qo+S8J2onVgaIv/ftA4oETMnh3myz2qFZ386FDxGdCC8o yVtq8XYt53Qq+AQ== X-Received: from ejbbi18.prod.google.com ([2002:a17:906:a252:b0:b8e:a380:b5ba]) (user=jpiecuch job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:842:b0:b83:95c7:f87b with SMTP id a640c23a62f3a-b8e9f2e22e5mr471838766b.37.1770312012102; Thu, 05 Feb 2026 09:20:12 -0800 (PST) Date: Thu, 05 Feb 2026 17:20:11 +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: <20260203230639.1259869-1-arighi@nvidia.com> X-Mailer: aerc 0.21.0-0-g5549850facc2 Message-ID: Subject: Re: [PATCH] sched_ext: Invalidate dispatch decisions on CPU affinity changes From: Kuba Piecuch To: Andrea Righi , Kuba Piecuch Cc: Tejun Heo , David Vernet , Changwoo Min , Christian Loehle , Emil Tsalapatis , Daniel Hodges , , Content-Type: text/plain; charset="UTF-8" On Wed Feb 4, 2026 at 5:56 PM UTC, Andrea Righi wrote: > Right. At this point I think we can just rely on the affinity validation > via task_can_run_on_remote_rq(), where p->cpus_ptr is always stable and > just drop invalid dispatches. > > And to prevent dropped tasks, I was wondering if we could just insert the > task into a per-rq fallback DSQ, that can be consumed from balance_scx() to > re-enqueue the task (setting SCX_ENQ_REENQ). This should solve the > re-enqueue problem avoiding the locking complexity of calling ops.enqueue() > directly from finish_dispatch(). > > Thoughts? How would these fallback DSQs work? 1. Would inserting the task into the fallback DSQ trigger ops.dequeue(), so that we can later balance it with the re-enqueue? 2. Which rq's fallback DSQ will the task be inserted into? The one belonging to the CPU doing the dispatch? 3. Is the re-enqueue going to happen inside the same call to balance_one() that tried to dispatch the task? I'm not opposed to the idea, I'm curious to see how it works in practice. Thanks, Kuba