From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.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 0FE402F39AB for ; Wed, 8 Apr 2026 12:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775652013; cv=none; b=ZHRzNZl7bqxzrF2N1i0qUYldilDGdfS727Hji6aXf0xngwv4YSdTkQnuujhAB37rPYBMFxCT4Iiuk1canzfrWax09zH6LHTU87Zb8sHU2COZYM0+NwpsVI3YAvz+NRdSCeioxrSTH+R4UuQ/4JxCopnanwI8DFUDKgi5C7U4yoA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775652013; c=relaxed/simple; bh=oBisJrvmTUoJbacY+XdL9I+cTHQ/btwhdYGTWR39rcA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=j+RgmKk7x5/mhd5RDtgtDm/VEQAXAB0EEAYVBah4r8xB5cXyWYHFQHJ96DRAAwVHBTLe6zMttotsOB3tkE0bswX9y5IYywvzo6S/UD1vbDVFpRjlBSnFCfaE6cvpOVXMa/u7CtMS3W9vc2A+N6EeM1dPs4F1vOWImpZNkJbqWXY= 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=ugn3l4LF; arc=none smtp.client-ip=209.85.208.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="ugn3l4LF" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-66f10f1bfeaso2987810a12.0 for ; Wed, 08 Apr 2026 05:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775652010; x=1776256810; 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=seKR2RIz3AtZiCRTNc2MR0WnPUrsv2QsEKLqRoGCnCA=; b=ugn3l4LFU6ECQcnLAe8oD0igDPWgZ27slfc3e97tHgReKtQ1Kt3Iu0p/oZQK6O0dqn cibUPXhfbVU8QZ+fE84WMWzEpXx/fDOh+MiE1tO6ollFD7Nl9ZhraCOAMIPhZ5KhTrkL RSBPPq0MW3CXYr+M8NKIE2mWfcAyIzz5ctU9Px8BuLiwVRF4ULFWqTQSk47KfB4ifKQR 5VulQRBe/9TJJWWYR0/x+3hHyUKjRkvdGucc9vmAuHy/juPTrmWDNjenb01oLX2IVInM fJ30m4q7to+TdieUI8szYal0gYziY+DJlt99POsSk2akLmMT5KratApOyfjj23mfygYw vOag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775652010; x=1776256810; 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=seKR2RIz3AtZiCRTNc2MR0WnPUrsv2QsEKLqRoGCnCA=; b=r0bh9XfkuRlyQkS7mOD7w+GIbrzD5xb1XcM2InsdziJN7uH2Kc6cV2lHvou8QF24gW 5meTHNYeZX78b1i9dW5w5xqpxtaRrF/o4qPnNNhIUKkYR18gDTVTltmWn3R6+C7Dme9n lyEGh9XiI6yTI9+DIKEsEl59l4FDaJrvzOQKdzyLjN6pLOMnU4JX/kHujgtoj723qkkI yr+xbk47/mnvgGN/LunhKAHhf23ZewTnehISUQr9qWSTlR+dKZ5CUdofG4sV+FMv4h/d pzA8AJ6zFEVrYYWC645z/YOk2L3vAIIlvqv1lXnMwNL+PulwbXWgj06U+02n2w9CMylb gfrQ== X-Forwarded-Encrypted: i=1; AJvYcCXOyfaP2S3ze43vqiHfmfX1ft8SijHpJP4ARd9ytrJuRWRMdQOFwdNAJBvpKDPQ48ZWUtvRLNRkwcM6oFI=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7GN+cYjSUxl3zItNFsTw99BE0AeaszienZYgqDMLyfvADuVEB PR3CtjthciHeHa1Eyo8ahm/6+nVjWaWdy/V06aMz9hrsZd54YEICj8QWYbzUV0D8h679sXN8F92 YW6Pd54HpamwelA== X-Received: from edvr1.prod.google.com ([2002:a05:6402:181:b0:66b:81cf:c90b]) (user=jpiecuch job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:350f:b0:66e:b997:2b61 with SMTP id 4fb4d7f45d1cf-66eb9975d30mr6479730a12.18.1775652010071; Wed, 08 Apr 2026 05:40:10 -0700 (PDT) Date: Wed, 08 Apr 2026 12:40:09 +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: <20260408091821.91063-1-jpiecuch@google.com> X-Mailer: aerc 0.21.0-0-g5549850facc2 Message-ID: Subject: Re: [PATCH sched_ext/for-7.1] sched_ext: Documentation: Add missing calls to quiescent(), runnable() From: Kuba Piecuch To: Andrea Righi , Kuba Piecuch Cc: Tejun Heo , David Vernet , Changwoo Min , Christian Loehle , Emil Tsalapatis , , Content-Type: text/plain; charset="UTF-8" Hi Andrea, On Wed Apr 8, 2026 at 11:28 AM UTC, Andrea Righi wrote: ... > > Looks good, but I noticed another issue, should we also change the condition up > above as following? > > Documentation/scheduler/sched-ext.rst | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/scheduler/sched-ext.rst b/Documentation/scheduler/sched-ext.rst > index 29d36e248f58b..99df4cc982375 100644 > --- a/Documentation/scheduler/sched-ext.rst > +++ b/Documentation/scheduler/sched-ext.rst > @@ -423,7 +423,7 @@ by a sched_ext scheduler: > ops.runnable(); /* Task becomes ready to run */ > > while (task_is_runnable(task)) { > - if (task is not in a DSQ && task->scx.slice == 0) { > + if (task is not in a DSQ || task->scx.slice == 0) { > ops.enqueue(); /* Task can be added to a DSQ */ > > /* Task property change (i.e., affinity, nice, etc.)? */ > > Because we trigger ops.enqueue() when the task expired its time slice or it > becomes runnable and has not been added to a DSQ. > > This also represents correctly the sched_change() scenario: a task being > re-enqueued after sched_change() still has its time slice > 0, but we need to > call ops.enqueue() for it. I agree that the condition should be changed, but I'm not sure that this is what it should look like. Is the "task is not in a DSQ" part of the condition there to handle direct dispatch? Apart from direct dispatch from ops.select_cpu(), I wasn't able to come up with a situation where we would reach this condition with the task present on some DSQ. A more general comment about the pseudocode: I think it can be useful to introduce someone new to the general flow of the callbacks in sched_ext, but the documentation should be clear that this is a simplified view that makes assumptions about the behavior of the BPF scheduler itself (flags like SCX_OPS_ENQ_LAST, whether the scheduler uses direct dispatch), as well as the overall system (Can sched_ext be preempted by a higher-priority sched class? Can scheduling properties of a task be changed while it's running?) Without stating these assumptions clearly, we risk leaving the reader falsely believing they have a complete understanding. Thanks, Kuba