Re: [PATCH v6 4/6] lib/dlock-list: Make sibling CPUs share the same linked list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux