Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3657856imu; Mon, 7 Jan 2019 07:15:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN62N0JM8iwSMoPQZLLir8uW3r6pHCU6wla8HYG8exj3XNQpAMllRQHru3os4Yv5nrm7PVqH X-Received: by 2002:a17:902:4681:: with SMTP id p1mr17854214pld.184.1546874124899; Mon, 07 Jan 2019 07:15:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546874124; cv=none; d=google.com; s=arc-20160816; b=nh/4lIhC9qCfgCHSyxK2+DJHVjLUDhLvTQYzye0it8LoDW3j0s+Mprx4HJv/5A65Ur T64DScN2wPUKSzGitjqpay8kvFifFLOU44A/S8Uuj/aBKAL2mwyYyc3FITWZs5IALy+N IbpKIrgCKA3KMJ1oyPn3MruW3tO/uyTtRV6pxpc1H7uCdT47oZcyqHbvrDXzhXksL687 eQCETGcbluJdpZSOlX9ptzTNHxCNDT3vV+Mokx0EDdqgS/3CAHLyxbGBfzOdWrjZ2IIR nj6sdzQLauayJdjRgQAb8Pc/AFu9jeleYH5lPD5ulXKhXYxiM9vBq+sPorB6Rr/7JJ9X i7Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=bMZeeXkR5gNgZtfoVjO2muGHkTxJ2CR7PZkA5EB3dKA=; b=bzQqUw/2qAz48k/0wv/TPOZxXkcPjSfqFZarTVWBDL3fQb8twjpAC5Zro09qnsZBW/ lnFTmI5CJQrtvQvAKRL31ds6kGC1M8vx0fvp54MPc22yMrVer+4G2JUeX0+tVfxzIsBz ESfAIP+uGGoCd4FxYW1gAYEu0+FzkTaKDFZDatXQVEMeB9+GgVHrxfknZ6LR3wj2MZWc 6rhkWILTb0dMgMjH9+JuiEJiH1T8Nc81SSAwlqxsAx5AVWeucHBkejB5jabO2LOISBvm nB7BawB3WbnUW11weltx8rv4qwr5qdKcPJlhP7ZAHDqxoa1vpKlD7ZQW+U9qynFBM5VH mJ3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b89si18686660pfj.207.2019.01.07.07.15.09; Mon, 07 Jan 2019 07:15:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729486AbfAGPNL (ORCPT + 99 others); Mon, 7 Jan 2019 10:13:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60576 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbfAGPNL (ORCPT ); Mon, 7 Jan 2019 10:13:11 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A324C065F79; Mon, 7 Jan 2019 15:13:11 +0000 (UTC) Received: from llong.com (dhcp-17-223.bos.redhat.com [10.18.17.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E59F60CD9; Mon, 7 Jan 2019 15:13:04 +0000 (UTC) From: Waiman Long To: Andrew Morton , Alexey Dobriyan , Luis Chamberlain , Kees Cook , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, Davidlohr Bueso , Miklos Szeredi , Daniel Colascione , Dave Chinner , Randy Dunlap , Waiman Long Subject: [PATCH 0/2] /proc/stat: Reduce irqs counting performance overhead Date: Mon, 7 Jan 2019 10:12:56 -0500 Message-Id: <1546873978-27797-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 07 Jan 2019 15:13:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As newer systems have more and more IRQs and CPUs available in their system, the performance of reading /proc/stat frequently is getting worse and worse. Last year, I had proposed patch to extract out the IRQ line of /proc/stat into a new procfs file. However, this may break existing applications that depend on the presence of the IRQ line in /proc/stat. Davidlohr had proposed a new /proc/stat2 file which is almost the same as /proc/stat except that it has no IRQ line. This will require change in applications to use the new procfs file. This patchset uses a different approach to reduce the performance impact by using a sysctl parameter to control the maximum frequency at which the IRQ count computation can be done. The result is that the IRQ counts from /proc/stat may be a bit stale, but still provide the needed information. Waiman Long (2): /proc/stat: Extract irqs counting code into show_stat_irqs() /proc/stat: Add sysctl parameter to control irq counts latency Documentation/sysctl/fs.txt | 16 +++++++++ fs/proc/stat.c | 87 +++++++++++++++++++++++++++++++++++++++------ kernel/sysctl.c | 12 +++++++ 3 files changed, 105 insertions(+), 10 deletions(-) -- 1.8.3.1