[PATCH -V2 2/2] powerpc: Update kernel VSID range

David Laight David.Laight at ACULAB.COM
Sat Feb 16 03:52:40 EST 2013


>   * The proto-VSIDs are then scrambled into real VSIDs with the
>   * multiplicative hash:
> ...
>   * VSID_MULTIPLIER is prime, so in particular it is
>   * co-prime to VSID_MODULUS, making this a 1:1 scrambling function.
>   * Because the modulus is 2^n-1 we can compute it efficiently without
> + * robust scattering in the hash * table (at least based on some initial
> + * results).

Are VSIDs a value that the kernel has a 'free choice' over the
value to allocate, and that only have to be unique over the
allocated values?

If so, instead of using hash chains it is probably better to
pick a free 'hash' table entry, and then allocate a VSID value
that maps directly into that table slot.
Reusing values can be avoided by incrementing the high bits
every time a table entry is reused, the free slots can also
easily be kept on a FIFO list.

If the table gets nearly full its size can be doubled (protect
with rcu?).

	David





More information about the Linuxppc-dev mailing list