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 DFEA6145B27 for ; Tue, 9 Jun 2026 05:15:28 +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=1780982130; cv=none; b=TYlGtLLM+vkVUMhkx0mTSFXTWp8TglNIBV8zeo5/1sob44EIiz4M4JPOD02OODar2NA2IB9lvb/he5+Qbh+4Pt/0V2kw/If5brLlmEMcFb5K33MQMH92sxriKkVwoBNTb2+KJ6ACDwQrddtvydx1CFhQ8s3ScJSIfkuH6PztbuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780982130; c=relaxed/simple; bh=Wc6cXkU5ujXqOnJhXbvy4lRmzXxmlU3Ib+14PUZ7+vQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u8F50Kyt3B47MsqKaWqiD/urdF1U7ZU5mLHoyPYZ3RJ6X6ezlUQV230rp8ghff4tVRw20H6FcrDlMWpFK99w6L6YbMkCSyLbZG10ijglqmZMsrjXP0n2wgpYblKsx0MtB0aF1eEUjbgdevvenSVkDWUi2gI/+ZakMxUiWG2qZh0= 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=kGW6w3O1; 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="kGW6w3O1" 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 658Go96X1266651; Tue, 9 Jun 2026 05:15:04 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=5fgV2o WB7mngD7f6nSxH7JdFCsZZgm9Z4pZ6ZrSp5cM=; b=kGW6w3O14LV0fEb5ZmQIzC ftHZMojOKsqz6vWf6va/2EoK/53uowdN0RgbxdgVWwpOlnmfuCZZi1BYEcCoZffe B47NXvgZ1THlq8YWB0V8i7p1cAEoihFPfyf5mYP0kelzcXv/cAJJ8j/FVkowNClR xkVVHG2MbHd2BlREbE15Pa9Y2MX1PmGoik1CLBp4I58Dy1mwgg2SLvU3i8k8AP+B 8e19IaLAx8K7AfhkRuldlnpBj07vA77SrHsDQTiV2hEJMJcR9N+RdaYJNhUABP+U 1zQ3hKufjYotgH9C2V4/LUrBjmLUTZw2VdDtQj1E1cWZGCZ3lqnOI/2XbTbZmV+Q == Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4em9ye2dth-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jun 2026 05:15:03 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 65954b0R029010; Tue, 9 Jun 2026 05:15:02 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4emych0e28-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jun 2026 05:15:02 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6595ExY550987352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Jun 2026 05:14:59 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0415A20040; Tue, 9 Jun 2026 05:14:59 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6EFF20043; Tue, 9 Jun 2026 05:14:51 +0000 (GMT) Received: from [9.39.27.33] (unknown [9.39.27.33]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 9 Jun 2026 05:14:51 +0000 (GMT) Message-ID: Date: Tue, 9 Jun 2026 10:44:50 +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 17/20] sched/core: Introduce default arch handling code for inc/dec preferred CPUs To: Ilya Leoshkevich , linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, yury.norov@gmail.com, kprateek.nayak@amd.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-18-sshegde@linux.ibm.com> <688322d7-660c-4600-a920-6c5f49caa11c@linux.ibm.com> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: <688322d7-660c-4600-a920-6c5f49caa11c@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA5MDA0NCBTYWx0ZWRfX0tfgF28y+BzV nyWza7bVe5j3rvAryq1i8VlR3NPMV1j9mvB1AZBVS2JkTiOWzqc6NatEuq6JIL82SznzSolyekc tK8vxnohvr8C5F+K467PoUcDqlmjW1NhzGtxMtrD6g32+TAPaSeMp4VAjGuAJBEDUnKzaIR+/dB 4AJW007jsb7sI0PHACpcZsKJ9FdwEWqtAKU+3w5IdjeOqV98bIWTGpJtI+2RJPXm+TB3aOSuVuB jY8OOlzdKlrc9/9kkFh/IX6xdkzZtNH8Qzh0f+3m5yvLDJ5XFdgnfdIS01PkL5UT7Dq1pujj4/z ii0nsVN5wu3S3+IwCYpcSh9sBRBoNpvSJT6Naql67uMpEPsolAWhQllPo+O6KsYw9AtwIelm392 CqBN6OPs2Xmy0rX1thV0Rb1b5Ujkcy4gmWKOXE13gTXEcH7RSgZ6jTUSR36MbxRt3geQy2qvDFU SXImy5uMtA+kbClV1+g== X-Authority-Analysis: v=2.4 cv=QKhYgALL c=1 sm=1 tr=0 ts=6a27a158 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=g9bi49HhkKH2uBjlz7wA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: CQMqwNxTj-cR-bBwe29BEVPeHe1GI7Tt X-Proofpoint-ORIG-GUID: CXUFCmQKioX-rh2f0E4TfUnN3t-eAGf4 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-09_01,2026-06-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 impostorscore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606090044 On 6/8/26 9:52 PM, Ilya Leoshkevich wrote: > > >> +#ifndef arch_dec_preferred_cpus >> +void arch_dec_preferred_cpus(struct steal_monitor_t *sm, u64 >> steal_ratio) >> +{ >> +    int last_cpu, tmp_cpu; >> +    int this_cpu = raw_smp_processor_id(); >> + >> +    cpumask_and(sm->tmp_mask, cpu_online_mask, cpu_preferred_mask); >> +    last_cpu = cpumask_last(sm->tmp_mask); >> + >> +    /* >> +     * If the core belongs to the housekeeping CPUs, no action is >> +     * taken. This leaves at least one core preferred always. >> +     * This ensures at least some CPUs are available to run >> +     */ >> +    if (cpumask_equal(cpu_smt_mask(last_cpu), cpu_smt_mask(this_cpu))) >> +        return; >> + >> +    for_each_cpu_and(tmp_cpu, cpu_smt_mask(last_cpu), cpu_online_mask) { >> +        set_cpu_preferred(tmp_cpu, false); >> +        if (tick_nohz_full_cpu(tmp_cpu)) >> +            tick_nohz_dep_set_cpu(tmp_cpu, TICK_DEP_BIT_SCHED); > > Should the opposite be done in arch_inc_preferred_cpus()? No. This is done so that tick gets enabled on nohz_full CPU and push depends on the tick being enabled for fast action. When it is enabled, there is no dependency on tick to spread the task out. It happens via wake-up or load balance. Load balance seems to be quick enough when spreading the task out. > > If not, it would be good to write a comment explaining why; this > asymmetry catches the eye. > Ack. >> +    } >> +} >> +#endif >> +