From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757813AbcDGUlT (ORCPT ); Thu, 7 Apr 2016 16:41:19 -0400 Received: from mail-yw0-f180.google.com ([209.85.161.180]:35996 "EHLO mail-yw0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755737AbcDGUlR (ORCPT ); Thu, 7 Apr 2016 16:41:17 -0400 Date: Thu, 7 Apr 2016 16:41:14 -0400 From: Tejun Heo To: Waiman Long Cc: "Theodore Ts'o" , Andreas Dilger , Christoph Lameter , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch , Toshimitsu Kani Subject: Re: [PATCH 2/3] percpu_stats: Simple per-cpu statistics count helper functions Message-ID: <20160407204114.GJ7822@mtj.duckdns.org> References: <1459566578-30221-1-git-send-email-Waiman.Long@hpe.com> <1459566578-30221-3-git-send-email-Waiman.Long@hpe.com> <20160404160228.GW7822@mtj.duckdns.org> <570584F1.10909@hpe.com> <20160406225424.GK24661@htj.duckdns.org> <57068395.1080703@hpe.com> <20160407160623.GF7822@mtj.duckdns.org> <5706AC71.3080801@hpe.com> <20160407185827.GH7822@mtj.duckdns.org> <5706C4F2.6020108@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5706C4F2.6020108@hpe.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Waiman. On Thu, Apr 07, 2016 at 04:37:06PM -0400, Waiman Long wrote: > I would say that because I am lazy, I don't want compute the deltas every > time I want to see the effect of running a certain type of workload on the > statistics counts. I have use case that I need to track 10 or so statistics > counts and monitor their changes after running a job. It is much more > convenient to do a reset and see what you get than doing manual subtractions > to find out. I don't know. Write a simple script? Even if you wanna keep it in kernel, you can just have a base counter which offsets the summed up value on read. > I had taken a look at percpu-refcount.[ch]. I think the synchronization code > is a bit overkill for this purpose as no one really need a very precise > statistics counts nor precise atomic reset. I would prefer providing an > optional atomic reset feature with slower statistics count update path for > the time being. If we come across a use case where we need atomic reset with > negligible slowdown, we could then refactor the code to use something > similar to what the percpu-refcount code is doing. Please either drop reset or make it actually work; otherwise, I don't think this should go in. Thanks. -- tejun