1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-25 07:49:18 +00:00

Make the sleepq chain hash size configurable per-arch and bump on amd64.

While here cache-align chains.

This shortens longest found chain during poudriere -j 80 from 32 to 16.

Pushing this higher up will probably require allocation on boot.
This commit is contained in:
Mateusz Guzik 2017-10-22 20:43:50 +00:00
parent 5a17c5524f
commit 9e68989764
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=324870
2 changed files with 9 additions and 2 deletions

View File

@ -152,4 +152,8 @@
#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \
|| ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS))
#ifdef SMP
#define SC_TABLESIZE 1024 /* Must be power of 2. */
#endif
#endif /* !_AMD64_INCLUDE_PARAM_H_ */

View File

@ -93,7 +93,10 @@ __FBSDID("$FreeBSD$");
* Constants for the hash table of sleep queue chains.
* SC_TABLESIZE must be a power of two for SC_MASK to work properly.
*/
#define SC_TABLESIZE 256 /* Must be power of 2. */
#ifndef SC_TABLESIZE
#define SC_TABLESIZE 256
#endif
CTASSERT(powerof2(SC_TABLESIZE));
#define SC_MASK (SC_TABLESIZE - 1)
#define SC_SHIFT 8
#define SC_HASH(wc) ((((uintptr_t)(wc) >> SC_SHIFT) ^ (uintptr_t)(wc)) & \
@ -137,7 +140,7 @@ struct sleepqueue_chain {
u_int sc_depth; /* Length of sc_queues. */
u_int sc_max_depth; /* Max length of sc_queues. */
#endif
};
} __aligned(CACHE_LINE_SIZE);
#ifdef SLEEPQUEUE_PROFILING
u_int sleepq_max_depth;