diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2023-08-18 17:12:16 +0200 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2023-09-13 13:46:58 -0400 |
commit | 37b7ea3ca3062f5b7f02c2b335f203e4d411793d (patch) | |
tree | cb6340ab5b74882ef8c793c43f315bcef2594fa6 /drivers/iio/trigger/stm32-timer-trigger.c | |
parent | 7969ba577636a83553baf95882eb310b39e1c742 (diff) |
selinux: improve role transition hashing
The number of buckets is calculated by performing a binary AND against
the mask of the hash table, which is one less than its size (which is a
power of two). This leads to all top bits being discarded, e.g. with
the Reference Policy on Debian there exists 376 entries, leading to a
size of 512, discarding the top 23 bits.
Use jhash to improve the hash table utilization:
# current
roletr: 376 entries and 124/512 buckets used,
longest chain length 8, sum of chain length^2 1496
# patch
roletr: 376 entries and 266/512 buckets used,
longest chain length 4, sum of chain length^2 646
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Reviewed-by: Stephen Smalley <stephen.smalley.work@gmail.com>
[PM: line wrap in the commit description]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'drivers/iio/trigger/stm32-timer-trigger.c')
0 files changed, 0 insertions, 0 deletions