CACHE_LINE_SIZE too small,
so struct vpglocks size alignment doesn't work
Svatopluk Kraus
onwahe at gmail.com
Fri Oct 1 13:31:18 UTC 2010
Hallo,
a size of 'struct vpglocks' is padded to CACHE_LINE_SIZE size in
'sys/vm/vm_page.h'
header file. I work on a 'coldfire' port where CACHE_LINE_SIZE is 16 bytes and
sizeof(struct mtx) is 20 bytes thus size alignment doesn't work.
I solved it somehow, but I like to learn how to solve it in spirit
of FreeBSD.
There are a couple of possibilities:
A1. Do nothing for small CACHE_LINE_SIZE.
A2. Pad to multiple of CACHE_LINE_SIZE.
B1. use #if with CACHE_LINE_SIZE
B2. use #if with __coldfire__
When I use B1 solution I need to known sizeof(struct mtx) value in
preprocessing time.
So, is it correct to use something like 'assym.s' magic
(sys/i386/i386/genassym.c)
in MI code? Or has someone another suggestion?
Regards, Svata
More information about the freebsd-current
mailing list