mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 07:15:58 +08:00
Update to FreeBSD head 2017-10-01
Git mirror commit b2f0376b45428f13151d229c5ae9d4d8f74acbd1. Update #3472.
This commit is contained in:
@@ -296,6 +296,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma_ctor ctor, uma_dtor dtor,
|
||||
#define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */
|
||||
#define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */
|
||||
#define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */
|
||||
#define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */
|
||||
|
||||
/*
|
||||
* Destroys an empty uma zone. If the zone is not empty uma complains loudly.
|
||||
|
@@ -152,7 +152,7 @@ static LIST_HEAD(,uma_zone) uma_cachezones =
|
||||
LIST_HEAD_INITIALIZER(uma_cachezones);
|
||||
|
||||
/* This RW lock protects the keg list */
|
||||
static struct rwlock_padalign uma_rwlock;
|
||||
static struct rwlock_padalign __exclusive_cache_line uma_rwlock;
|
||||
|
||||
#ifndef __rtems__
|
||||
/*
|
||||
@@ -1367,10 +1367,6 @@ keg_large_init(uma_keg_t keg)
|
||||
keg->uk_ipers = 1;
|
||||
keg->uk_rsize = keg->uk_size;
|
||||
|
||||
/* We can't do OFFPAGE if we're internal, bail out here. */
|
||||
if (keg->uk_flags & UMA_ZFLAG_INTERNAL)
|
||||
return;
|
||||
|
||||
/* Check whether we have enough space to not do OFFPAGE. */
|
||||
if ((keg->uk_flags & UMA_ZONE_OFFPAGE) == 0) {
|
||||
shsize = sizeof(struct uma_slab);
|
||||
@@ -1378,8 +1374,17 @@ keg_large_init(uma_keg_t keg)
|
||||
shsize = (shsize & ~UMA_ALIGN_PTR) +
|
||||
(UMA_ALIGN_PTR + 1);
|
||||
|
||||
if ((PAGE_SIZE * keg->uk_ppera) - keg->uk_rsize < shsize)
|
||||
keg->uk_flags |= UMA_ZONE_OFFPAGE;
|
||||
if (PAGE_SIZE * keg->uk_ppera - keg->uk_rsize < shsize) {
|
||||
/*
|
||||
* We can't do OFFPAGE if we're internal, in which case
|
||||
* we need an extra page per allocation to contain the
|
||||
* slab header.
|
||||
*/
|
||||
if ((keg->uk_flags & UMA_ZFLAG_INTERNAL) == 0)
|
||||
keg->uk_flags |= UMA_ZONE_OFFPAGE;
|
||||
else
|
||||
keg->uk_ppera++;
|
||||
}
|
||||
}
|
||||
|
||||
if ((keg->uk_flags & UMA_ZONE_OFFPAGE) &&
|
||||
|
@@ -28,6 +28,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/_bitset.h>
|
||||
#include <sys/_task.h>
|
||||
|
||||
/*
|
||||
@@ -210,7 +211,7 @@ struct uma_keg {
|
||||
vm_offset_t uk_kva; /* Zone base KVA */
|
||||
uma_zone_t uk_slabzone; /* Slab zone backing us, if OFFPAGE */
|
||||
|
||||
uint16_t uk_pgoff; /* Offset to uma_slab struct */
|
||||
uint32_t uk_pgoff; /* Offset to uma_slab struct */
|
||||
uint16_t uk_ppera; /* pages per allocation from backend */
|
||||
uint16_t uk_ipers; /* Items per slab */
|
||||
uint32_t uk_flags; /* Internal flags */
|
||||
|
Reference in New Issue
Block a user