From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0F743EB0F7 for ; Tue, 30 Jun 2026 09:54:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782813257; cv=none; b=A+jw34TJW760g+clinw3XIaGlAtRlX3nb67HK+kAyt/IaNIUsOuTDatpm+58J16GcYj68h7cupO13Eb3gzJUaBjpwppeKNPHUNtMo7IVra2vySRWGEolRkEMCVTvY0EjRvdhtkRpSY5bI0LJNcY4Txklv8DHuRp35xX8GBlJxpg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782813257; c=relaxed/simple; bh=EFPekGZsZTIoZc2iL1kRyL6KGOLbXoH6pZMaxt1PcjM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jiWoI1yX/8z98YsdnEoMplp+J+x+y1FTUKMIzo6twk7tCsr48E+8xDBycAigh+tKbz0Vh36/7rbFg83azCF2lQbJqxv9DBPSanVMijVs2CygY39li+Pygf75T8rAqKC3Egg2p3hwBJ3dvo0LKOwIVU7QBp1GDHhzP7QjPPdXqoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=CKoQmCHb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dolCUtuu; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="CKoQmCHb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dolCUtuu" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65U9n4at1508664 for ; Tue, 30 Jun 2026 09:54:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ifrVDpo63bx4Jsv0HgCNLjZKGwmAhOiGi4dhseDvN+E=; b=CKoQmCHbv1iRdXhQ G5rcGf5yB85Yz894N4xJdfUVx9uJqSINVU5ZyYIWOiSfj4ARs1uBL05CBAlJU4ra mc+aYVy9UWr8JKmSmEWdNgYwvpo1EZD8SflMK9G4za3vilSy5QU0wcQM6Lto/bwF LJUrZ6PgIOySVPcKedLcVWvm/PqGsLgpAg1yPMeQR3+qd4NJXCmyTHfykd+MQsQU kPcCkMNdUK+/pztlwLzrTt+K0IQqD7v7wECXJ9Tbns8RBjUZw2ZoaQA7kr0zRTXk z8oQJnp5PvnmE3K8CHsd3f5DZxOCQQpznxDtTihKketO+DzOy2II+VO9nl32CG/g 7lyl5w== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f3y9j2tt2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 30 Jun 2026 09:54:14 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-c9999d8bb43so63412a12.3 for ; Tue, 30 Jun 2026 02:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782813254; x=1783418054; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ifrVDpo63bx4Jsv0HgCNLjZKGwmAhOiGi4dhseDvN+E=; b=dolCUtuuSA6IRmEExkvvIiO8nOFKmV/8lndzXVrBxBcu1SVAiPtbIylQp4CLbAEIms rqpxcRi6xsV00W21KwUpQbqF5UxfPAiTQFLmrHoewy2i8UB56/4vFuT7txUq/UWLE8Ac /OuNt6Dy4LsWgNBSnTbdbJafd6QF9jtQiVaRfo09t6uhf3OKdE7MN3d0yv75bL39eR5i nLcoGbRam0DgIR1FKhf1VFmnW2fByiKAVWxrswanhyPbdn5zLUgtvEGoVchetP5TRYbK bs0T13JZnSfYZLO92hdjtbO6CcSMbElwlGVr3AxtAZtfy1zRgodtXlCE+iNbckRmechW hHGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782813254; x=1783418054; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ifrVDpo63bx4Jsv0HgCNLjZKGwmAhOiGi4dhseDvN+E=; b=RupUkxzPDTzopMo9xTgwNmMHrPTq0D09PFsEwicUvpA94iOo2W9+Ai/EkSQ0gwLA3t Q/imNvuo17P2apV+IhJugr2rfqi/oAqv1gGnARp0JoLp83vEPUHojf61IWfwTjfMWinP iFq3zovbI3Yy+ZJijryH2bKtc5hCXyQ573EnXaMYYOVi6NE4MpfG/AF0Wc5gUj3tSigp RzgEw06qklvr0eG9U5WYxffbUh/OczQtFA/q8dSLa/dctNWj8Cos2qKiHNPvR9zmlJ+t ukuNSD00DlPS+Win8HAyQVEZoyXFVq2Wg/ZJ5iE2PshD9EOf6UBbYVIgCUK72fDAnvme OPxA== X-Forwarded-Encrypted: i=1; AFNElJ88/OR5UZnlCNvUvdf0wyQE03M6gLDfQKrdFk5ysrMVPnrNJvG2NLaz52VqXCq5+RQbWNkzOoLFnrpkrUs=@vger.kernel.org X-Gm-Message-State: AOJu0YyVUmUeg+1WGWoLehK0DyIkKheZoF2Y+t9PGVIlcqgcO3xcnRQM 3CzB2KJPr/buBSJIVO+nBwfT7eHqn6slZ+3fGm2YD97KI+pcsBNNs6K4oqIqhWlafeT+6uzrOLf /0kljDXavAwkpPpF5xQh67kWLu26gQfQYzh//hh+Gezh26EUyqeqRegQZOxGBJ47vjCc= X-Gm-Gg: AfdE7cnosXImF0Gva9FHeyoVvsjvbn2ZsYIqjOapXqN/TX14TPZhH7fqlS4l7vvblxu DvEO8YmoQ/B79L9gJPSxF7ydW1pQMZlkjuILGcbTUSWGJXhV5dJVsZ9AMMLEfTn3jCg0rpQUk82 naFQ2gV5/OdL0AGXj3Re6JTlibNVwyV2G4iHDmBMvTHltJLTDb+3xvPBrOWSyVd0nlyKfnCN5y7 KHnTYfuq1k9/WXhdBIlZ6/lxqgh23QKwdK1I0tcJG080weod2aIth7nXVlS6UUhSOc6USFeu9uE yIn6l4TuV5hlVhzbcSEesognO9cPdzl2gHzjn0WeRr+AJV2k/5MyuShdg02nn7zCTStrUvIODkg HLqhPy0YoqqYX0a+t6KNCqoxHN4LB2vBXNuaUiFCNLmIACe0SvV7yM977fQO3eHHCZp4lA1lQnX PJ X-Received: by 2002:a05:6a00:b94:b0:82f:99c5:868d with SMTP id d2e1a72fcca58-8479f25a6c2mr1655280b3a.4.1782813254211; Tue, 30 Jun 2026 02:54:14 -0700 (PDT) X-Received: by 2002:a05:6a00:b94:b0:82f:99c5:868d with SMTP id d2e1a72fcca58-8479f25a6c2mr1655253b3a.4.1782813253569; Tue, 30 Jun 2026 02:54:13 -0700 (PDT) Received: from [10.133.33.21] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847a03778basm1565810b3a.49.2026.06.30.02.54.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jun 2026 02:54:12 -0700 (PDT) Message-ID: <3c395530-30c0-48ed-9307-a8fde8c500eb@oss.qualcomm.com> Date: Tue, 30 Jun 2026 17:54:07 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] sched_ext: Don't warn on core-sched forced idle in put_prev_task_scx() To: Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , sched-ext@lists.linux.dev Cc: Emil Tsalapatis , linux-kernel@vger.kernel.org, Kuba Piecuch References: <20260629225548.3562257-1-tj@kernel.org> Content-Language: en-US From: "Aiqun(Maria) Yu" In-Reply-To: <20260629225548.3562257-1-tj@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: anGY7Y9Y0Oq2QDM_-YMgP190TKqmjeZo X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjMwMDA4OSBTYWx0ZWRfX0D7xEfdYJg55 nUDmQUHmkAoUEqLGiGiolC2E84u0t48vPK31wvFh9TqXUpH73pz3U8fQ8kYxC+3HVNt8rDflviQ njXF9wYVG3ppp4s1KLqRIYABSxpQqx9boHueqFuw3H7KSY+DA69qzS9LOoZTYsfVBHKU2ySDzJZ KhSe8uuOePOLpv/dgZ/lBA4FsYZAtKyrsorvahI8JBOnJvKv2ZqWJzREjRMfECErplybKRGSUoI FBCFcbOrkId1hxikssmE2czENUsJtTE9tqPrqnyEq3vjtgyqXldBMu0ow/7uzg3DyodzSq37Ghl xLd+voruuM4Bt55N/pb1ihkzHEsBqghrGkaMfBNuMfRzk69AsUfrBeG0adafQUhXI0Zqw9odQXx 0w/Yt0lWgggjCoX4YVJoqUl19UnO7LYN+FFrMAegfSlHisnSDE831Pdh3r27TjRzLP52Sz1dqGb f9ZMyytLfhxLNWMCeFw== X-Proofpoint-GUID: anGY7Y9Y0Oq2QDM_-YMgP190TKqmjeZo X-Proofpoint-Spam-Info: AW1haW4tMjYwNjMwMDA4OSBTYWx0ZWRfX5w/4E5YJ9SEf zW+PeJ2ZlVU02BG87czd2VL2FVL77UVQkXN/ugcuyArXyPA0ljID8GAZJYjB3cwkIGDhXDSSOtp H078pGdWMM2h8boZUlfKK/OmnuCV960= X-Authority-Analysis: v=2.4 cv=SINykuvH c=1 sm=1 tr=0 ts=6a439246 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=qF2snBwGOhp659cOopEA:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-30_03,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606300089 On 6/30/2026 6:55 AM, Tejun Heo wrote: > put_prev_task_scx() warns when a runnable task drops to a lower sched_class > without SCX_OPS_ENQ_LAST, on the assumption that balance_one() would have > kept it running. Core scheduling breaks that: a forced-idle SMT sibling > reschedules through the core_pick fast path in pick_next_task(), which skips > pick_task_scx() and thus balance_one(), so a runnable task can drop to idle > with ENQ_LAST unset. > > Gate the warning on sched_cpu_cookie_match(): a cookie mismatch means core > scheduling forced the idle, while a match (or core scheduling off) still > catches a genuine missing-ENQ_LAST drop. > > v3: Gate the warning on sched_cpu_cookie_match() so it is suppressed only on > the forced-idle CPU instead of whenever core scheduling is enabled, so a > genuine missing-ENQ_LAST drop is still caught (Andrea Righi). > v2: Reworded the description (Kuba Piecuch). The version change log information don't need to be present here. Usually those kind of information will be present under --- and don't need to be added in the real commit message. > > Fixes: 7c65ae81ea86 ("sched_ext: Don't call put_prev_task_scx() before picking the next task") > Signed-off-by: Tejun Heo > --- > kernel/sched/ext/ext.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c > index 3b2e13bc924b..e75e2fd5ab7e 100644 > --- a/kernel/sched/ext/ext.c > +++ b/kernel/sched/ext/ext.c > @@ -3090,9 +3090,14 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p, > * sched_class, %SCX_OPS_ENQ_LAST must be set. Tell > * ops.enqueue() that @p is the only one available for this cpu, > * which should trigger an explicit follow-up scheduling event. > + * > + * Core scheduling can force this CPU idle while @p stays > + * runnable. @p's cookie then won't match the core's, so skip > + * the warning in that case. > */ > if (next && sched_class_above(&ext_sched_class, next->sched_class)) { > - WARN_ON_ONCE(!(sch->ops.flags & SCX_OPS_ENQ_LAST)); > + WARN_ON_ONCE(sched_cpu_cookie_match(rq, p) && > + !(sch->ops.flags & SCX_OPS_ENQ_LAST)); > do_enqueue_task(rq, p, SCX_ENQ_LAST, -1); > } else { > do_enqueue_task(rq, p, 0, -1); > -- Thx and BRs, Aiqun(Maria) Yu