From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-f195.google.com ([209.85.167.195]:42361 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726724AbfAGWlk (ORCPT ); Mon, 7 Jan 2019 17:41:40 -0500 Received: by mail-oi1-f195.google.com with SMTP id w13so1739390oiw.9 for ; Mon, 07 Jan 2019 14:41:39 -0800 (PST) MIME-Version: 1.0 References: <1546873978-27797-1-git-send-email-longman@redhat.com> <20190107223214.GZ6311@dastard> In-Reply-To: <20190107223214.GZ6311@dastard> From: Daniel Colascione Date: Mon, 7 Jan 2019 17:41:28 -0500 Message-ID: Subject: Re: [PATCH 0/2] /proc/stat: Reduce irqs counting performance overhead To: Dave Chinner Cc: Waiman Long , Andrew Morton , Alexey Dobriyan , Luis Chamberlain , Kees Cook , Jonathan Corbet , linux-kernel , "open list:DOCUMENTATION" , Linux FS Devel , Davidlohr Bueso , Miklos Szeredi , Randy Dunlap Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Jan 7, 2019 at 5:32 PM Dave Chinner wrote: > > On Mon, Jan 07, 2019 at 10:12:56AM -0500, Waiman Long wrote: > > 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. > > Because the "roll-your-own" per-cpu counter implementaiton has been > optimised for low possible addition overhead on the premise that > summing the counters is rare and isn't a performance issue. This > patchset is a direct indication that this "summing is rare and can > be slow" premise is now invalid. Focusing on counter performance is, IMHO, missing the mark. Even if interrupt count collection were made fast, there's *something* in any particular /proc file that a particular reader doesn't need and that, by being uselessly collected, needlessly slows that reader. There should be a general-purpose way for /proc file readers to tell the kernel which bits of information interest them on a particular read syscall sequence or particular open(2) or something. Creating a new proc file for every useful combination of attributes doesn't scale either.