From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 1B700366073 for ; Thu, 23 Apr 2026 04:27:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776918460; cv=none; b=NhDJ7LM1WT0yR1k/H3Jby/QhWEUoVVAa/8Y8K5dHA4LeZjKqQEDoh0ToVA8Wtx77gpe+BvxDy3mkGoniJpTCIiqWyZheySdaViVBEjDCVmSMggG+8uq9zD7/wE9gH99TBZkOm8t/txAux9jHQnlSv1G1ztfDH3a2rG4uonBR+68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776918460; c=relaxed/simple; bh=ZsEn5rxnGSt7tMnPzSsd3tXD8/8NEsfrgnLAUBa+wYw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tFJFs6u1CniEqvb5u2c7EPTx0vZUB37AOKhICXj7fVGWiOHkGekqLAMa2gA+oth8wd2WKQ3bncujviLlmA0YbptYi/jvDAvOUPRCE/wcDSrMyH3ummN3mKrC3nFco1w0nFvxQd7hVgX/EqJVR+5VBNjsYW4yIDRpDjHoGR2tqQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k9wqYdaC; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k9wqYdaC" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-358ed696623so2835950a91.0 for ; Wed, 22 Apr 2026 21:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776918458; x=1777523258; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Pqu52UQVqmdz5XF97idtZH2dglQzs8pm/EDe81CVzZM=; b=k9wqYdaC/QT0XYUHDpPJUrk+DLuzXpUoOjcKZvhuYsEkGtYAyFXxSp/LZLiaGs64P5 qve8fFbVy+WPHksmOe4HN7cf1Lg/T/dlvOM14lf5CL5jOrKKPeThPMP3OYXa03cdNCrD YlD0ycm8gQIgxFlBSVoaM1rpDT/CwxxAbijv8ln6muHrwQcAJuUtYAsbBWCyxOnyuCq3 22RmNCfQXmzQSVr1m+TMUKJZiHa6/+1E3zTGlqwt7q+10emxCua3irYGFbhrqijhStA7 WaJ5PAzBAAtSWcTFBownFAUffODul6DJFp6Og8dlC4MByQ9mHj8jriVDAcntNBGYD9Gv gFAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776918458; x=1777523258; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pqu52UQVqmdz5XF97idtZH2dglQzs8pm/EDe81CVzZM=; b=iqWeo35NoA1fCBbs/8xT4OQdfyE2seffDPznO36i/khGaN0vIzJbg+SGqLWN2kP+Vc SiV9tmO7XHZpzYFDMbav9mdcBvD+9COqwgq2Lh7XiUWeEMVx3CGvV+xWmJ0gRnHnmDjv b5nWuiN5eRvpKl0g0G/ngjjHhFsytsE12uGMzplp9LGyMpj6O+aS46y4bJthKwd6EMrt II4IbBXtCXzgjCzzKVRekS5Kd05xGGTrSIp88PnBPwQ5aiIiENEWjKV4oTQhvhHckKEm A9nA6ZpxI7t3rB1IGN7yW0F9Q+qL8IsbsqZuN/z4WFt2WETDZFUWoPkbTKcT96Ny4ddJ k7Hw== X-Forwarded-Encrypted: i=1; AFNElJ9rY2PqZzNQ2ERZOYSjUA3VXR+S5nsZB4dFaG3EY2SGpB9o1fthuqdjUZIgRyiOc0SC/xk48iehRhRZx7o=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3s+uTq9o8NSY6fZwhcBj2GWF38LS0b6ZD8sHgXMwxWOK8CIlc AQCzP1Xx8elGxRAKKlaMP/AM7HHbvE/+eSi+y49vm2uL5XZwlv/sLpxL X-Gm-Gg: AeBDiesBEPlaSO25fUt377PH70LH8Gc78wWTW2W6eeUYkThebp0pQBfgiaf0GHJ+Xgw eiMFiAP1kph/HaDVS1eQzSos/DiGGbkGQHomlHSSnXf9QMzOnoDeiKE0q1rp1tQfOHcKZAN7tX+ +VgjMa86yMD3HGuaoq9xtFz0qGCXzrDGmoTvv1mvKTv1t7KWyOx3m8C4ah0EbDHdhv/7Lpyw651 /MpBgt21PmSOFAA4FTHkVS7sGv15jEe2h3rR32flFfcyPnPKqqm9v6NTDiKTCUidZWqM//rtF/U CzC4U7rDelghLo6tnaXyNh36Mvowy63B56qiXDtLoJ9OnJTd69HU6090YvvnIVHq9yO7fimAQlq rpI1eBc0MfcF0ymTSxshOGTgvwylSjWU99+jcETjCPRxc2pIBjX55MgTQQU7nC2SopCmuqWXOj/ mrm3zIABy/K9Wlno534liZVwCrGqgVT/hkqQaw0rNsTaIGl+bV2JK/xp3LWu5zrjPZS+WQRiFYS JL0Plq4k57o26Aj X-Received: by 2002:a17:90b:5203:b0:35d:9560:3efc with SMTP id 98e67ed59e1d1-361404632e8mr23588821a91.14.1776918458343; Wed, 22 Apr 2026 21:27:38 -0700 (PDT) Received: from cchengyang.duckdns.org (36-225-83-234.dynamic-ip.hinet.net. [36.225.83.234]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-361417748aesm18242072a91.0.2026.04.22.21.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 21:27:37 -0700 (PDT) Date: Thu, 23 Apr 2026 12:27:34 +0800 From: Cheng-Yang Chou To: zhidao su Cc: Tejun Heo , Andrea Righi , David Vernet , Changwoo Min , sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org, zhidao su , Ching-Chun Huang , Chia-Ping Tsai Subject: Re: [PATCH] sched_ext: Fix local_dsq_post_enq() to use task's scheduler in sub-sched Message-ID: <20260423121149.Ge96e@cchengyang.duckdns.org> References: <20260423025832.2654840-1-suzhidao@xiaomi.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260423025832.2654840-1-suzhidao@xiaomi.com> Hi zhidao, On Thu, Apr 23, 2026 at 10:58:32AM +0800, zhidao su wrote: > local_dsq_post_enq() calls call_task_dequeue() with scx_root instead of > the scheduler instance actually managing the task. When > CONFIG_EXT_SUB_SCHED is enabled, tasks may be managed by a sub-scheduler > whose ops.dequeue() callback differs from root's. Using scx_root causes > the wrong scheduler's ops.dequeue() to be consulted: sub-sched tasks > dispatched to a local DSQ via scx_bpf_dsq_move_to_local() will have > SCX_TASK_IN_CUSTODY cleared but the sub-scheduler's ops.dequeue() is > never invoked, violating the custody exit semantics. > > Fix by adding a 'struct scx_sched *sch' parameter to local_dsq_post_enq() > and move_local_task_to_local_dsq(), and propagating the correct scheduler > from their callers dispatch_enqueue(), move_task_between_dsqs(), and > consume_dispatch_q(). > > This is consistent with dispatch_enqueue()'s non-local path which already > passes 'sch' directly to call_task_dequeue() for global/bypass DSQs. > > Fixes: ebf1ccff79c4 ("sched_ext: Fix ops.dequeue() semantics") > Signed-off-by: zhidao su This fix looks correct for the parameter mismatch. Reviewed-by: Cheng-Yang Chou Regarding the Fixes tag: I'm not entirely sure if it's strictly required since the sub-scheduler groundwork is still a new feature. However, since it fixes a specific logic error, keeping the tag seems appropriate. Thanks. -- Cheers, Cheng-Yang