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 BA3231CB31D for ; Thu, 21 May 2026 04:35:03 +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=1779338105; cv=none; b=csx6XfjkrSJGLkMX3dfcCbCWUGhiSsYUMv7M3VfxYCZEZBdXJtvYz09SvzDpN79e70OwYaoSCoP+4y8QwazVejNeOb3eF2TxYELXTYbu8h7ZQT/H6DBJ17Vin0hU+XYVVH+BndRr0G6/6iR2BFHNhTfp1W+rkLHLE8XyamA0n1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779338105; c=relaxed/simple; bh=19IkA/8I1M5ZWuPUuwohHTr3ZB2qSN+04ljgXIgA214=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lcRFruWPpC4/4tB6lYaHh3+IVgvzAJzBII+wnr54JpLLufSuZn3aZotbOfeAw24dkpiMaYfskN6rQ/Vs34vfoXCq2/TZr7iuXGSUPUfKbmj53yamnvsez8810KPTj0Ek2bLCedGBMsWDuEmzTNhscrQHp7vZCLgahSLdrGvvYRY= 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=sjkO8Cm9; 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="sjkO8Cm9" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64L07iO73674550; Thu, 21 May 2026 04:34:53 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=+wlK+e SUAR0kV6HP3RScWciOm0DXzZVJxr1Tp7YuPP0=; b=sjkO8Cm9Q9yrr8dnzyNYZ9 avDtFbZCn6DK2srPN5Txo2HWOaYmxH7z3HiYOejTaatSMsyzKKA1DDG+G7wqr+kN SmabZ24i/XcaHvhWJ7Mz7zjKqjDCqLhYunmevflX7qTCR6G+H9y7Q939DJrkyjke L3+s9/S8d738dexa/tB8ApfsDiLvCQRP+fWVT1vyF7m/A2wLytXozGw9Za4k6Y6b 7CGSjBGPlygmKZr/BfOOWm/VENrSNbR+Q1Nok93m495YBZyT5PAe3LIfmkJKz83L OheWjIEOwLsuILKSwhuidpms3cPbZR5HVZIn1CIQ/xzSEva7Tr4cnCE+Zz459VvA == Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4e6hb8ky69-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 May 2026 04:34:53 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64L4O9D7029558; Thu, 21 May 2026 04:34:52 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4e754gj7gm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 May 2026 04:34:52 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64L4Yode49938800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 May 2026 04:34:50 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 950F12004E; Thu, 21 May 2026 04:34:50 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B8CF920043; Thu, 21 May 2026 04:34:48 +0000 (GMT) Received: from [9.123.5.233] (unknown [9.123.5.233]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 21 May 2026 04:34:48 +0000 (GMT) Message-ID: <0ef61565-dc6c-4281-ad85-ddfff87078a7@linux.ibm.com> Date: Thu, 21 May 2026 10:04: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 V6 00/16] Improve /proc/interrupts further To: Thomas Gleixner , LKML Cc: x86@kernel.org, Michael Kelley , Dmitry Ilvokhin , Radu Rendec , Jan Kiszka , Kieran Bingham , Florian Fainelli , Marc Zyngier References: <20260517194421.705253664@kernel.org> <87wlwyw188.ffs@tglx> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: <87wlwyw188.ffs@tglx> 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-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIxMDAzNiBTYWx0ZWRfX3m9jW8XWPBKq 4GgR9vOk06T90s8ra9wEjhVTX6GX6wMprI+OjkQbFbqkYARBlkDhqw2Y0yzt4uCbeSXoZ75VQNj bgzQbd45yZ38gTBTRUkjVwsF1BMjqaMMqrX2OmtW7VEwrDkZkvH7FcPN+zvSJVl/laZusVtzGia Pt/KU7Vb7W5TdANDlLXRsZusTpUM2hyorhvAq74ARG3dI7RA2ybihH1wwchJVPM92FLXFT07rtU Na1850ow0fEBOLRTXNmc3yebyc+uJKNcgEwh+1pqwrqzY77sXxurK0+ygImJ+UROGs/Dqg24UCB tVdvfMTLWlWIT2RB55ieaFypkKnWK9FwZlnMbeqGSR8JGVC8BC2SYHOQNR/yMHh9EMHA3NUtVQ7 zTp+lzq8gMj5q4DzxNZ24ICHkOfVBckIEtjpytlq78xv6DR4QV9vcQn7lvXy85z0AAYjG4bZ4zv Xvl3d8HEuIVrCJljKAA== X-Proofpoint-GUID: Nf1paqoxIBghBnynt9u5061yr9RyVqTb X-Proofpoint-ORIG-GUID: VVpgqRrRNoGE7Lt-UDi9O4t_J1f8TS61 X-Authority-Analysis: v=2.4 cv=aYBRWxot c=1 sm=1 tr=0 ts=6a0e8b6d cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=sZiQxcs5OQ10ZywIK6UA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-20_03,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 phishscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605210036 Hi Thomas. On 5/20/26 8:57 PM, Thomas Gleixner wrote: > Shrikanth! > > On Wed, May 20 2026 at 02:48, Shrikanth Hegde wrote: >> On 5/18/26 1:31 AM, Thomas Gleixner wrote: >> >> Ran perf stat -r 1000 cat /proc/interrupts > tmp.txt >> and Observed minimal improvement with series. > > Can you redirect it to /dev/null instead to take the file operations out > of the picture? > Yes. Did "perf stat -r 1000 cat /proc/interrupts > /dev/null". It shows better improvement with the series compared to file write. >> Base: >> 1,313,263 cycles:HG # 4.063 GHz ( +- 0.17% ) >> 2,172,511 instructions:HG # 1.65 insn per cycle ( +- 0.05% ) > >> v6 series: >> 1,224,666 cycles:HG # 4.058 GHz ( +- 0.25% ) >> 1,667,435 instructions:HG # 1.36 insn per cycle ( +- 0.08% ) > > Interesting. The number of instructions goes down by 20+%, but at the > same time IPC drops too. > base: Performance counter stats for 'cat /proc/interrupts' (1000 runs): 0.32 msec task-clock:HG # 0.615 CPUs utilized ( +- 0.17% ) 0 context-switches:HG # 0.000 /sec 0 cpu-migrations:HG # 0.000 /sec 44 page-faults:HG # 136.347 K/sec ( +- 0.03% ) 1,310,621 cycles:HG # 4.061 GHz ( +- 0.17% ) 2,182,042 instructions:HG # 1.66 insn per cycle ( +- 0.04% ) 372,189 branches:HG # 1.153 G/sec ( +- 0.04% ) 4,710 branch-misses:HG # 1.27% of all branches ( +- 0.33% ) 0.000525061 +- 0.000000889 seconds time elapsed ( +- 0.17% ) v6: Performance counter stats for 'cat /proc/interrupts' (1000 runs): 0.28 msec task-clock:HG # 0.577 CPUs utilized ( +- 0.25% ) 0 context-switches:HG # 0.000 /sec 0 cpu-migrations:HG # 0.000 /sec 44 page-faults:HG # 155.906 K/sec ( +- 0.03% ) 1,144,964 cycles:HG # 4.057 GHz ( +- 0.24% ) 1,628,375 instructions:HG # 1.42 insn per cycle ( +- 0.07% ) 271,934 branches:HG # 963.546 M/sec ( +- 0.07% ) 4,683 branch-misses:HG # 1.72% of all branches ( +- 0.49% ) 0.00048895 +- 0.00000114 seconds time elapsed ( +- 0.23% ) << 7-8% improvement. v6+ ppc_hack Performance counter stats for 'cat /proc/interrupts' (1000 runs): 0.27 msec task-clock:HG # 0.582 CPUs utilized ( +- 0.15% ) 0 context-switches:HG # 0.000 /sec 0 cpu-migrations:HG # 0.000 /sec 44 page-faults:HG # 160.232 K/sec ( +- 0.03% ) 1,113,983 cycles:HG # 4.057 GHz ( +- 0.15% ) 1,501,868 instructions:HG # 1.35 insn per cycle ( +- 0.07% ) 251,432 branches:HG # 915.627 M/sec ( +- 0.06% ) 4,528 branch-misses:HG # 1.80% of all branches ( +- 0.18% ) 0.000472057 +- 0.000000668 seconds time elapsed ( +- 0.14% ) << only slightly better. >> Looking at powerpc arch_show_interrupts, >> It could use the similar set of optimizations. >> - move to array based >> - use irq_proc_emit_counts >> - some interrupts such as machine check, is hardly set. set skip_vector. >> >> >> Copilot suggested below diff to quickly try irq_proc_emit_counts integration. >> It showed little gains compared to v6. So it maybe worth fixing that in the >> right way. (similar to x86 stuff you have done) >> >> Performance counter stats for 'cat /proc/interrupts' (1000 runs): >> >> 0.29 msec task-clock:HG # 0.586 CPUs utilized ( +- 0.22% ) >> 0 context-switches:HG # 0.000 /sec >> 0 cpu-migrations:HG # 0.000 /sec >> 44 page-faults:HG # 153.067 K/sec ( +- 0.03% ) >> 1,166,567 cycles:HG # 4.058 GHz ( +- 0.22% ) >> 1,475,365 instructions:HG # 1.26 insn per cycle ( +- 0.09% ) >> 249,051 branches:HG # 866.397 M/sec ( +- 0.10% ) >> 5,104 branch-misses:HG # 2.05% of all branches ( +- 0.33% ) >> >> 0.000490211 +- 0.000000992 seconds time elapsed ( +- 0.20% ) <<< 3-4% improvements. > > Again IPC drops .... Yes. IPC dropping is consistent. I see the same trend in (PATCH 1/16) in the series. Copying that snippet below. Before: 8,932,242 instructions # 1.66 insn per cycle ( +- 0.34% ) After: 7,020,982 instructions # 1.30 insn per cycle ( +- 0.52% ) So it might be common pattern across archs. Maybe perf stat subsystem is slow enough it doesn't shows the aboslute benefit. In addition, I ran "perf stat -a -r 1000 cat /proc/interrupts > /dev/null" It is now 10x slower. IPC is same with series And improvement vanishes. So heavier the infra testing it, gains are getting minimal i guess. But i don't see any regression. As you said in the cover-letter, the micro loops you ran maybe the best way to evaluate it. If you have the code in shareable form, I can give it a try. Other than that, code improvement looks good to me.