Received: by 10.223.164.202 with SMTP id h10csp4521967wrb; Wed, 29 Nov 2017 07:38:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMbR/QPkoisXFNnXTY7OeqlCYBg8vU/4bip979+9aGm+EAlpf1o8GcUwK8jxT0HUYxeenxu9 X-Received: by 10.98.218.67 with SMTP id w3mr3451544pfl.128.1511969937819; Wed, 29 Nov 2017 07:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511969937; cv=none; d=google.com; s=arc-20160816; b=z/9Xd5TaTUvsU8BlFy1fMaKUl6u8dhpvXlrISBIUglhPqRfhurMpI1TVUdK8Yh5yGs krk+CfDcE0nvMYGYCuxQTJvqxZLkIDqKyOPOof9vkQiFRjaE738J2rBbIvek9t1IANpB BSHVFVGmXMVoowyozpwF+lKkbmOmEz2JDhzFGl7ISU386kMCWBk/Y18YM7BqGP8oFEEV 7n0HiVmqbBwlHGSER1FJlx3CrBXLQ+kscn04L4a4cbXspBmROdu5dXt+usPg5ePKUrNC PUTZL47KZidAKC7iE1GZpu5xKMKbOF+fwfMMK91Vm0wDjDKKidmvMsqRjXaYXCbAynxr 7dig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=mMaC8sco/GHVFFkHLaJ2AQHCNLWqKVfbSDcM6LuE+xQ=; b=ePgvmWAcmrh+DyAQjy8CEcY/vN1Iqg6DuMv7h/ndzBb9urOriD3vEfTTx+KwPJjw38 5GthVDtByF5wYjtk2UTV41rgEP/y0KpSoKhZxqIlF911wuLC/xLJbUbhrN5Th8Bcg5nW gXbbAykhht9429A2PiqP+cF1fyo5Ovk27k+o8dytCaX7Olv7TGFQV9v6kR52mvXbwjm9 AYBMlblsIcw076irwHakQi9LRPOkftjdnNiu5pSYuLcyLLyvnaLJfuQfZCCRIh1uApl7 0Sdd5OyO9N5yjns4yEIiKQrdkUZSbGDpJC7tAEyYC6DLX8eMu9gsDaRiM+wCYPu/f+g4 dPjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d76si1520638pfk.321.2017.11.29.07.38.47; Wed, 29 Nov 2017 07:38:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933197AbdK2PcW (ORCPT + 69 others); Wed, 29 Nov 2017 10:32:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:40817 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933161AbdK2PcS (ORCPT ); Wed, 29 Nov 2017 10:32:18 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2C3DFAE0B; Wed, 29 Nov 2017 15:32:17 +0000 (UTC) Date: Wed, 29 Nov 2017 07:29:02 -0800 From: Davidlohr Bueso To: Waiman Long Cc: 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 , Peter Zijlstra , Andi Kleen , Dave Chinner , Boqun Feng Subject: Re: [PATCH v8 1/6] lib/dlock-list: Distributed and lock-protected lists Message-ID: <20171129152902.7y6xir6nrrzukgoi@linux-n805> References: <1509475860-16139-1-git-send-email-longman@redhat.com> <1509475860-16139-2-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1509475860-16139-2-git-send-email-longman@redhat.com> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Oct 2017, Waiman Long wrote: >Linked list is used everywhere in the Linux kernel. However, if many >threads are trying to add or delete entries into the same linked list, >it can create a performance bottleneck. > >This patch introduces a new list APIs that provide a set of distributed >lists (one per CPU), each of which is protected by its own spinlock. >To the callers, however, the set of lists acts like a single >consolidated list. This allows list entries insertion and deletion >operations to happen in parallel instead of being serialized with a >global list and lock. > >List entry insertion is strictly per cpu. List deletion, however, can >happen in a cpu other than the one that did the insertion. So we still >need lock to protect the list. Because of that, there may still be >a small amount of contention when deletion is being done. > >A new header file include/linux/dlock-list.h will be added with the >associated dlock_list_head and dlock_list_node structures. The following >functions are provided to manage the per-cpu list: > > 1. int alloc_dlock_list_heads(struct dlock_list_heads *dlist) > 2. void free_dlock_list_heads(struct dlock_list_heads *dlist) > 3. void dlock_list_add(struct dlock_list_node *node, > struct dlock_list_heads *dlist) > 4. void dlock_list_del(struct dlock_list *node) > >Iteration of all the list entries within a dlock list array >is done by calling either the dlist_for_each_entry() or >dlist_for_each_entry_safe() macros. They correspond to the >list_for_each_entry() and list_for_each_entry_safe() macros >respectively. The iteration states are keep in a dlock_list_iter >structure that is passed to the iteration macros. > >Signed-off-by: Waiman Long >Reviewed-by: Jan Kara Reviewed-by: Davidlohr Bueso From 1583052155093133859@xxx Fri Nov 03 13:36:21 +0000 2017 X-GM-THRID: 1582800381820199218 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread