Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3917406imu; Mon, 7 Jan 2019 11:54:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN4VCiEAhr/VUXLCL/YJ0N7qh6WhwkC811NfVGddvlwG0RLmU5YFYop2fu/tuoIjEtgY5azS X-Received: by 2002:a63:d904:: with SMTP id r4mr59379825pgg.207.1546890859899; Mon, 07 Jan 2019 11:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546890859; cv=none; d=google.com; s=arc-20160816; b=sV0X/wuW/bZv0Kt1QjpwMrvHJzMeXvZZIKh+kwHd1yGzGY+uQ/JcFwmcyov9vZbtb6 Bkau0Vwfh3symNdcL/Sp3XRlVPdkUHcXlMgU/gI5Fn1vSV29J9A7OzgInudLP+GU1Rly 6yJ6SwOVDQOcdUhxOL31nohb8l47SwhQH0tS+4QU9VUMYAyvQByPbIwhnOws6Sdp8sf3 vNNHDw/8O9SvwGWMk5hVNpxpci6hz1aLhPw+y2gpqVz64YvCFTOraTByhBSVTN5inteN zw6O3pz00IhgFqpD8i/U9DXAwnlcq7c6hb0+O2rGts1qcyWB3WgtvPfSyEn/sQvTBHMN u9tw== 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:dkim-signature; bh=WC31PgMEZ4MAdDOy6MoXPli4cSxroS4xvF6ajnQwaXM=; b=niQxyOhWf1KVqrgzOoxa8Lw+Ch7O9GThpaiJj3c9fL3UUuMQznSf+G7vuEAkgqk7TA Ft2Cuj2K4MFH6FzxbV6/KIoywT9UD9/j2oGEJUT8C+eEazhBsV+akTH6ODlIH20b7ukV XVD2Kx+66vXJiG7XQFQWGR7MkM3PAiXHBxMrGWiDSCL3BkhsjZpPZThpkw4s828ZJ+7D 4mfw7qDKLqZUyY0lDPlRTSfKR2Y9CftvU8KLrtBHDuHA4TfqMfR5/qQq8GhDJa5u0Dte jnnaAkQo1Q8mzWY3NeAXPizZPGhOkx1W5fFDAKK+kW7/NZnCEKgMWaLRBQq9g7ckhuAa 9mqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="RKlU/Fhx"; 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 69si25400325pgc.164.2019.01.07.11.54.04; Mon, 07 Jan 2019 11:54:19 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="RKlU/Fhx"; 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 S1729327AbfAGQOq (ORCPT + 99 others); Mon, 7 Jan 2019 11:14:46 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35616 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbfAGQOq (ORCPT ); Mon, 7 Jan 2019 11:14:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WC31PgMEZ4MAdDOy6MoXPli4cSxroS4xvF6ajnQwaXM=; b=RKlU/FhxnhsCP/eZSxAlD843D KYluvbucN08DMuW6x5s/LQC6J8+TW6CQqQQSn6ETab6a4Ce86f0Q21R39mHnbvZCAVm/Hfqm4l2uh ZUHwsr4dW9jY+ackdroVWgcoe2rw3WrWEBGsN6hfyiln/GB0wqQgbEc1SoRApWVihJ/no4K/TNiCQ y/rfsRXV2e0K9P4FNUyUU5fRaVDlG/qUlU/A4s+e36RLjOhX673lFMRuLib3/idDBfs7P2oGbBjGU nCFQI0CDsdJ29PAt4UnTV2dXjy/M3d2qbfRNjfSzNnCkX2zBW4nnCyIUuOypPYI/wRwrRZSg6QbxS eRM5dZE8A==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1ggXY2-0005X5-RB; Mon, 07 Jan 2019 16:14:42 +0000 Date: Mon, 7 Jan 2019 08:14:42 -0800 From: Matthew Wilcox 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 , Dave Chinner , Randy Dunlap Subject: Re: [PATCH 2/2] /proc/stat: Add sysctl parameter to control irq counts latency Message-ID: <20190107161442.GZ6310@bombadil.infradead.org> References: <1546873978-27797-1-git-send-email-longman@redhat.com> <1546873978-27797-3-git-send-email-longman@redhat.com> <20190107155840.GY6310@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-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 11:07:47AM -0500, Waiman Long wrote: > > Why are you caching the _output_ of calling sprintf(), rather than caching the > > values of each interrupt? > > > It is just faster to dump the whole string buffer than redoing the > number formatting each time when the values don't change. I can cache > the individual sums instead if it is the preferred by most. But it also consumes more memory. Can you gather some measurements to find out what the performance difference is if you cache the values instead of the strings?