Received: by 10.192.165.148 with SMTP id m20csp46165imm; Thu, 19 Apr 2018 12:44:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx49KNLSZxaQhGKYw9WB3hZrMMnG0utSKHvRoiyOW8EGdX6R2tLf6blIk2HxfNLe6Ph4s+qds X-Received: by 10.101.101.136 with SMTP id u8mr6314282pgv.333.1524167098949; Thu, 19 Apr 2018 12:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524167098; cv=none; d=google.com; s=arc-20160816; b=wMia4RH94BMrt6EKsDOyJU7t1TQaKi94QyXkG9+St310zBWCHf1FlnBeLCD65YvNJq hshxrZvxPoub+FPDEA1N5KgCwThknHH3MyM+9Y/AVOpIy5QqQhGuMPs3YN3anGQFXY5n WRHdtHNi3yeKW5+5KSBEO/Rk2p0USGKsIoYE1AXfNfkq8zBzFrXUlecgia9Pf9Z7Y81S hqoDnLZ2XD3RZxLk6hhc9YXYAJZKy7uEtB6bkv/4CiUYtcZKKBP1AQIF95v9ocxrDbbG sKRDniq4F2EumRWFXa2GLEhLqh4Gm4JAwkbXBlu7RBm+5kv9PEETFH8p1x2xh6PZ0Vux OPGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=34b9dmm9XWetYnpFDTFYmW85l6PRdv+m6RSyFD10fFA=; b=JShf+jYVUxwQGt6fUXK5UsqJvtDGdHw8GkhW+i+ookjgOqCptkmZbwUE2xeZnR7sJz iPhdU3in3Rl3qc8nW5E54rpxtLSnVRL6EoY7SR8BG7/a8iFKRRiNOi81mKEBFhhlkuBN cHeQGq66mAOasnZjGnBk7YgqU3y5f4DfUkwkwgEZc70Sba3lVEZODPHhl6/OVHWr/exz NJeObLrGD3SwfW6lYaIMgAm9/YAbL3bl/SEqVcCNEmVXpb/AjXFrwjeJ0gPkkmSVY5Ou JbFDRUIdrOgXUem2kvzv7N5wrFJ62JX7cMxOHorgNsrQwIrW6zcxgDE1qdZMNJvltsEC g+5Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si4010010plv.217.2018.04.19.12.44.42; Thu, 19 Apr 2018 12:44:58 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753289AbeDSTnV (ORCPT + 99 others); Thu, 19 Apr 2018 15:43:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54526 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbeDSTnU (ORCPT ); Thu, 19 Apr 2018 15:43:20 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.71]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4A387D3D; Thu, 19 Apr 2018 19:43:20 +0000 (UTC) Date: Thu, 19 Apr 2018 12:43:19 -0700 From: Andrew Morton To: Waiman Long Cc: Kate Stewart , Thomas Gleixner , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Alexey Dobriyan Subject: Re: [PATCH] proc/stat: Separate out individual irq counts into /proc/stat_irqs Message-Id: <20180419124319.8e329eb25234c045bf161cd5@linux-foundation.org> In-Reply-To: <1524157769-30775-1-git-send-email-longman@redhat.com> References: <1524157769-30775-1-git-send-email-longman@redhat.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Apr 2018 13:09:29 -0400 Waiman Long wrote: > It was found that reading /proc/stat could be time consuming on > systems with a lot of irqs. For example, reading /proc/stat in a > certain 2-socket Skylake server took about 4.6ms because it had over > 5k irqs. In that particular case, the majority of the CPU cycles for > reading /proc/stat was spent in the kstat_irqs() function. Therefore, > application performance can be impacted if the application reads > /proc/stat rather frequently. > > The "intr" line within /proc/stat contains a sum total of all the irqs > that have happened followed by a list of irq counts for each individual > irq number. In many cases, the first number is good enough. The > individual irq counts may not provide that much more information. > > In order to avoid this kind of performance issue, all these individual > irq counts are now separated into a new /proc/stat_irqs file. The > sum total irq count will stay in /proc/stat and be duplicated in > /proc/stat_irqs. Applications that need to look up individual irq counts > will now have to look into /proc/stat_irqs instead of /proc/stat. > (cc /proc maintainer) It's a non-backward-compatible change. For something which has existing for so long, it would be a mighty task to demonstrate that no existing userspace will be disrupted by this change. So we need to think again. A new interface which omits the per-IRQ stats might be acceptable. Or, conceivably, a new /proc knob which disables the per-IRQ stats in /proc/stat. That would allow operators to opt in to this disabling and would avoid the need to alter whatever-application-it-is-that-is-having-trouble. This seems a bit ugly though. Also, the changelog is rather vague. "application performance can be impacted". Well, *are* applications impacted? What is the real-world performance gain which this change provides, in a real-world workload?