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 45560318ED7 for ; Thu, 21 May 2026 14:49: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=1779374944; cv=none; b=JZMtt57YlhwvWuk5KwHULrhmK6iIL6qG4uTnMLVcl5yfFVjqfnx7bMmR7Hu/IFUGnWKIPlMdOy4Bv//hKkJzQij7i1w4u9v+HBc2RugkHgPd02KwWlkRM7sbJmxKVhnHHXgrFRR6Tg9mtQT3NzaLZfAHB6FVcxhJAa59K2RCUZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779374944; c=relaxed/simple; bh=SAFBXR18dLwCApkmULkAp079FwcPOFLh/xxINvjtDDY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sfIubiKXURihS1SJMYXFlFtxTXDno5lHLRzNupV1I2qlLM2ZoLx7WsjjFY5PlUhpFU/UniKaXRcjeNC5JGSlxDAr0VSF6S+tAI7C+7byEKFiNEYduiQ/fQNoSZ7clZRqTzm/+F95bHdsz0nvocN8fkiP8f2DUNnx0bRRhhBLv20= 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=CurzhfOd; 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="CurzhfOd" 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 64L5e8L9509192; Thu, 21 May 2026 14:48: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=0bK/RD E+GqeJT+F4fAg6uXLKWk/Zhx+sHriDm/jrdtg=; b=CurzhfOd5oRsRez1G4xg6U gzMe2ArPOt0tIgLDNA8ndo3AK4gbJy13EeSDRtQ6QSyI3ojDNYkr23kpiKXVqJAF Tfi/96uceUqVC6ZlhYiivC71Ku5Ojp2gfsPx1ZIbK69DaT3GmOtNXY2gOkWrOZJY laDpkc2X1IYXh4Dlg3HneiB/3c5qJm3+O5zBO8rz1tO7cB8RF7J3CMZPp+QGDbSa Dq53GxytCQXKwdaIw/zygH6aHCfChycVQ/OwOuDxUi5gxBRIgqG38PgQoQ50jy0i BnlwxyGN2r3U/jrWztBF95xp/cZXoJinfJGQkInEngl5/Qnd0V+MbIhIMSUovLyg == 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 4e6h88pajn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 May 2026 14:48:52 +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 64LEd4MR016979; Thu, 21 May 2026 14:48:52 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4e74dhvkrp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 May 2026 14:48:52 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64LEmouH12059034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 May 2026 14:48:50 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4748320043; Thu, 21 May 2026 14:48:50 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ABC1620040; Thu, 21 May 2026 14:48:47 +0000 (GMT) Received: from [9.39.16.234] (unknown [9.39.16.234]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 21 May 2026 14:48:47 +0000 (GMT) Message-ID: Date: Thu, 21 May 2026 20:18:46 +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> <0ef61565-dc6c-4281-ad85-ddfff87078a7@linux.ibm.com> <87jysxw65f.ffs@tglx> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: <87jysxw65f.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-ORIG-GUID: qPbAIn7lCKMiMmXkRKTa86hB1qxnCe8o X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIxMDE0NyBTYWx0ZWRfX75/khCekw8vp 1jd72KZwEEEMrp3RZcBJATPpuqvxoJLjyYr6nNRh854sGiKLYo38bKg3HJE2aeAIcMUyk7csl/M 7HcqP/I0pp1XAmmiabf6VRTu5w1BpCubLqd0/zY0+WrP4OXTWckSZKzPeD0aKq2M6e9MlBqvAZy SMsu+gxbSuRztBRe9DyJRXOgGsOAcebWQ0lE9HktaXfgjm7CedDzIJfyEnL0d3TWcpD6z8izJz0 4ey3mrya/IhHIlXi0gop8Ug0SdPgiHTT0AKY2yNBVACQYMgnX5dSBLj5yn8LEln53wHlVdp+zpN YmZEGcKa8vGHVL+XrMrEE16FOhlonL8HKGlyd6vqvRJSEP17AB8FepYu2jXJH2EjvntiOT4C8pm WZWfjlPVlS9T7I6kYSLqRQwxYyiaqV/XIja2E7kiZFqc4nY07fRmr5UJHKIF5WnGRYP51cB+1zU pYgVLPIaiz6FE0+pMDQ== X-Proofpoint-GUID: 7n_8V3htA6l_TWLVMdnK1ynBglM6vr6U X-Authority-Analysis: v=2.4 cv=apyCzyZV c=1 sm=1 tr=0 ts=6a0f1b55 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=aqs93ntRKBjx40jejYIA: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-21_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 phishscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605210147 On 5/21/26 1:23 PM, Thomas Gleixner wrote: >>> Shrikanth! > > On Thu, May 21 2026 at 10:04, Shrikanth Hegde wrote: >> On 5/20/26 8:57 PM, Thomas Gleixner wrote: >>> 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. > > Unsurprisingly :) > >>>> 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. > > The problem is that the overhead of starting and tearing down 'cat' is > accounted as well. That's constant, obviously. > > But for the use cases like irqbalanced or similar things, there is no > startup/teardown cost involved. The process is up and running and they > care about the actual read performance. > true. > It's clearly to observe by comparing the perf data with the read loop > timing data: > > Base line v6 > Perf 3072.21 us 1564.40 us > Loop 1310.36 us 209.90 us > > It doesn't add up completely, but the trend is there. And you can trick > perf to reveal the startup/teardown overhead it by comparing: > > perf stat -r 1000 head -q -c -0 /proc/interrupts >/dev/null > perf stat -r 1000 head -q -c 0 /proc/interrupts >/dev/null > Tried it, but doesn't affect much. >> 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. > > As often :) > >> 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. > > See below. I thought I would come around some day to actually use perf > directly in the test program, but that never happened due to > -ENOTIME. > > Thanks, > > tglx > --- > #include > #include > #include > #include > #include > > static char buf[1024*1024]; > > #define NSECS_PER_SEC (1000L * 1000L * 1000L) > > #define LOOPS 1000 > > static float td[LOOPS]; > > int main(int argc, char *argv[]) > { > int fd = open("/proc/interrupts", O_RDONLY); > long tsum = 0, rs = 0; > > for (int i = 0; i < LOOPS; i++) { > long r; > > do { > r = read(fd, buf, sizeof(buf)); > } while (r); > lseek(fd, 0, 0); > } > > for (int i = 0; i < LOOPS; i++) { > struct timespec t0, t1; > unsigned long delta; > long r; > > clock_gettime(CLOCK_MONOTONIC, &t0); > do { > r = read(fd, buf, sizeof(buf)); > rs += r; > } while (r); > clock_gettime(CLOCK_MONOTONIC, &t1); > > delta = t1.tv_nsec + t1.tv_sec * NSECS_PER_SEC; > delta -= t0.tv_nsec + t0.tv_sec * NSECS_PER_SEC; > tsum += delta; > td[i] = delta * 1.0; > > lseek(fd, 0, 0); > } > > float mean = tsum / LOOPS; > float calc = 0; > > for (int i = 0; i < LOOPS; i++) { > float tmp = td[i] - mean; > > calc += tmp * tmp; > } > > calc /= LOOPS; > > float std = sqrt(calc * 1.0); > > printf("%lu %lu %5.3f\n", tsum / LOOPS, rs / LOOPS, (std / mean) * 100.0); > return 0; > } This shows real benefits indeed. base v6 v6+ppc_hack 101us 65us 57us So doing a proper powerpc fix indeed would make sense. I think it is going to be similar. Let me go and read your series again. For the genirq bits of the series, consider the tag if applicable Tested-by: Shrikanth Hegde