possible power of two cleanup?
Hi guys,
Just stumbled upon this in include/linux/blockgroup_lock.h
It looks like it essentially does a round up to the nearest power of two of NR_CPUS * 4? Is this a potential cleanup? Prevent breakage when we start having more than 64 CPUs in a machine?
/*
* We want a power-of-two. Is there a better way than this? */
#if NR_CPUS >= 32
#define NR_BG_LOCKS 128
#elif NR_CPUS >= 16
#define NR_BG_LOCKS 64
#elif NR_CPUS >= 8
#define NR_BG_LOCKS 32
#elif NR_CPUS >= 4
#define NR_BG_LOCKS 16
#elif NR_CPUS >= 2
#define NR_BG_LOCKS 8
#else
#define NR_BG_LOCKS 4
#endif
Jaco
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors