mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 01:29:19 +08:00
ZONE(9): Disable UMA_ZONE_NUMA
There is no NUMA support in RTEMS currently.
This commit is contained in:
parent
1aeb727bd2
commit
dbb24072db
@ -281,10 +281,12 @@ uma_zone_t uma_zcache_create(char *name, int size, uma_ctor ctor, uma_dtor dtor,
|
|||||||
#define UMA_ZONE_PCPU 0x8000 /*
|
#define UMA_ZONE_PCPU 0x8000 /*
|
||||||
* Allocates mp_maxid + 1 slabs of PAGE_SIZE
|
* Allocates mp_maxid + 1 slabs of PAGE_SIZE
|
||||||
*/
|
*/
|
||||||
|
#ifndef __rtems__
|
||||||
#define UMA_ZONE_NUMA 0x10000 /*
|
#define UMA_ZONE_NUMA 0x10000 /*
|
||||||
* NUMA aware Zone. Implements a best
|
* NUMA aware Zone. Implements a best
|
||||||
* effort first-touch policy.
|
* effort first-touch policy.
|
||||||
*/
|
*/
|
||||||
|
#endif /* __rtems__ */
|
||||||
#define UMA_ZONE_NOBUCKETCACHE 0x20000 /*
|
#define UMA_ZONE_NOBUCKETCACHE 0x20000 /*
|
||||||
* Don't cache full buckets. Limit
|
* Don't cache full buckets. Limit
|
||||||
* UMA to per-cpu state.
|
* UMA to per-cpu state.
|
||||||
|
@ -404,7 +404,11 @@ bucket_init(void)
|
|||||||
size += sizeof(void *) * ubz->ubz_entries;
|
size += sizeof(void *) * ubz->ubz_entries;
|
||||||
ubz->ubz_zone = uma_zcreate(ubz->ubz_name, size,
|
ubz->ubz_zone = uma_zcreate(ubz->ubz_name, size,
|
||||||
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
|
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
|
||||||
|
#ifndef __rtems__
|
||||||
UMA_ZONE_MTXCLASS | UMA_ZFLAG_BUCKET | UMA_ZONE_NUMA);
|
UMA_ZONE_MTXCLASS | UMA_ZFLAG_BUCKET | UMA_ZONE_NUMA);
|
||||||
|
#else /* __rtems__ */
|
||||||
|
UMA_ZONE_MTXCLASS | UMA_ZFLAG_BUCKET);
|
||||||
|
#endif /* __rtems__ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -819,9 +823,11 @@ cache_drain_safe_cpu(uma_zone_t zone)
|
|||||||
b1 = b2 = NULL;
|
b1 = b2 = NULL;
|
||||||
ZONE_LOCK(zone);
|
ZONE_LOCK(zone);
|
||||||
critical_enter();
|
critical_enter();
|
||||||
|
#ifndef __rtems__
|
||||||
if (zone->uz_flags & UMA_ZONE_NUMA)
|
if (zone->uz_flags & UMA_ZONE_NUMA)
|
||||||
domain = PCPU_GET(domain);
|
domain = PCPU_GET(domain);
|
||||||
else
|
else
|
||||||
|
#endif /* __rtems__ */
|
||||||
domain = 0;
|
domain = 0;
|
||||||
cache = &zone->uz_cpu[curcpu];
|
cache = &zone->uz_cpu[curcpu];
|
||||||
if (cache->uc_allocbucket) {
|
if (cache->uc_allocbucket) {
|
||||||
@ -1787,8 +1793,10 @@ zone_ctor(void *mem, int size, void *udata, int flags)
|
|||||||
zone->uz_count_min = 0;
|
zone->uz_count_min = 0;
|
||||||
zone->uz_flags = 0;
|
zone->uz_flags = 0;
|
||||||
zone->uz_warning = NULL;
|
zone->uz_warning = NULL;
|
||||||
|
#ifndef __rtems__
|
||||||
/* The domain structures follow the cpu structures. */
|
/* The domain structures follow the cpu structures. */
|
||||||
zone->uz_domain = (struct uma_zone_domain *)&zone->uz_cpu[mp_ncpus];
|
zone->uz_domain = (struct uma_zone_domain *)&zone->uz_cpu[mp_ncpus];
|
||||||
|
#endif /* __rtems__ */
|
||||||
timevalclear(&zone->uz_ratecheck);
|
timevalclear(&zone->uz_ratecheck);
|
||||||
keg = arg->keg;
|
keg = arg->keg;
|
||||||
|
|
||||||
@ -2072,8 +2080,7 @@ uma_startup(void *mem, int npages)
|
|||||||
ksize = sizeof(struct uma_keg) +
|
ksize = sizeof(struct uma_keg) +
|
||||||
(sizeof(struct uma_domain) * vm_ndomains);
|
(sizeof(struct uma_domain) * vm_ndomains);
|
||||||
zsize = sizeof(struct uma_zone) +
|
zsize = sizeof(struct uma_zone) +
|
||||||
(sizeof(struct uma_cache) * (mp_maxid + 1)) +
|
(sizeof(struct uma_cache) * (mp_maxid + 1));
|
||||||
(sizeof(struct uma_zone_domain) * vm_ndomains);
|
|
||||||
size = 2 * roundup(zsize, CACHE_LINE_SIZE) +
|
size = 2 * roundup(zsize, CACHE_LINE_SIZE) +
|
||||||
roundup(ksize, CACHE_LINE_SIZE);
|
roundup(ksize, CACHE_LINE_SIZE);
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
@ -2603,9 +2610,11 @@ zalloc_start:
|
|||||||
if (bucket != NULL)
|
if (bucket != NULL)
|
||||||
bucket_free(zone, bucket, udata);
|
bucket_free(zone, bucket, udata);
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
if (zone->uz_flags & UMA_ZONE_NUMA)
|
if (zone->uz_flags & UMA_ZONE_NUMA)
|
||||||
domain = PCPU_GET(domain);
|
domain = PCPU_GET(domain);
|
||||||
else
|
else
|
||||||
|
#endif /* __rtems__ */
|
||||||
domain = UMA_ANYDOMAIN;
|
domain = UMA_ANYDOMAIN;
|
||||||
|
|
||||||
/* Short-circuit for zones without buckets and low memory. */
|
/* Short-circuit for zones without buckets and low memory. */
|
||||||
@ -2682,9 +2691,13 @@ zalloc_start:
|
|||||||
* initialized bucket to make this less likely or claim
|
* initialized bucket to make this less likely or claim
|
||||||
* the memory directly.
|
* the memory directly.
|
||||||
*/
|
*/
|
||||||
|
#ifndef __rtems__
|
||||||
if (cache->uc_allocbucket != NULL ||
|
if (cache->uc_allocbucket != NULL ||
|
||||||
(zone->uz_flags & UMA_ZONE_NUMA &&
|
(zone->uz_flags & UMA_ZONE_NUMA &&
|
||||||
domain != PCPU_GET(domain)))
|
domain != PCPU_GET(domain)))
|
||||||
|
#else /* __rtems__ */
|
||||||
|
if (cache->uc_allocbucket != NULL)
|
||||||
|
#endif /* __rtems__ */
|
||||||
LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link);
|
LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link);
|
||||||
else
|
else
|
||||||
cache->uc_allocbucket = bucket;
|
cache->uc_allocbucket = bucket;
|
||||||
@ -3162,7 +3175,11 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata)
|
|||||||
uma_cache_t cache;
|
uma_cache_t cache;
|
||||||
uma_bucket_t bucket;
|
uma_bucket_t bucket;
|
||||||
uma_zone_domain_t zdom;
|
uma_zone_domain_t zdom;
|
||||||
|
#ifndef __rtems__
|
||||||
int cpu, domain, lockfail;
|
int cpu, domain, lockfail;
|
||||||
|
#else /* __rtems__ */
|
||||||
|
int cpu, lockfail;
|
||||||
|
#endif /* __rtems__ */
|
||||||
#ifdef INVARIANTS
|
#ifdef INVARIANTS
|
||||||
bool skipdbg;
|
bool skipdbg;
|
||||||
#endif
|
#endif
|
||||||
@ -3279,10 +3296,12 @@ zfree_start:
|
|||||||
/* We are no longer associated with this CPU. */
|
/* We are no longer associated with this CPU. */
|
||||||
critical_exit();
|
critical_exit();
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
if ((zone->uz_flags & UMA_ZONE_NUMA) != 0)
|
if ((zone->uz_flags & UMA_ZONE_NUMA) != 0)
|
||||||
domain = PCPU_GET(domain);
|
domain = PCPU_GET(domain);
|
||||||
else
|
else
|
||||||
domain = 0;
|
domain = 0;
|
||||||
|
#endif /* __rtems__ */
|
||||||
zdom = &zone->uz_domain[0];
|
zdom = &zone->uz_domain[0];
|
||||||
|
|
||||||
/* Can we throw this on the zone full list? */
|
/* Can we throw this on the zone full list? */
|
||||||
@ -3317,9 +3336,13 @@ zfree_start:
|
|||||||
critical_enter();
|
critical_enter();
|
||||||
cpu = curcpu;
|
cpu = curcpu;
|
||||||
cache = &zone->uz_cpu[cpu];
|
cache = &zone->uz_cpu[cpu];
|
||||||
|
#ifndef __rtems__
|
||||||
if (cache->uc_freebucket == NULL &&
|
if (cache->uc_freebucket == NULL &&
|
||||||
((zone->uz_flags & UMA_ZONE_NUMA) == 0 ||
|
((zone->uz_flags & UMA_ZONE_NUMA) == 0 ||
|
||||||
domain == PCPU_GET(domain))) {
|
domain == PCPU_GET(domain))) {
|
||||||
|
#else /* __rtems__ */
|
||||||
|
if (cache->uc_freebucket == NULL) {
|
||||||
|
#endif /* __rtems__ */
|
||||||
cache->uc_freebucket = bucket;
|
cache->uc_freebucket = bucket;
|
||||||
goto zfree_start;
|
goto zfree_start;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,11 @@ struct uma_zone {
|
|||||||
/* Offset 0, used in alloc/free fast/medium fast path and const. */
|
/* Offset 0, used in alloc/free fast/medium fast path and const. */
|
||||||
struct mtx *uz_lockptr;
|
struct mtx *uz_lockptr;
|
||||||
const char *uz_name; /* Text name of the zone */
|
const char *uz_name; /* Text name of the zone */
|
||||||
|
#ifndef __rtems__
|
||||||
struct uma_zone_domain *uz_domain; /* per-domain buckets */
|
struct uma_zone_domain *uz_domain; /* per-domain buckets */
|
||||||
|
#else /* __rtems__ */
|
||||||
|
struct uma_zone_domain uz_domain[1]; /* per-domain buckets */
|
||||||
|
#endif /* __rtems__ */
|
||||||
uint32_t uz_flags; /* Flags inherited from kegs */
|
uint32_t uz_flags; /* Flags inherited from kegs */
|
||||||
uint32_t uz_size; /* Size inherited from kegs */
|
uint32_t uz_size; /* Size inherited from kegs */
|
||||||
uma_ctor uz_ctor; /* Constructor for each allocation */
|
uma_ctor uz_ctor; /* Constructor for each allocation */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user