Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp129798rbe; Wed, 28 Feb 2024 14:45:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVvOJr5q2NvIJHWBRmAFtcOjgKvanGCfvQPfpjvdNA0H7bI3K97QppNcQksJKUrjiMq5yPUY+MEh8Q6cSbSACl8yZn8sSnqbOum6nu2QA== X-Google-Smtp-Source: AGHT+IHbHeDFskKo5Qkk6CddG9A4us/Wzg6Z0ugKeEZchoQCqwXrjkfGJ6QLCIXfunIpeqhh4w3a X-Received: by 2002:a17:907:118d:b0:a3e:5726:c12 with SMTP id uz13-20020a170907118d00b00a3e57260c12mr194531ejb.37.1709160327545; Wed, 28 Feb 2024 14:45:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709160327; cv=pass; d=google.com; s=arc-20160816; b=hez52DIQkRYmIrJ9xiOWGzLuJHlrM6S0wgv07X5kcEPbN1HpXkl7fbe6pXRqSdDGM6 oS1Sc/7UJr6WwKcF8DhYlGi3RGwwMhog7DTqJKDAxtiyIqYihlUGFFbmIrPYrrBkJZVw a2AvX3H0xpdTYOgmMiMFLW55oEJobXMg3XU1gBi/2o5n6rVUNxe9w9xDhIgxqL7JTO5K 73QhMBt8zrMhYbJyQ9Tnr/LtuX76spmottPyZ+0MnPf2Gtc0hSv/WiJB3c0RcjrVuI3r 6pmzB2uDnnRDWZQicLC0XI04MPPoJe7gOtG/AZL06848LMYNCk8fJfZn2xZkFVEth4g0 FZ5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=d+Wb6NhI/vtCiU6t546gnwmXs9J3vtrwxtAXa2CAncw=; fh=7v1oNu9RvDsCktnBeIlcN4zPDk95RLTX4T5J6009I8Y=; b=D7WDnu5KFsnLimPGGlhkSolkaMYsIvDVIVXgu4561lB7kJ3JH5rCZpBS2bd6TB6rja VwBbWvc72b8yKYFBeS0/nXGsleqEOSOrJ6u3oovjxJjcQ7rg43a8z5LNOCoWrwx2xEO+ rZeZdZuF+Mpgq7sAJIgvGKtpDKjNGHpXuWqlGqz4vjA9QvspGvY8tPKGhcrJJhEEE/nx 3aJu1eHCGduuHY/AAaTR1ke0FIz+nwIVavFEjIi/1OaAFqEUQG+3/mZt6NbTEruQcAyC 2LZ3lRjL0DpjIa9G/qwig75uLLCdzls3tdkz6dySbMSjY5nIhblQMGrhww5lWPwL4Nrl NEoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ahRXfpxD; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-85796-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qa42-20020a17090786aa00b00a4418bb117dsi573184ejc.144.2024.02.28.14.45.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 14:45:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85796-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ahRXfpxD; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-85796-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85796-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 51C071F23F31 for ; Wed, 28 Feb 2024 22:45:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7A4B7291A; Wed, 28 Feb 2024 22:45:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ahRXfpxD" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 77C6B72900 for ; Wed, 28 Feb 2024 22:45:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709160311; cv=none; b=U8aqE3VT+n7UM95ifnabgKqYcK4xb7ugkl+BLsTDqkJkCLcQRYlxBHDFoakBoqULECUUOL3z6gowr0k7hvT6f3RxERxWAZyMIBDhHIQOhgegZYYidwDBh/KEKcHJ1vEGMprNEGwRNQRUOfDkyDvOQFkVZ7aExyANhdpWkUT5WRI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709160311; c=relaxed/simple; bh=g7xQFQu3lLzNX4Vd9so5KMCqq2700AsVTNNzgICe2Nw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hPitzVggTp8v0U4ENkJQM9mfATqB9iz8UqiMMjJ7DiYt7wjVPa8ptIFz7W+QlL0duH3bjU80HwgJD5YdnmNhgRd0itcfrSxY24/ELdyDQm5zkVwhsUOyOLoIdebk/ub93JviLXN5vMNJRYfTwXquYQh+mQgRvPczKhBwt3Pn3oA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ahRXfpxD; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a34c5ca2537so53705866b.0 for ; Wed, 28 Feb 2024 14:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709160306; x=1709765106; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=d+Wb6NhI/vtCiU6t546gnwmXs9J3vtrwxtAXa2CAncw=; b=ahRXfpxD37Mog6Bs62vWDRtZsgkWmlQ50nobBOZEN7/TPYGqb/00qV0YLfPJR7FyQN wlvRbVKdiyQM0Atl3/3QDbu4njF6PGqVopo96XFd9JLSjlNHaz/eASjtdVMMU4wvvxJa KM1bRBZ2rJNNADncjMHerPmvDtlDOayNIlZ8A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709160306; x=1709765106; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d+Wb6NhI/vtCiU6t546gnwmXs9J3vtrwxtAXa2CAncw=; b=WdtTQcAupAbS+5Za+EjQAAezB5FmjVRSYKRDsK16dWvv3k7I2rpOtoKvJu4mZcFsXS lNlS0ZuycpFf2IfBIJyBQbF7sfltOBLcaLKJzMVtAqSSt2R4ApTRZf1ueAh/ine5CbgH JhI4TSAGYNdqSAOGBqp7rLlmakT6fz2pOJW7ezAIsEm0SttW1f1tTKSgAq7fR34pb254 rHcOkyV6ya/EqoOhyOx1JKnZFAD69ObAdhC49c7B5CHEAFDG/8qM14W0jkQLwobgK0QQ kWPb5N9nIFFlwCNEvsTOADNweVdo6jwFxrGIK0/ol4b1EDQBB2TMQ0O1kK4yVRlqRHVj S+CA== X-Forwarded-Encrypted: i=1; AJvYcCVGNWntwIyWg5T4IXFUk1VFYDmmGNt0etahVWvwjCO7J74T9bJ/SzaEiGoWkMdNMgMgZPVD1JN477vZu2OSknD09n47eOtSlHD14h3A X-Gm-Message-State: AOJu0Yw4QDAutRgPHpK+qHj+xqhVzji4RFfafyVef4bZOa48FlN2QddI uCmRUKrJ3Co0sWG/ehO9poadQ3SgJmgHczHJcnFDT2NG4BU1LWrj27Q4wdGwjCyIkWXVUzLfg8/ cZ/Tn X-Received: by 2002:a17:906:face:b0:a43:734e:db47 with SMTP id lu14-20020a170906face00b00a43734edb47mr187728ejb.20.1709160306707; Wed, 28 Feb 2024 14:45:06 -0800 (PST) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com. [209.85.208.52]) by smtp.gmail.com with ESMTPSA id cu16-20020a170906ba9000b00a43aa6e3f4bsm2166946ejd.44.2024.02.28.14.45.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Feb 2024 14:45:06 -0800 (PST) Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5654ef0c61fso4871a12.0 for ; Wed, 28 Feb 2024 14:45:06 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW5cB9kpm9AaBXGUhLqDO13HyPB5q+r0lYnwCQzQ1AlXC5dm3pE6img0M3I6Q6hb5y7QXWF2U+anBpzYcZY5lJFFTPRc3pSSpEZwAYR X-Received: by 2002:a50:8aca:0:b0:561:a93:49af with SMTP id k10-20020a508aca000000b005610a9349afmr11944edk.7.1709160305919; Wed, 28 Feb 2024 14:45:05 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240228072216.95130-1-yaoma@linux.alibaba.com> <20240228072216.95130-4-yaoma@linux.alibaba.com> In-Reply-To: <20240228072216.95130-4-yaoma@linux.alibaba.com> From: Doug Anderson Date: Wed, 28 Feb 2024 14:44:50 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHv11 3/4] genirq: Avoid summation loops for /proc/interrupts To: Bitao Hu Cc: tglx@linutronix.de, liusong@linux.alibaba.com, akpm@linux-foundation.org, pmladek@suse.com, kernelfans@gmail.com, deller@gmx.de, npiggin@gmail.com, tsbogend@alpha.franken.de, James.Bottomley@hansenpartnership.com, jan.kiszka@siemens.com, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Tue, Feb 27, 2024 at 11:22=E2=80=AFPM Bitao Hu = wrote: > > show_interrupts() unconditionally accumulates the per CPU interrupt > statistics to determine whether an interrupt was ever raised. > > This can be avoided for all interrupts which are not strictly per CPU > and not of type NMI because those interrupts provide already an > accumulated counter. The required logic is already implemented in > kstat_irqs(). > > Split the inner access logic out of kstat_irqs() and use it for > kstat_irqs() and show_interrupts() to avoid the accumulation loop > when possible. > > Originally-by: Thomas Gleixner > Signed-off-by: Bitao Hu > Reviewed-by: Liu Song > --- > kernel/irq/internals.h | 2 ++ > kernel/irq/irqdesc.c | 16 +++++++++++----- > kernel/irq/proc.c | 6 ++---- > 3 files changed, 15 insertions(+), 9 deletions(-) Reviewed-by: Douglas Anderson