diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-02-11 20:13:52 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-02-11 20:13:52 +0000 |
commit | b9f6b60a84b6713af31ae0fdbd0b12ad7ee00a35 (patch) | |
tree | 6635281f48f96b04364df19b11bdff86c209392f /sys/vm/uma.h | |
parent | bcd0823d3d8c9fb1d85aae1ff1f3249aa90ea58c (diff) | |
download | FreeBSD-src-b9f6b60a84b6713af31ae0fdbd0b12ad7ee00a35.zip FreeBSD-src-b9f6b60a84b6713af31ae0fdbd0b12ad7ee00a35.tar.gz |
Add uma_set_align() interface, which will be called at most once during
boot by MD code to indicated detected alignment preference. Rather than
cache alignment being encoded in UMA consumers by defining a global
alignment value of (16 - 1) in UMA_ALIGN_CACHE, UMA_ALIGN_CACHE is now
a special value (-1) that causes UMA to look at registered alignment. If
no preferred alignment has been selected by MD code, a default alignment
of (16 - 1) will be used.
Currently, no hardware platforms specify alignment; architecture
maintainers will need to modify MD startup code to specify an alignment
if desired. This must occur before initialization of UMA so that all UMA
zones pick up the requested alignment.
Reviewed by: jeff, alc
Submitted by: attilio
Diffstat (limited to 'sys/vm/uma.h')
-rw-r--r-- | sys/vm/uma.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 0027177..c082e96 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -236,7 +236,7 @@ uma_zone_t uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor dtor, #define UMA_ALIGN_INT (sizeof(int) - 1) /* "" int */ #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ -#define UMA_ALIGN_CACHE (16 - 1) /* Cache line size align */ +#define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ /* * Destroys an empty uma zone. If the zone is not empty uma complains loudly. @@ -388,6 +388,18 @@ void uma_startup2(void); void uma_reclaim(void); /* + * Sets the alignment mask to be used for all zones requesting cache + * alignment. Should be called by MD boot code prior to starting VM/UMA. + * + * Arguments: + * align The alignment mask + * + * Returns: + * Nothing + */ +void uma_set_align(int align); + +/* * Switches the backing object of a zone * * Arguments: |