From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:34076 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbfAIS5i (ORCPT ); Wed, 9 Jan 2019 13:57:38 -0500 Subject: Re: [PATCH v2 0/4] /proc/stat: Reduce irqs counting performance overhead To: Matthew Wilcox Cc: Andrew Morton , Alexey Dobriyan , Kees Cook , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Davidlohr Bueso , Miklos Szeredi , Daniel Colascione , Dave Chinner , Randy Dunlap References: <1547054628-12703-1-git-send-email-longman@redhat.com> <20190109174403.GN6310@bombadil.infradead.org> <20190109182417.GO6310@bombadil.infradead.org> <20190109185226.GP6310@bombadil.infradead.org> From: Waiman Long Message-ID: <116b9b0e-8352-3fed-2dc8-4436915ace57@redhat.com> Date: Wed, 9 Jan 2019 13:57:36 -0500 MIME-Version: 1.0 In-Reply-To: <20190109185226.GP6310@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 01/09/2019 01:52 PM, Matthew Wilcox wrote: > On Wed, Jan 09, 2019 at 01:37:23PM -0500, Waiman Long wrote: >> On 01/09/2019 01:24 PM, Matthew Wilcox wrote: >>> Did you even try just using the general purpose infrastructure that's >>> in place? If that shows a performance problem _then_ it's time to make >>> this special snowflake just a little more special. Not before. >> I have looked into the percpu counter code. There are two aspects that I >> don't like to introduce to the interrupt handler's code path for >> updating the counts. >> >> 1) There is a raw spinlock in the percpu_counter structure that may need >> to be acquired in the update path. This can be a performance drag >> especially if lockdep is enabled. >> >> 2) The percpu_counter structure is 40 bytes in size on 64-bit systems >> compared with just 8 bytes for the percpu count pointer and an >> additional 4 bytes that I introduced in patch 2. With thousands of irq >> descriptors, it can consume quite a lot more memory. Memory consumption >> was a point that you brought up in one of your previous mails. > Then _argue that_. Don't just go off and do something random without > explaining to the rest of us why we're wrong. Sorry about that. I should have included that in the cover-letter. Cheers, Longman