Age | Commit message (Collapse) | Author |
|
|
|
cpu_info.
|
|
this moves the size of the pool page (not arch page) out of the
pool allocator into struct pool. this lets us create only two pools
for the automatically determined large page allocations instead of
256 of them.
while here support using slack space in large pages for the
pool_item_header by requiring km_alloc provide pool page aligned
memory.
lastly, instead of doing incorrect math to figure how how many arch
pages to use for large pool pages, just use powers of two.
ok mikeb@
|
|
|
|
discussion, help and ok guenther@
|
|
provide the magic.
ok matthew@ dlg@
|
|
this should provide a degree of scan resistance, and also serves as a
midway point for further development of multi queue algorithms.
i've tried to minimize the risk and degree of regressions.
probably ok beck
|
|
|
|
|
|
when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC,
SOCK_CLOEXEC. Includes SOCK_NONBLOCK support.
ok matthew@
|
|
for the protective ones when creating a fake label, but do, for the system
ones, so that we may eventually copy boot code to them.
From Markus Mueller
|
|
|
|
cut it out of the code to simplify things.
ok mikeb@
|
|
The interface has been disabled by default for about 4 years and
currently there's not much value in having it around at all.
ok deraadt
|
|
add an explicit rwlock around the global state (the pool list and serial
number) rather than rely on implicit process exclusion, splhigh and splvm.
the only things touching the global state come from process context so we
can get away with an rwlock instead of a mutex. thankfully.
ok matthew@
|
|
ok miod@, who has offerred to help with any MD fallout
ok guenther@
|
|
and a count of the mbufs.
struct mbuf_list and the ml_foo() apis can be used to build lists of
mbufs where you dont need locking (eg, on the stack).
struct mbuf_queue and mq_foo() wrap mbuf_lists with a mutex, and
limits the number of mbufs that can be queued. they can be useful
for moving mbufs between contexts/subsystems.
with help from jmc@ for the manpage bits
mpi@ is keen
|
|
containing an item when its returned to the pool. this means you
need to do an inexact comparison between an items address and the
page address, cos a pool page can contain many items.
previously this used RB_FIND with a compare function that would do math
on every node comparison to see if one node (the key) was within the other
node (the tree element).
this cuts it over to using RB_NFIND to find the closest tree node
instead of the exact tree node. the node compares turns into simple
< and > operations, which inline very nicely with the RB_NFIND. the
constraint (an item must be within a page) is then checked only
once after the NFIND call.
feedback from matthew@ and tedu@
|
|
made it so struct pool was only visible to _KERNEL. tedu broke it
too when he added the size argument to the kernel free
functions.
this fixes both issues. the main change is to provide a local version of
struct pool with just the bit (pr_size) needed for extent to run.
if extents take advantage of more malloc/pool features (eg, {M,PR}_ZERO
then this will need to be updated again.
found by and based on a diff from Theo Buehler
ok mpi@
|
|
|
|
|
|
the sysctl path exists. return ENOENT instead of trying a NULL
deref.
|
|
matthew@ noticed i wasnt populating npages in the kinfo_pool sent to
userland.
|
|
inline is the new __inline
|
|
protect pool_list rather than the rwlock that made i386 blow up:
provide a pool_count global so we can figure out how many pools there are
active without having to walk the global pool_list.
|
|
once after it is over.
|
|
provide a pool_count global so we can figure out how many pools there are
active without having to walk the global pool_list.
|
|
take the pools mutex when copying stats out of it in the sysctl
path so we are guaranteed a consistent snapshot.
|
|
even if sysctl kern.nosuidcoredump has been set to 2 or 3. This
allows a regular user to debug his programs again.
OK guenther@ deraadt@
|
|
iov_len to 0, we need a propper length calculation. While there,
use -1 for the file descriptor because 0 is reserved for stdin.
OK deraadt@ guenther@
|
|
and return the current current CPU, otherwise sched_stop_secondary_cpus()
will spin forever trying to empty its run queues. Fixes hangs during suspend
that many people reported over the last couple of days.
ok bcook@, guenther@
|
|
ok miod@, deraadt@, shadchin@
|
|
Some of them aren't too difficult to find and fix, but others are turning
out to be deeply hidden. The timing is poor -- disable this for now.
We need to revisit this right after tree unlock.
|
|
|
|
|
|
much help and ok from deraadt@
|
|
|
|
|
|
|
|
KASSERT() is annoying as it only prints the expression as a string. If you
(developers) want to know a little more information, you have to do:
#ifdef DIAGNOSTIC
if (bad)
panic(...);
#endif
KASSERTMSG() replaces it into a single line:
KASSERTMSG(!bad, ...);
Taken from NetBSD.
(There is a concern that KASSERT() messages are too long; consume more memory,
and not friendly for small monitors. This have to be considered & revisited
later.)
"Like" from henning@
Man page review & advices from jmc@ and schwarze@
|
|
TAILQ_FOREACH() isn't safe to use in sched_chooseproc() to iterate
over the run queues because within the loop body we remove the threads
from their run queues and reinsert them elsewhere. As a result, we
end up only draining the first thread of each run queue rather than
all of them.
ok kettenis
|
|
receiving broadcast signals (kill -1). The flag can be set via a new
sysctl KERN_PROC_NOBROADCASTKILL. This will be used by iscsid to survive
the mass killing by init(8) when terminating multi-user operations.
With and OK guenther@
|
|
|
|
|
|
This adds a new assertion macro, KERNEL_ASSERT_LOCKED(), to assert that
kernel_lock is held. In the long process of removing kernel_lock, there will
be a lot (hundreds or thousands) of use of this; virtually almost all functions
in !MP-safe subsystems should have this assertion. Thus this assertion should
have a short, good name.
Not only that "KERNEL_ASSERT_LOCKED" is consistent with other KERNEL_* and
SCHED_ASSERT_LOCKED() macros.
Input from dlg@ guenther@ kettenis@.
OK dlg@ guenther@
|
|
Contributed by Markus Mueller; code based upon Bitrig's GPT support, with
stricter GPT structures validation and support for alternate header places.
ok deraadt@ jsing@ krw@
|
|
|
|
|
|
|
|
not have any threads left. Treat that the same as an empty pgrp.
encountered by and ok deraadt@
|