From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752014AbdFTThT (ORCPT ); Tue, 20 Jun 2017 15:37:19 -0400 Received: from mail-yb0-f175.google.com ([209.85.213.175]:34323 "EHLO mail-yb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbdFTThS (ORCPT ); Tue, 20 Jun 2017 15:37:18 -0400 Date: Tue, 20 Jun 2017 15:37:15 -0400 From: Tejun Heo To: Nikolay Borisov Cc: jbacik@fb.com, linux-kernel@vger.kernel.org, mgorman@techsingularity.net Subject: Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions Message-ID: <20170620193715.GF21326@htj.duckdns.org> References: <20170620173346.GB21326@htj.duckdns.org> <1497981720-7036-1-git-send-email-nborisov@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1497981720-7036-1-git-send-email-nborisov@suse.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Nikolay. On Tue, Jun 20, 2017 at 09:02:00PM +0300, Nikolay Borisov wrote: > Currently the writeback statistics code uses a percpu counters to hold > various statistics. Furthermore we have 2 families of functions - those which > disable local irq and those which doesn't and whose names begin with > double underscore. However, they both end up calling __add_wb_stats which in > turn calls percpu_counter_add_batch which is already irq-safe. Heh, looks like I was confused. __percpu_counter_add() is not irq-safe. It disables preemption and uses __this_cpu_read(), so there's no protection against irq. If writeback statistics want irq-safe operations and it does, it would need these separate operations. Am I missing something? Thanks. -- tejun