Commit 7a4ff5c0 authored by HardenedBSD Sync Service's avatar HardenedBSD Sync Service
Browse files

Merge branch 'freebsd/current/main' into hardened/current/master

parents 8705ea67 d7f944a0
......@@ -550,9 +550,6 @@ ATF_TC_BODY(setrlimit_stack, tc)
{
struct rlimit res;
if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
atf_tc_skip("https://bugs.freebsd.org/259969");
/* Ensure soft limit is not bigger than hard limit */
res.rlim_cur = res.rlim_max = 4192256;
ATF_REQUIRE(setrlimit(RLIMIT_STACK, &res) == 0);
......
......@@ -332,9 +332,6 @@ ATF_TC_BODY(stat_socket, tc)
uint32_t iaddr;
int fd, flags;
if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
atf_tc_skip("https://bugs.freebsd.org/240621");
(void)memset(&st, 0, sizeof(struct stat));
(void)memset(&addr, 0, sizeof(struct sockaddr_in));
......@@ -353,14 +350,14 @@ ATF_TC_BODY(stat_socket, tc)
errno = 0;
ATF_REQUIRE_ERRNO(EINPROGRESS,
connect(fd, (struct sockaddr *)&addr,
sizeof(struct sockaddr_in)) == -1);
ATF_REQUIRE(connect(fd, (struct sockaddr *)&addr,
sizeof(struct sockaddr_in)) == -1);
ATF_REQUIRE(errno == EINPROGRESS || errno == ECONNREFUSED);
errno = 0;
if (fstat(fd, &st) != 0 || errno != 0)
atf_tc_fail("fstat(2) failed for a EINPROGRESS socket");
atf_tc_fail("fstat(2) failed for a socket");
(void)close(fd);
}
......
......@@ -290,7 +290,7 @@ status change events can be set up by using the following devd.conf rule:
.Bd -literal -offset indent
notify 0 {
match "system" "CARP";
match "subsystem" "[0-9]+@[0-9a-z]+";
match "subsystem" "[0-9]+@[0-9a-z\.]+";
match "type" "(MASTER|BACKUP)";
action "/root/carpcontrol.sh $subsystem $type";
};
......
......@@ -35,8 +35,6 @@
.In sys/param.h
.In sys/queue.h
.In vm/uma.h
.Cd "options UMA_FIRSTTOUCH"
.Cd "options UMA_XDOMAIN"
.Bd -literal
typedef int (*uma_ctor)(void *mem, int size, void *arg, int flags);
typedef void (*uma_dtor)(void *mem, int size, void *arg);
......@@ -322,24 +320,6 @@ The zone is for the
subsystem.
.It Dv UMA_ZONE_VM
The zone is for the VM subsystem.
.It Dv UMA_ZONE_NUMA
The zone should use a first-touch NUMA policy rather than the round-robin
default.
If the
.Dv UMA_FIRSTTOUCH
kernel option is configured, all zones implicitly use a first-touch policy,
and the
.Dv UMA_ZONE_NUMA
flag has no effect.
The
.Dv UMA_XDOMAIN
kernel option, when configured, causes UMA to do the extra tracking to ensure
that allocations from first-touch zones are always local.
Otherwise, consumers that do not free memory on the same domain from which it
was allocated will cause mixing in per-CPU caches.
See
.Xr numa 4
for more details.
.It Dv UMA_ZONE_CONTIG
Items in this zone must be contiguous in physical address space.
Items will follow normal alignment constraints and may span page boundaries
......
......@@ -35,6 +35,10 @@ _PRIVATELIBS= \
unbound \
zstd
# Let projects based on FreeBSD append to _PRIVATELIBS
# by maintaining their own LOCAL_PRIVATELIBS list.
_PRIVATELIBS+= ${LOCAL_PRIVATELIBS}
_INTERNALLIBS= \
amu \
bsnmptools \
......@@ -79,6 +83,10 @@ _INTERNALLIBS= \
wpautils \
wpawps
# Let projects based on FreeBSD append to _INTERNALLIBS
# by maintaining their own LOCAL_INTERNALLIBS list.
_INTERNALLIBS+= ${LOCAL_INTERNALLIBS}
_LIBRARIES= \
${_PRIVATELIBS} \
${_INTERNALLIBS} \
......
......@@ -5057,6 +5057,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
ifp = ctx->ifc_ifp;
iflib_reset_qvalues(ctx);
IFNET_WLOCK();
CTX_LOCK(ctx);
if ((err = IFDI_ATTACH_PRE(ctx)) != 0) {
device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err);
......@@ -5250,6 +5251,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
iflib_add_pfil(ctx);
ctx->ifc_flags |= IFC_INIT_DONE;
CTX_UNLOCK(ctx);
IFNET_WUNLOCK();
return (0);
......@@ -5265,6 +5267,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
iflib_free_intr_mem(ctx);
fail_unlock:
CTX_UNLOCK(ctx);
IFNET_WUNLOCK();
iflib_deregister(ctx);
fail_ctx_free:
device_set_softc(ctx->ifc_dev, NULL);
......
......@@ -1051,6 +1051,7 @@ cache_fetch_bucket(uma_zone_t zone, uma_cache_t cache, int domain)
{
uma_zone_domain_t zdom;
uma_bucket_t bucket;
smr_seq_t seq;
/*
* Avoid the lock if possible.
......@@ -1060,7 +1061,8 @@ cache_fetch_bucket(uma_zone_t zone, uma_cache_t cache, int domain)
return (NULL);
if ((cache_uz_flags(cache) & UMA_ZONE_SMR) != 0 &&
!smr_poll(zone->uz_smr, zdom->uzd_seq, false))
(seq = atomic_load_32(&zdom->uzd_seq)) != SMR_SEQ_INVALID &&
!smr_poll(zone->uz_smr, seq, false))
return (NULL);
/*
......
......@@ -1902,6 +1902,7 @@ static struct mtx vm_oom_ratelim_mtx;
void
vm_pageout_oom(int shortage)
{
const char *reason;
struct proc *p, *bigproc;
vm_offset_t size, bigsize;
struct thread *td;
......@@ -2014,11 +2015,25 @@ vm_pageout_oom(int shortage)
}
}
sx_sunlock(&allproc_lock);
if (bigproc != NULL) {
switch (shortage) {
case VM_OOM_MEM:
reason = "failed to reclaim memory";
break;
case VM_OOM_MEM_PF:
reason = "a thread waited too long to allocate a page";
break;
case VM_OOM_SWAPZ:
reason = "out of swap space";
break;
default:
panic("unknown OOM reason %d", shortage);
}
if (vm_panic_on_oom != 0 && --vm_panic_on_oom == 0)
panic("out of swap space");
panic("%s", reason);
PROC_LOCK(bigproc);
killproc(bigproc, "out of swap space");
killproc(bigproc, reason);
sched_nice(bigproc, PRIO_MIN);
_PRELE(bigproc);
PROC_UNLOCK(bigproc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment