diff options
author | Matt Macy <mmacy@FreeBSD.org> | 2018-07-06 02:06:03 +0000 |
---|---|---|
committer | Matt Macy <mmacy@FreeBSD.org> | 2018-07-06 02:06:03 +0000 |
commit | ab3059a8e7f382cff93dbe4d1b082adf62f4d849 (patch) | |
tree | 07b63f9da9282cc1b73ec6d51ce3988dbc08875f /sys/amd64/include | |
parent | 88171893e296f0c142cc7ee55db6244d2f6e76be (diff) | |
download | src-ab3059a8e7f382cff93dbe4d1b082adf62f4d849.tar.gz src-ab3059a8e7f382cff93dbe4d1b082adf62f4d849.zip |
Back pcpu zone with domain correct pages
- Change pcpu zone consumers to use a stride size of PAGE_SIZE.
(defined as UMA_PCPU_ALLOC_SIZE to make future identification easier)
- Allocate page from the correct domain for a given cpu.
- Don't initialize pc_domain to non-zero value if NUMA is not defined
There are some misconceptions surrounding this field. It is the
_VM_ NUMA domain and should only ever correspond to valid domain
values as understood by the VM.
The former slab size of sizeof(struct pcpu) was somewhat arbitrary.
The new value is PAGE_SIZE because that's the smallest granularity
which the VM can allocate a slab for a given domain. If you have
fewer than PAGE_SIZE/8 counters on your system there will be some
memory wasted, but this is obviously something where you want the
cache line to be coming from the correct domain.
Reviewed by: jeff
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15933
Notes
Notes:
svn path=/head/; revision=336020
Diffstat (limited to 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/counter.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/include/counter.h b/sys/amd64/include/counter.h index 3e628f3f7a57..2255a0575a0c 100644 --- a/sys/amd64/include/counter.h +++ b/sys/amd64/include/counter.h @@ -45,7 +45,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (*(uint64_t *)((char *)p + sizeof(struct pcpu) * cpu)); + return (*(uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * cpu)); } static inline uint64_t @@ -65,7 +65,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - *((uint64_t *)((char *)arg + sizeof(struct pcpu) * + *((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * PCPU_GET(cpuid))) = 0; } |