From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161275AbcBQLFb (ORCPT ); Wed, 17 Feb 2016 06:05:31 -0500 Received: from casper.infradead.org ([85.118.1.10]:51019 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161182AbcBQLF3 (ORCPT ); Wed, 17 Feb 2016 06:05:29 -0500 Date: Wed, 17 Feb 2016 12:05:20 +0100 From: Peter Zijlstra To: Dave Chinner Cc: Waiman Long , Alexander Viro , Jan Kara , Jeff Layton , "J. Bruce Fields" , Tejun Heo , Christoph Lameter , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Andi Kleen , Dave Chinner , Scott J Norton , Douglas Hatch Subject: Re: [RFC PATCH 1/2] lib/percpu-list: Per-cpu list with associated per-cpu locks Message-ID: <20160217110520.GN6375@twins.programming.kicks-ass.net> References: <1455672680-7153-1-git-send-email-Waiman.Long@hpe.com> <1455672680-7153-2-git-send-email-Waiman.Long@hpe.com> <20160217095318.GO14668@dastard> <20160217110040.GB6357@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217110040.GB6357@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 17, 2016 at 12:00:40PM +0100, Peter Zijlstra wrote: > On Wed, Feb 17, 2016 at 08:53:18PM +1100, Dave Chinner wrote: > > > +/** > > > + * for_all_percpu_list_entries - iterate over all the per-cpu list with locking But the locking is 'pointless'. You only lock one per-cpu sublist at a time, therefore the list can be modified concurrently anyhow. So why not use RCU for the list iteration and avoid potentially large lock hold times? > > > + * @pos: the type * to use as a loop cursor for the current . > > > + * @next: an internal type * variable pointing to the next entry > > > + * @pchead: an internal struct list * of percpu list head > > > + * @pclock: an internal variable for the current per-cpu spinlock > > > + * @head: the head of the per-cpu list > > > + * @member: the name of the per-cpu list within the struct > > > + */