lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ded5c76-4379-0339-6482-1f8bb590e3f2@redhat.com>
Date:   Thu, 5 Oct 2017 10:57:07 -0400
From:   Waiman Long <longman@...hat.com>
To:     Jan Kara <jack@...e.cz>
Cc:     Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.com>,
        Jeff Layton <jlayton@...chiereds.net>,
        "J. Bruce Fields" <bfields@...ldses.org>,
        Tejun Heo <tj@...nel.org>,
        Christoph Lameter <cl@...ux-foundation.org>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andi Kleen <andi@...stfloor.org>,
        Dave Chinner <dchinner@...hat.com>,
        Boqun Feng <boqun.feng@...il.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Waiman Long <Waiman.Long@....com>
Subject: Re: [PATCH v6 4/6] lib/dlock-list: Make sibling CPUs share the same
 linked list

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ