From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933876AbcBQQWV (ORCPT ); Wed, 17 Feb 2016 11:22:21 -0500 Received: from casper.infradead.org ([85.118.1.10]:59119 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755636AbcBQQWT (ORCPT ); Wed, 17 Feb 2016 11:22:19 -0500 Date: Wed, 17 Feb 2016 17:22:16 +0100 From: Peter Zijlstra To: Waiman Long Cc: Dave Chinner , 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: <20160217162216.GI6357@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> <20160217110520.GN6375@twins.programming.kicks-ass.net> <56C49CCA.7090805@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C49CCA.7090805@hpe.com> 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 11:16:10AM -0500, Waiman Long wrote: > >So why not use RCU for the list iteration and avoid potentially large > >lock hold times? > > > > I know we can use RCU for singly linked list, but I don't think we can use > that for doubly linked list as there is no easy way to make atomic changes > to both prev and next pointers simultaneously unless you are taking about > 16b cmpxchg which is only supported in some architecture. See include/linux/rculist.h, the only constraint is that reverse iteration is not allowed, because of what you say.