Update to FreeBSD head 2017-10-01

Git mirror commit b2f0376b45428f13151d229c5ae9d4d8f74acbd1.

Update #3472.
This commit is contained in:
Sebastian Huber
2018-08-09 13:04:41 +02:00
parent c37f9fba70
commit e4a8065910
164 changed files with 2619 additions and 1406 deletions

View File

@@ -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.

View File

@@ -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) &&

View File

@@ -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 */