From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751609AbdJEO5L (ORCPT ); Thu, 5 Oct 2017 10:57:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37508 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbdJEO5K (ORCPT ); Thu, 5 Oct 2017 10:57:10 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A2D327F412 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=longman@redhat.com Subject: Re: [PATCH v6 4/6] lib/dlock-list: Make sibling CPUs share the same linked list To: Jan Kara 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 , Davidlohr Bueso , Waiman Long References: <1507152007-28753-1-git-send-email-longman@redhat.com> <1507152007-28753-5-git-send-email-longman@redhat.com> <20171005085947.GC28132@quack2.suse.cz> From: Waiman Long Organization: Red Hat Message-ID: <9ded5c76-4379-0339-6482-1f8bb590e3f2@redhat.com> Date: Thu, 5 Oct 2017 10:57:07 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20171005085947.GC28132@quack2.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 05 Oct 2017 14:57:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/05/2017 04:59 AM, Jan Kara wrote: > On Wed 04-10-17 17:20:05, Waiman Long wrote: >> int alloc_dlock_list_heads(struct dlock_list_heads *dlist) >> { >> - int idx; >> + int idx, cnt = nr_dlock_lists ? nr_dlock_lists : nr_cpu_ids; > Hum, is this there for the case where alloc_dlock_list_heads() is called > before nr_dlock_lists is initialized? But how can the dlist be used later > when it has larger number of lists and you don't know how many? The point is nr_dlock_lists <= nr_cpu_ids. Before nr_dlock_lists is initialized, the mapping table will map all cpus to the first entry. So the extra entries will just stay unused. At free time, they will all get de-allocated. I will clarify that with a comment. Cheers, Longman