Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1993637lqo; Mon, 13 May 2024 05:06:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+kaPs6VAJjWyGgxhe3uUIz70pt3mIK0xKQDoTYJAHHJ1wOj2WXI1WuA/jydyyebEfTSuFTdk48KjjyLBGyBQDKEyJ4tmcMelkbqUepQ== X-Google-Smtp-Source: AGHT+IHs9cqQJFoy5kh97EoRsAqcjwgJoSrDhbSnVNUYtSmgUoJpdcSuVy55DrUYsji5aiZMEMBs X-Received: by 2002:a05:6a00:14d1:b0:6f4:8486:75a0 with SMTP id d2e1a72fcca58-6f4e03af284mr10964438b3a.31.1715602000239; Mon, 13 May 2024 05:06:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715602000; cv=pass; d=google.com; s=arc-20160816; b=FG3zJG4SUZK6CtF7tELNjtWARIlNcJgS/IJMdB1HzwZspB53ESTUmM2cOuWkIEavTn XvhFTiSePWfT+QX0AzeskvQJAHpLcZzav476trxuea0Ttfyjpg5bFq7iLapVkDpvlWDp QQDA6RQa+64I/x8fGYDZcgIE9lc02pSzMDWAtvS2ykK/dsD/wxZYdt+1n3nUP2BmU5VQ IP4LmTlCNpbTiJ5kKly5dRqwRmzQ7IBKtU61vVwthqq5cy1gVYtXuszG4HwMJW9jOZ6Q p4pEPW8i3QYydsh80JrwhD8ed9Qoaja263xdG9tqaW9UXsA+bsKYAvk+jK1xcGuSYmdb B+dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=nzzkXIpspGxlK9arGRKGa5KvjuMpX98o0VZp6Fx/3xo=; fh=JZGlwVk/fNosmaA2fNnpI2mLXLMDRyuUNdWPGzj/woA=; b=bTF46A4JDJVEcDep71QBCwTAkgB87b4tVsgUSrN9upBn6f4PuSK+8g4V6JGS5WlYxo kFtVj7KPSlDHohZfLryHHkfkMbD07gnMMQ6hH9whIfzDC8BLj12HrkF2ZPBGMHx70Z+4 fnasPnAwKnfhRuDxwazMbEZuBnSCagZZHWPSUFyKLBPToHeoc2RKTJzUAFq06Of8pKJX /WF6QVdAculOJ1pkyezj6RFYukj/F6HIbdPCy28xlcpFaIpADWuCTxbSbZzlNWMQjozc Ruun8xGR7qVQXcRdtbaNU0Wzy8349366PATsDL0276WJ3/Jw2D48jKqO6uUumZR0HzOG VvJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fFcNCDDR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-177539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2a724edsi8796771b3a.36.2024.05.13.05.06.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 05:06:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fFcNCDDR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-177539-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 23237281B51 for ; Mon, 13 May 2024 12:06:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43ED314F11D; Mon, 13 May 2024 12:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fFcNCDDR" Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F9E914B097; Mon, 13 May 2024 12:06:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715601990; cv=none; b=ByNx6eiG9PSU+jRFMsl5tylLoQIH4pqot7j0RMFNR8y7WhStRAaiEbroycmg2AqptHuF7xBXjHV7oBMq+RZAEyIr590wF3xDJefMQiLLKVDa6mQMnmsLtgRPEqxIwBuupfqyAWsl34gARwdougLUadm3M5n8jPbGELZADLvik80= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715601990; c=relaxed/simple; bh=PlS+KhBbiQSxy8kciTdJ82XjeOSaREimicSvft5VoD8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=a1ecP8fxpPMznTNIexgOguDkncWVDTj/Utsgh/6hpXonikdB3QLQoj8T02nOraC5KU0toPmNosOrpv5qSunyEWVZJu16yVqAgqDIi0UDj4gktiaY1mOBMmQcpiuW1Z148RBPDdsZ20r/WSOALltAEvADQcDMEvL6U/1vxeHI/lA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fFcNCDDR; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6f4e59191a1so2062470b3a.1; Mon, 13 May 2024 05:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715601988; x=1716206788; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nzzkXIpspGxlK9arGRKGa5KvjuMpX98o0VZp6Fx/3xo=; b=fFcNCDDRe1Lr1cn7Hg02A0nSDKAaYDl4Taf5ziUL1fx0689n5K8zZnsju6JLu2S1TY DILDVomQx25g8guXR4LsHPG70NnyRKHkOjAC1UMuDDdcmapUSKdRsXWta+0rzsC4ONg5 RACbtR24kxJVxb29XbUShkcDLKx0gE5rtcLUChKXAIh/qmQvqXjlUzePNQc3ae5qyhlI 5UMQn86edJW5aiimNHheJABbR+aNP5E5Q7KHXVB4k6URVjQJV3jWCNrazZOyKWf40Q2T 9tE6HHnNuWaUtXoMS/ylAR9QDdrXA1Z9/tQqTSQgXPVy6/HEcG5XLY5GIGomwhvadcIx YS4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715601988; x=1716206788; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nzzkXIpspGxlK9arGRKGa5KvjuMpX98o0VZp6Fx/3xo=; b=VVb08ClTx+t+YlVG+QE5/K6Dpvj5/3Zgh1bGo3HxKbgsPMmXq96vaJFvswvHUtpbnk +gELn9leuOUdVJYxxFTm4rQjQAhMOHg2FRzF4nBqhb6kpeUzMQb1CBvSeOFdfPoNLbLP 6Vq5LWA6g5CHqsHX+0SBvl0fLBzzAP3CRK00Z25DZanAtHMtvKAAq5B3hteX2wigDTKe klmEWzrh4bs4SuITN8ZzvS+RYLSEBStwq4pOxvYt819Bl1j886CRnlXUEvSmfayNUib+ wvs3iVJ+em/jx8TMv+VIOZF/Ayvy/VyVKxseLpdKpNPJplgsqruetq8u3PrETeTcHGsl cnpw== X-Forwarded-Encrypted: i=1; AJvYcCV5mhJ3ZHht3EfTv0ZQQ/5jHZzJc+GxMAnCMoXxLQpXkI2qEwXNNN1YmFG1Wjaf6wfH4ogb9TDWEohUf+JCGQXyvxMGq2IzT9fHZ/iXqg== X-Gm-Message-State: AOJu0YwA55ztJQq1ftMtAu6jGOqGxQtKtjBWSIaOG+FOSKD+SkYkFzg9 z1eCdKYxm7P0URjEIeUDC1zygbSnnNeRct/DweowKDv6IH8asX166Pz4dAhv X-Received: by 2002:a05:6a20:748f:b0:1ac:d96a:4fd6 with SMTP id adf61e73a8af0-1afde0d54b7mr10078265637.23.1715601988481; Mon, 13 May 2024 05:06:28 -0700 (PDT) Received: from AHUANG12-3ZHH9X.lenovo.com (220-143-204-48.dynamic-ip.hinet.net. [220.143.204.48]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2af2b1esm7446131b3a.171.2024.05.13.05.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 05:06:28 -0700 (PDT) From: Adrian Huang X-Google-Original-From: Adrian Huang To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jiwei Sun , Adrian Huang Subject: [PATCH 0/2] genirq/proc: Speed up show_interrupts() Date: Mon, 13 May 2024 20:05:46 +0800 Message-Id: <20240513120548.14046-1-ahuang12@lenovo.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since there are irq number allocation holes, we can jump over those holes in order to speed up show_interrupts(). In addition, the percpu kstat_irqs access logic can be refined. System Configuration ==================== * 2-socket server with 488 cores (HT-enabled). * The last allocated irq is 508. * nr_irqs = 8360. The following is from dmesg. NR_IRQS: 524544, nr_irqs: 8360, preallocated irqs: 16 The biggest hole: 7852 iterations (8360 - 509 + 1) are not necessary. Test Result =========== * The following result is the average execution time of ten-time measurements about `time cat /proc/interrupts`. no patch (ms) patched (ms) saved ------------- ------------ ------- 52.4 47.3 9.7% Adrian Huang (2): genirq/proc: Try to jump over the unallocated irq hole whenever possible genirq/proc: Refine percpu kstat_irqs access logic fs/proc/interrupts.c | 6 ++++++ kernel/irq/proc.c | 26 ++++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) -- 2.25.1