Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp35776pxb; Tue, 17 Nov 2020 19:39:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+1N90p62y6y8gso8O1A5zlPTSSM17Dapa4a8shJMvLGG7ZBgO2f39b2J7MdSEEEcWk4S6 X-Received: by 2002:a05:6402:3136:: with SMTP id dd22mr23021846edb.256.1605670741020; Tue, 17 Nov 2020 19:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605670741; cv=none; d=google.com; s=arc-20160816; b=xLu/gdJS7iHfYB3895QWgnu+q4NBkDc1ByuOZPX6+zDzLHrwa+aGb5vLV+CLARUl0d UmK+dT/taQ9StILXuqyGNDQZexdtZrVAtb8A5q/9+Fprvjz+R8HRcOTGrCAUFuz4E1mx vrLbDEGYbdWWufmCrZ0JuAKSZ/AtRO8VrEvVNQBUU3swzWB8rVkWNYrry+Y98kJB2glK PU0J1Z+0fXqPo784WQIFP4iWt8cIPzY64vvcHqd0ZDC/gXl6/1/XnnvLVo5dl3uQ6NYG vIkXVl1T/nEXO5MRMfxHqoPbYYZMbLnvK2XNoO4g25hgZtU7udFHBgzhZgN/Ytla/i0U gtWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=yqr8AsUYG2ItLZV8enoV8lgL+MN51d74ph8g1LaesdQ=; b=kiMhdT9PznQ0YYzaQoV3tDxykY91pUs5NqKjBkXMK6uLQEq7cXxPg32wOgVtKgCZP5 frmkvCdfE7OqUQF2LKzB7CrncuhSyieH0NhwFN+DOsNQbguLZw6qqjN9VqiI5MuOwXwy FwH2/XVbvcG6CZpjtAudmDkewiUv8L+HnUYt9EAoNV0lRCMLL9ugG+9lMHQv1sDAZK0w wBV//YwAMs3EbRkyjBtpRMQWHdSH5e6xBT68ptm9Or4GMcgyJvGIK+Q4Kwt027QflXEd vm/Kz9E7+jdnGJD/uuk5hqhEJkD3Z8U9pAwAU5QxHtQu59XYPsHQC/5SZOQ2/K/4JsFB 9/GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QsbAhJc2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 63si15348834edn.339.2020.11.17.19.38.38; Tue, 17 Nov 2020 19:39:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QsbAhJc2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727023AbgKRDgs (ORCPT + 99 others); Tue, 17 Nov 2020 22:36:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726682AbgKRDgr (ORCPT ); Tue, 17 Nov 2020 22:36:47 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 577E7C0613D4 for ; Tue, 17 Nov 2020 19:36:46 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id 18so229118pli.13 for ; Tue, 17 Nov 2020 19:36:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yqr8AsUYG2ItLZV8enoV8lgL+MN51d74ph8g1LaesdQ=; b=QsbAhJc2P5LOy2hC3PEJf5EPG+nTFix+lXpYMc+mvc7bnjIra5/S1c/gaxanFsVpr1 wRXl36PuX/Zr+nteo7Z/m1jtqxMlAx3xpynvcAMkX6a58yMvOfnNZcy1Is+jTsQSTtvs C2s6Hbp0a2LIGv04vFMb5hVCK3qhGTr7Q798yJdVtZkqotX3GhWAOFJB4Q6PY5oki6YW +aWt90EiAr3Qx9XWkHRTKZyNE8GlwROyD7sIIDN62KF+hVk+PCFEHicNZ48etsG0Rug4 /fnXTzuFNp0z4Rt8gyfsHzCUrEYmVNfzE8tgHkp6LK/Q7N6lz+PB1e5E+fCr06/CWzj+ n3Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yqr8AsUYG2ItLZV8enoV8lgL+MN51d74ph8g1LaesdQ=; b=a1hNBTWtzdAJcCSKRd1Pj9RYFyki152N3OWK+JkpoavIjXmrtLegaJBSqmLNBfJYzd Ko/UHXaZBRxS2pJHMPFqeotIvq/OTIvsSVZhGNern7dwGvuI3evWC8YPUiT8zK+eSNCb gq+YdUwIw/P2rIJEA7oS253HQibDazg9wrNcM6nLaA5gamlYA1s6XUAVehTiuqBPhk9P lE3eqgBtouZKmMyLnbqlvCHSObZjwvdYGpTlqrAlOxkjy5NzABnETmCY6jwyZHWI4t1l kOpi0UxWagYyeQWwqAyG+MOmQT5lxgKhxLl6Rdm2nMBYkR8W0V5pm/r86MmdYMpqeLFb k6kg== X-Gm-Message-State: AOAM530cVg2RLCmE4r8nI5lEPgIYWRoQyvGQ2/VjVS2aTa+mpiK2TRPw oERVgeKzM0D3xO7xlc8EzwYfqd9sMg== X-Received: by 2002:a17:90a:e28f:: with SMTP id d15mr2065106pjz.96.1605670605815; Tue, 17 Nov 2020 19:36:45 -0800 (PST) Received: from mylaptop.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id s21sm8915450pgm.65.2020.11.17.19.36.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2020 19:36:45 -0800 (PST) From: Pingfan Liu To: linux-kernel@vger.kernel.org Cc: Pingfan Liu , Thomas Gleixner , Jisheng Zhang , "Peter Zijlstra (Intel)" , Vlastimil Babka , Andrew Morton , "Guilherme G. Piccoli" , Petr Mladek , kexec@lists.infradead.org Subject: [PATCH 1/3] x86/irq: account the unused irq Date: Wed, 18 Nov 2020 11:36:16 +0800 Message-Id: <1605670578-23681-2-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1605670578-23681-1-git-send-email-kernelfans@gmail.com> References: <87tuueftou.fsf@nanos.tec.linutronix.de> <1605670578-23681-1-git-send-email-kernelfans@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Accounting the unused irq in order to count it if irq flood. Signed-off-by: Pingfan Liu Cc: Thomas Gleixner Cc: Jisheng Zhang Cc: "Peter Zijlstra (Intel)" Cc: Vlastimil Babka Cc: Andrew Morton Cc: "Guilherme G. Piccoli" Cc: Petr Mladek Cc: kexec@lists.infradead.org To: linux-kernel@vger.kernel.org --- arch/x86/kernel/irq.c | 1 + include/linux/kernel_stat.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index c5dd503..6f583a7 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -254,6 +254,7 @@ DEFINE_IDTENTRY_IRQ(common_interrupt) pr_emerg_ratelimited("%s: %d.%u No irq handler for vector\n", __func__, smp_processor_id(), vector); + __this_cpu_inc(kstat.unused_irqs_sum); } else { __this_cpu_write(vector_irq[vector], VECTOR_UNUSED); } diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 89f0745..c8d5cb8 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -37,6 +37,7 @@ struct kernel_cpustat { struct kernel_stat { unsigned long irqs_sum; + unsigned long unused_irqs_sum; unsigned int softirqs[NR_SOFTIRQS]; }; -- 2.7.5