Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4047345imu; Mon, 7 Jan 2019 14:34:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN5RpBkRY4JiiyfEopIPQZmeroLzfiUkNHcyhRRPa8J/eCsIbVIZlv3/tfnLb8yeX+I+ocsy X-Received: by 2002:a17:902:a40f:: with SMTP id p15mr64474516plq.286.1546900465143; Mon, 07 Jan 2019 14:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546900465; cv=none; d=google.com; s=arc-20160816; b=y0/4TV6UZ0qMfqLMkrAMp8eRMDzf8ltYhGkFggv5XdNl1oPni8lqwpcrcjg1WUVzzI PLeck+gFm9FNbMFjwKFGGwt8X+gNQzFWPn0C7cefl90Iw+hAHaDzUyAjgabxQ0Dk9Uv0 ZM5LB9fuuvePdMH/hOIXMyphxHw+bbZK9xbKv2gdxK24YbRmbk+C/MLC85CaW/5wabOU 7i1cN77w5ULzQhiarUwa8dF1S9tbw3xyTl8TEy8qLLssuejFnsk1J6HFu68L9j/Tr0qi 4hB2h6g0QFp/+kYKGu8Tq8wjl5Z1JZLrlSTRi3Iojw7mg9012jpHhCHX/BEfv8fd2+T5 f6hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7AZ3SvUNQYn7Pyfqrn+HAMipv3WsJjxqepGdWhf9h1w=; b=zjFLw6+cgV/64aZG7a4+fPBP6fwyEUM3XKg0sD1SPIVRu+xitKvq488iLigD4NyD41 mTeV02QdQRNP+kH+IJSUaA7wPwXeyZozivadL/FSdGM9jUGY4PsURzwqNyA4eo2ki3E/ Gsmp9liYwe0att3m1xslKcWDK2CYrseQbVBHv5axahVhPJS/CFV/mlXBhNMwtKg/o5GO 8rGJcO0smYzGsoGWQityugpzqcBt/GRkskuuXyk5PIodNsrN/Cmuh+XBfoBgEJEmw4hg a3Kj1phbtAm0Y/AI3wcnLyhDI+xPh/gDTQlOnPuWEriiKhnWQgZvjSOswTg9qtmlomdY qlPw== 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 c21si11967737plo.165.2019.01.07.14.34.09; Mon, 07 Jan 2019 14:34:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbfAGWcU (ORCPT + 99 others); Mon, 7 Jan 2019 17:32:20 -0500 Received: from ipmail06.adl2.internode.on.net ([150.101.137.129]:32023 "EHLO ipmail06.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbfAGWcU (ORCPT ); Mon, 7 Jan 2019 17:32:20 -0500 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail06.adl2.internode.on.net with ESMTP; 08 Jan 2019 09:02:17 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1ggdRO-0007A0-Qa; Tue, 08 Jan 2019 09:32:14 +1100 Date: Tue, 8 Jan 2019 09:32:14 +1100 From: Dave Chinner To: Waiman Long Cc: Andrew Morton , Alexey Dobriyan , Luis Chamberlain , Kees Cook , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, Davidlohr Bueso , Miklos Szeredi , Daniel Colascione , Randy Dunlap Subject: Re: [PATCH 0/2] /proc/stat: Reduce irqs counting performance overhead Message-ID: <20190107223214.GZ6311@dastard> References: <1546873978-27797-1-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1546873978-27797-1-git-send-email-longman@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. We have percpu counter infrastructure that trades off a small amount of addition overhead for zero-cost reading of the counter value. i.e. why not just convert this whole mess to percpu_counters and then just use percpu_counter_read_positive()? Then we just don't care how often userspace reads the /proc file because there is no summing involved at all... Cheers, Dave. -- Dave Chinner david@fromorbit.com