Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1998214rbb; Tue, 27 Feb 2024 07:39:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVdZE+qm+4ep1bV2Y7ZV2xOgE/Prv/+BDPU7iYu3hBT6rhvgoF1voSgI7yGBDpTtVynS3gOgNztUrjnzGvqAcWNjNZZXYZ37nCbkp5naw== X-Google-Smtp-Source: AGHT+IHoW6+rkgKZZ/HOXhv+G/To1FaXkBZJYrIv7/d1GoL3Bxv6rKxA6ZBexIxRJwmTEtuvmu1l X-Received: by 2002:a05:6402:1ca4:b0:565:a7d1:ab08 with SMTP id cz4-20020a0564021ca400b00565a7d1ab08mr6082164edb.18.1709048391436; Tue, 27 Feb 2024 07:39:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709048391; cv=pass; d=google.com; s=arc-20160816; b=qRyOJUChzbQ3na5b8PC5uJQXJm7kb1VT+TnCxUcG0J3BvKjYT6yLFT1uXxsPv3BlsF TkBPUjNYA4CHnOZakru2xyGNsdmXYjBezaXoFNPbX52LKz1zXb/dbkActQ6Bl7/7zw96 L8p66Y61iuo64WNo2vIKnajVOCc0lRxnl1ZtUhZsmIFyNyixyjfhVowBeEqXCZt1K8YP /Ap5PCGNwxlBGkNezwixupP81DdhspAA3lD40Vx8p51lHm0D4X9p7ujQN79s9V+tbKkh QOkts+0nv5QZINxdvVNSKEvI93YbK0C6y9lvCDT6hua0Px4nMdiw7pnxcOnaO/ww6Wxv Em0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=cJMEmPknjHVafP7auP6NstYIZApeLwl7NpSBBPTsJRw=; fh=NYAHGX1xy3NLHmpyhmpEOtNqDmqhyFBANwbCgCCT6Q8=; b=QmTHv08sVRSQN6g5iWIyltFJk3zsNI2sz0DBzMu1CSKujIQaSbgAQDMJmUdZjQC0Ne Ke7vRKYRIwt/7mEWz5DW/ynbg4jFbIXS39tMzKiN3bGGsykZQ8IITXYKICEsGHk+pCaA WvC1o71YQLmi4d93+0SgDxicweazjOhtqejRYUeRJAEBVKPbogPUlowOceRhtS8piuI6 7g/t1d1KPy1/+Fn2KIRZ+lt4s+Bw1ZEWF9ziRFvZFIPQDGg+xuTOkF/wPblvitZOAaIw J8RY45NDfD0QAul4uGXrw1GYkpkJl1UWvNCOsWnCnyjSge99z31cLGyiBKJm3k7x/ODo Nhfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=v2SmpFKz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-83517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ee42-20020a056402292a00b00564879e11b2si814484edb.398.2024.02.27.07.39.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 07:39:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=v2SmpFKz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-83517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 36C051F23D6B for ; Tue, 27 Feb 2024 15:39:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CD5E146002; Tue, 27 Feb 2024 15:39:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="v2SmpFKz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IhZEy9ao" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 33FEE145B15; Tue, 27 Feb 2024 15:39:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709048384; cv=none; b=XamJ8lB59RAwwWAOOKMID+Cc+DIZFDbLcG8nT7yvMzgV20pTSrEW2OmotclpxiAUgeLWZhKiVbXIO+qKWZHSjiE20mDj6csJDV7ghYJa2s7ddeEGREGwkWWeyrb+Ap9NdS+tsMGWVGZD0xutiq8CZqE1rqZChF2Loy45VvGsoBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709048384; c=relaxed/simple; bh=vaOJT+3H/y/38JTvBaPdIy4/VKhioCNN1HHrb3AU4V4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=PgdVSquSCRXIAaPl6n18oeOqYvf21hkwgRXWF2N/62W+WnP/fWFA6V0LeUQpjU7QdCNjHWRtI9oPRcHQige2oS7EVtw/iUPClMTE0NKBLicTNHUTcs7oAuqpIKyNUZ2Xnh5JHU6oOc550358iN4KZpe5pnwX0aGZxJv3DIvpKd0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=v2SmpFKz; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=IhZEy9ao; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1709048381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cJMEmPknjHVafP7auP6NstYIZApeLwl7NpSBBPTsJRw=; b=v2SmpFKzyLlxe1n8O3ssVGgCw9zIymjESWdlflsdtoIpFV9ck8Gh8f5Z5p76E0Wov9JppI pUympLPPwSdDUxSpTfJZ7W94UZ3YgkntkZcy5VnTvCUWuvfFbRCCoxuQaBrBeBzjhuMh0A Rw7TvUa8M14b/KRF/9ToCMGjDVMZctCYp+iRh1bz3RsEcHGvsg2XigCu+1QMJGJ5PvfPUr sewGURBL9sdJJp9sgM9RUP1QN6zwl+2XAcqYzpn6j1nMn8nAHbM0iciZY0IbJn4z+SbLyQ mO557zUUhekJSYxGLyFzf0mNLWWa7aKV3evVDYSH5Dpnaw3H2Zo5o1ZNfYEYLA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1709048381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cJMEmPknjHVafP7auP6NstYIZApeLwl7NpSBBPTsJRw=; b=IhZEy9ao54ToXTf1lT6k5ns9ArJc7ZXbJm66qT+o+NH7VygNsznWpxxr8KbIgROKCMTqGb NHYGdj3aYBjzzZAA== To: Bitao Hu , dianders@chromium.org, 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 Cc: linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCHv10 3/4] genirq: Avoid summation loops for /proc/interrupts In-Reply-To: References: <20240226020939.45264-1-yaoma@linux.alibaba.com> <20240226020939.45264-4-yaoma@linux.alibaba.com> <87le769s0w.ffs@tglx> Date: Tue, 27 Feb 2024 16:39:41 +0100 Message-ID: <87a5nlapc2.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, Feb 27 2024 at 19:20, Bitao Hu wrote: > On 2024/2/27 17:26, Thomas Gleixner wrote: >> >> and then let kstat_irqs() and show_interrupts() use it. See? > > I have a concern. kstat_irqs() uses for_each_possible_cpu() for > summation. However, show_interrupts() uses for_each_online_cpu(), > which means it only outputs interrupt statistics for online cpus. > If we use for_each_possible_cpu() in show_interrupts() to calculate > 'any_count', there could be a problem with the following scenario: > If an interrupt has a count of zero on online cpus but a non-zero > count on possible cpus, then 'any_count' would not be zero, and the > statistics for that interrupt would be output, which is not the > desired behavior for show_interrupts(). Therefore, I think it's not > good to have kstat_irqs() and show_interrupts() both use the same > logic. What do you think? Good point. But you simply can have unsigned int kstat_irq_desc(struct irq_desc *desc, const struct cpumask *mask) and hand in the appropriate cpumask, which still shares the code, no? Thanks, tglx