From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 2D65D13B293 for ; Thu, 4 Jun 2026 12:16:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780575406; cv=none; b=kyKjy+n0C/C+CEXH341KgKTVWLQ7lS6lhU5k6S1P0kplPFVXoqHDrUc3XptpIA2NBtjP54OK9kbam/yUEpxQWzLN9AnTff0t16vQpnuTFVCEqY53n7BeavH24H32ApkRHYYVsPPf/7ZaO71yAJOMkRN7mvfMVAYQ0ayikBoibRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780575406; c=relaxed/simple; bh=uPRnzcRs4aNVpwkxBkxZWxE3xB3Knl9EqUKvXN3Myyg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lkdBeeWEJ4zMOA8XOFe4v7bqmpOYzTWaZ05hPmwmBY3Y2sv1S8btewE+EZTNoMcIgItm8MBVSmITkwfD8tdUFspoJwP/yB5kYUdVcMb6n3xvLvkKCnfE1GYMAYuik45aPe4n9JxMPTGYtveZUVvOCpNoa/0C4iKmmkf8cdTS2g8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=H3Ma2VLi; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="H3Ma2VLi" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6549rNM82190646; Thu, 4 Jun 2026 12:16:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=buRzqT g/jaVe4eigDSROwehHqRc2zbuP8JYTwQpRgf0=; b=H3Ma2VLi5gAGvBWYgHU6Az TMPgVZWS8VTjSuwLTQtOAgF4nVU0jat2NlLQ7r/J4kxnpHQUjnYg9168r6q+SxCn OX7IHsNZg1SDz9CavismIeMrlk5hf/KsnHNEFS7uKPguESdixoWt9k/IGBs9qLNn tdzlb7+B3uLW9lCaVQsEUtaQ1/NXYmdpohZykzPt3tlINliYR2oCROmo1A8c94Jg gnJPw5kW7FqGTxaa8KyFjp4f7jGTX44q4SOlAonpDrwwT6V8VdzM7T/FvKonXmw1 VJWTI8RoBBrBGHYeGZXaaDfYFjilXUlLYLOVwN2D0MNySxjohQWA6f+Pa85BqnGw == Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4efpaef3jq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Jun 2026 12:16:20 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 654C94Kk022504; Thu, 4 Jun 2026 12:16:19 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4ega7qn4dt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Jun 2026 12:16:19 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 654CGGLD54133166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Jun 2026 12:16:16 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 18DEF20043; Thu, 4 Jun 2026 12:16:16 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B3D920040; Thu, 4 Jun 2026 12:16:09 +0000 (GMT) Received: from [9.123.5.233] (unknown [9.123.5.233]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 4 Jun 2026 12:16:09 +0000 (GMT) Message-ID: <045567d1-10d6-428e-ab01-bbef6a59af17@linux.ibm.com> Date: Thu, 4 Jun 2026 17:46:08 +0530 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 11/20] sched/core: Push current task from non preferred CPU To: K Prateek Nayak , linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, yury.norov@gmail.com, iii@linux.ibm.com Cc: tglx@kernel.org, gregkh@linuxfoundation.org, pbonzini@redhat.com, seanjc@google.com, vschneid@redhat.com, huschle@linux.ibm.com, rostedt@goodmis.org, dietmar.eggemann@arm.com, mgorman@suse.de, bsegall@google.com, maddy@linux.ibm.com, srikar@linux.ibm.com, hdanton@sina.com, chleroy@kernel.org, vineeth@bitbyteword.org, frederic@kernel.org, arighi@nvidia.com, pauld@redhat.com, christian.loehle@arm.com, tj@kernel.org, tommaso.cucinotta@gmail.com, maz@kernel.org, rafael@kernel.org References: <20260514152204.481115-1-sshegde@linux.ibm.com> <20260514152204.481115-12-sshegde@linux.ibm.com> <83032c54-0cdf-429c-bcff-bba4e5b2002b@amd.com> From: Shrikanth Hegde Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=Zt3d7d7G c=1 sm=1 tr=0 ts=6a216c95 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=82ZOIwrRETN4uWtctikA:9 a=QEXdDO2ut3YA:10 a=ZXulRonScM0A:10 X-Proofpoint-GUID: jt3LHUC6p9edTcPYKDXLWDusHpsyq-Og X-Proofpoint-ORIG-GUID: 84d9Odr_ivEXprxbgurO4cvuSG-4dAJW X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA0MDExOCBTYWx0ZWRfX5TrpB0snNC2U q4pbIlGk2qCzCumIIqI27tSvJHEf0pi2KVz2HUVho6EupT3qtEIyDddy5hg+qWcHf4CIHLNkMVo qfEESLhu2cioQpqjNDJAQbtKRYBiUTkK6Psbzcs0dT/y9gYAlosTuvaz6kntaPSWTAdWL13kDUm Xh8pbNriBq7FJMGPguHCyDfNYe7gaHYN8zwFUQM3Ukf/xVfOKQecnTfv0a0wyezTq/xSBQ4oHsx FEAUJceJj1Iva3QbxP0NU4Ih7s9wTcubMUWN7Sxq+ih7dgbEq8miTV+pd3wHE3eQbLRAqfLy+jM skIUMKZn7lYfSJHVUjDjHzvhGXkVw9LaU8DxilXKwQjHI8Trcc42ud+Wh4R+W3Nz8lGasDxtjw9 AearooHhw4ME9mEUqD5FHweM1+H7a7Kz/oMw5JoVoMsOBgKTcfHrFCu171RBn6dP0/rk/Mqn2oS AOxWWq0ZMhhmS/Uqh1g== 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-04_03,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 phishscore=0 spamscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606040118 Hi Prateek, On 6/4/26 3:26 PM, K Prateek Nayak wrote: > Hello Shrikanth, >>> Can we set some local indicator in sched_tick() within the rq_lock() section >>> to then schedule the stopper once we drop the rq_lock there? That way we >>> don't have to grab the rq_lock thrice in the worst case scenario where we >>> have to schedule the stopper. >> >> I didn't get you. can you explain? how are we grabbing rq_lock thrice? > > Once to set the "rq->push_task_work_done" indicator, another time to > wake up the stopper thread, and then again in sched_tick() after we > return from sched_push_current_non_preferred_cpu(). IIUC stop_one_cpu_nowait expects be called with rq lock released. So it can't be called in sched_tick with lock held. I think it maybe okay for push_task_work_done to be done without holding rq_lock. It might work since irq are disabled. But it is good idea to hold the lock when changing anything in rq. Right?