lkml.org 
[lkml]   [2019]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/5] locking/lockdep: Reuse free chain_hlocks entries
From
Date
On 12/13/19 11:02 AM, Waiman Long wrote:
> That is an interesting idea. It will eliminate the need of a separate
> array to track the free chain_hlocks. However, if there are n chains
> available, it will waste about 3n bytes of storage, on average.
>
> I have a slightly different idea. I will enforce a minimum allocation
> size of 2. For a free block, the first 2 hlocks for each allocation
> block will store a 32-bit integer (hlock[0] << 16)|hlock[1]:
>
> Bit 31: always 1
> Bits 24-30: block size
> Bits 0-23: index to the next free block.
>
> In this way, the wasted space will be k bytes where k is the number of
The wasted space should be 2k bytes. My mistake.
> 1-entry chains. I don't think merging adjacent blocks will be that
> useful at this point. We can always add this capability later on if it
> is found to be useful.

Cheers,
Longman

\
 
 \ /
  Last update: 2019-12-13 17:06    [W:0.060 / U:8.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site