From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 9849D3F9A0B for ; Mon, 27 Jul 2026 11:04:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785150265; cv=none; b=hrXdW45bruLQ/liRelFm4qk3kqUiuI6di7hZc2F+GSGbXq/03XsMi+gcODHdqc8qqzNHwHkFQOycWaECxkrWJJFcImqeIBbsmbDvoKBwa/I5uzU++MV6fqNVyS90lC0HA7NGM5iKp+wOVUobHXPHT47tbVXIuzTjMVNuBIFCH+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785150265; c=relaxed/simple; bh=/45TPcOfP0z6F31LuHgZ2g7eb6h51H3wFc4DWCgBWIQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GCr1+IfgHFnxwIWprpoWQxn7m0LB+HC4LhHbUQJSG/SW1Qf4C7vU5As0G0I3RbFGVgGkRPwi6wBe14mcz0+IQUBlCxu1RPAJU7rOMcOVK1g5kOzPbJafPNbMlX14z4xDsF8VStwOlk/ytz5P3v3WFK5vvsUeC1u7HX4pVTQ3A3w= 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=RnPANWKb; arc=none smtp.client-ip=148.163.156.1 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="RnPANWKb" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66RAIWsC1956023; Mon, 27 Jul 2026 11:03:54 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=gmdtkj w6AiVL4SgaBLKPo1EH7SMeybBKVIjLN1iIpWA=; b=RnPANWKbu8sT1mr2+eaOdR oBFaevrBLQHizIZ2urqJXY7mBxlSpMufo872hNSUDsG9ydo5z8meyQopxQboj0nX WR3nxQLOtKYeBTABYdOZUZZ6nyvTAV6px4kmoJHFoXbSUQQYTpG2pqi8K4xeaLRg vm16ZQr0tdt9DBEZoFFWR2fJ8g4G1zXaHb/SPNrwmAydD5lrJhCp3FkxdIqBTV0X 2JH3iFIqkci9Mi8Qv4L8c0nvfEzJLlv7MaBbITHMyHK1o9EB7hkY9mDNXHFAzSYY +SuyYqMN+TqEx6WU/TsDpKQFW5As+ilbrUfj8Q2M96V/ZW7BAd3NF7Z6ZKpRIuag == 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 4fmv0xfm7c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jul 2026 11:03:53 +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 66RAuFx5022170; Mon, 27 Jul 2026 11:03:52 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fn7fq57u0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jul 2026 11:03:52 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 66RB3pLo51511584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jul 2026 11:03:51 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 128902004B; Mon, 27 Jul 2026 11:03:51 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD16720040; Mon, 27 Jul 2026 11:03:48 +0000 (GMT) Received: from [9.39.23.10] (unknown [9.39.23.10]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 27 Jul 2026 11:03:48 +0000 (GMT) Message-ID: <0e9c851c-23c6-4394-82b8-755fc581b0d8@linux.ibm.com> Date: Mon, 27 Jul 2026 16:33:47 +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 v4 1/1] powerpc: enable dynamic preemption To: Jirka Hladky Cc: maddy@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, christophe.leroy@csgroup.eu, mpe@ellerman.id.au, npiggin@gmail.com, bigeasy@linutronix.de, will@kernel.org, linux-kernel@vger.kernel.org, "Paul E . McKenney" References: <20250210184334.567383-1-sshegde@linux.ibm.com> <20250210184334.567383-2-sshegde@linux.ibm.com> <85cb5e0e-feb5-4a54-b7b6-a5f6a053dcda@linux.ibm.com> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: 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-GUID: yC4VCmuXTaZo3Iip0fAgxVfG3W_iPsot X-Proofpoint-ORIG-GUID: ZPUk-LyiqKAndU0R_KzUQvTa1HaUEz_7 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI3MDEwNSBTYWx0ZWRfX4/URNBabP6C8 mNRiuTmchsD7gJrP5a54VH+1a2LLfM+gHPx0BX1Gtj982r/5WhrrLKl5o+qYOM9s1LMMna8Hcfv 6YVeTHY4a7g+uirpO7tEjlPjdZvo2NE= X-Authority-Analysis: v=2.4 cv=dYuwG3Xe c=1 sm=1 tr=0 ts=6a673b1a cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=8vJNx2G_DZO0-mzlBnMA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI3MDEwNSBTYWx0ZWRfX/OToFxf3oaNf Womn6635ko7JZr6qBmHnPftg2sMU9kwo9f+gSgeW5Ur1ED3J++rWlowqOO4c3Grzj+B8Ixhyz2K 9qvw11a/ZBidcxtbtjJziLgueSr40lC4PqOruDMn9H6d5lC2sp2uB5LTWyjazBLbs3GSCXJJ1SU gB3Gwbr4aOa0/lfiEHalZ1cq0mA6e4j5NLVy7/VDJHlHFmDaiIB9BRDTJ/mSkmpRrCTLk7uthe0 anWbMnBpaMlVs809pWp8DW4famifYc8C49PbiF/5nqLj24y/b+Mqmd5tsoOLN8TfjI1Q91gJ3ea hDQN4dlB+bv0yduruhlO85bnTpYukeMZXf6FJ7MYUwB/+79p5aVfDoT+d+7sDeGgttTbLiBuwMv bQG7X7qLHeNAgw/5cUDJ8bDJFfh8t4Mpa8vdrm7wApNPGzZ2i+G/HaR46XUD+tfykClUJLP+AIJ XSM4Esm9rbyihn7Wj8g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-27_03,2026-07-24_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 clxscore=1015 phishscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607270105 On 7/27/26 4:29 PM, Jirka Hladky wrote: > On Mon, Jul 27, 2026 at 12:29 PM Shrikanth Hegde wrote: >> That means comparison is between preempt=voluntary vs preempt=lazy. >> >> If you make it full preemption in 6.15 you will likely see similar >> data as 7.1+. Only on 7.0/7.1 there is force switch to lazy/full. >> Can you give that a try? >> >> If it shows same data, that implies the regression is mainly due to >> change of preemption modes, rather than the static key stuff. > > Tested on 7.1 by switching the runtime mode via > /sys/kernel/debug/sched/preempt: > > Mode kill bogo-ops/sec > ---- ----------------- > full 57,476 > lazy 56,892 > Delta ~1% (noise) > What I asked you was to do voluntary vs lazy comparison without CONFIG_PREEMPT_DYNAMIC. > The preemption mode (full vs lazy) makes no difference. The regression > is from CONFIG_PREEMPT_RCU being enabled, not from the choice of > preemption mode. > > And as Christophe pointed out, it's CONFIG_PREEMPT_DYNAMIC that pulls > in CONFIG_PREEMPT_RCU, not CONFIG_PREEMPT_LAZY: > > config PREEMPT_RCU > default y if (PREEMPT || PREEMPT_RT || PREEMPT_DYNAMIC) > > So the chain is: your patch enables HAVE_PREEMPT_DYNAMIC_KEY -> > CONFIG_PREEMPT_DYNAMIC takes effect -> CONFIG_PREEMPT_RCU=y -> > expensive rcu_read_lock/unlock on ppc64le. > >> Plus, it may call schedule in lazy/pull preemption. > > The full vs lazy results above suggest extra scheduling is not a > significant factor here. > >> This seems strange. How come rcu lock/unlock depends on SELinux >> policy? One should call rcu lock/unlock if they are working with >> rcu updated fields. >> >> Does the policy change itself protected with rcu lock/unlock? > > The rcu_read_lock/unlock calls don't depend on SELinux policy -- they > are in the SELinux *code path* itself. SELinux uses RCU to protect > its AVC (Access Vector Cache) lookups. Every call to avc_has_perm() > takes rcu_read_lock() around the avc_lookup() hash table access. > > When you boot with selinux=0, the SELinux LSM hooks are never called, > so the AVC code path (and its rcu_read_lock/unlock pairs) is never > reached. That's why disabling SELinux removes those call sites from > the hot path. > > The call chain is: > sys_kill -> check_kill_permission -> security_task_kill > -> selinux_task_kill -> avc_has_perm > -> rcu_read_lock() > -> avc_lookup() <-- hash table lookup under RCU protection > -> rcu_read_unlock() > > With selinux=0, security_task_kill() is essentially a no-op and none > of the avc/rcu code runs. > > Jirka >