Age | Commit message (Collapse) | Author |
|
receive buffer of a stream socket. Then a new pair of control and
data mbuf can be appended to the mbuf queue. In this case, terminate
the loop with a short read to prevent a panic. Userland should
read the control message with the next system call.
OK claudio@ deraadt@
|
|
OK deraadt@ anton@
|
|
jsg@ wants this for drm, and i've had a version of it in diffs sine
2016, but obviously havent needed to use it just yet.
task_pending is modelled on timeout_pending, and tells you if the
task is on a list waiting to execute.
ok jsg@
|
|
ok bluhm@, visa@
|
|
ok bluhm@, visa@
|
|
ok visa@
|
|
to pass the real count, with a minimal .shstrtab segment for consistency.
Also, add support for PN_XNUM to readelf.
problem reported and testing by claudio@
ok kettenis@
|
|
ok tedu@
|
|
ok ratchov@
|
|
OK bluhm@
|
|
tvtohz(9) adds an extra tick to account for the present tick, but this
tick needs to be removed when the timeout is reloaded thereafter. We
already do this for periodic setitimer(2) timeouts.
Prompted by Paul Herman's writeup on clock aliasing for DragonflyBSD:
https://frenchfries.net/paul/dfly/nanosleep.html
Also fixed in FreeBSD r238424.
Style tweaks from visa.
ok visa@, guenther@
|
|
underflow in a later calcuation. Using the same CMSG_LEN(0) check
that other cmsghdr handlers implemented.
Probelm found by anton@
OK anton@, deraadt@, visa@
|
|
SCM_RIGHTS from being sent to the userland since they hold kernel internal
data and it does not make sense to externalize it.
OK deraadt@, guenther@, visa@
|
|
ok mikeb@, visa@
|
|
|
|
OK mpi@
|
|
Because of hw.smt we need a way to determine whether a given CPU is "online"
or "offline" from userspace. KERN_CPTIME2 is an array, and so cannot be
cleanly extended for this purpose, so add a new sysctl(2) KERN_CPUSTATS
with an extensible struct. At the moment it's just KERN_CPTIME2 with a
flags member, but it can grow as needed.
KERN_CPUSTATS appears to have been defined by BSDi long ago, but there are
few (if any) packages in the wild still using the symbol so breakage in ports
should be near zero. No other system inherited the symbol from BSDi, either.
Then, use the new sysctl(2) in systat(1) and top(1):
- systat(1) draws placeholder marks ('-') instead of percentages for
offline CPUs in the cpu view.
- systat(1) omits offline CPU ticks when drawing the "big bar" in
the vmstat view. The upshot is that the bar isn't half idle when
half your logical CPUs are disabled.
- top(1) does not draw lines for offline CPUs; if CPUs toggle on or
offline in interactive mode we redraw the display to expand/reduce
space for the new/missing CPUs. This is consistent with what some
top(1) implementations do on Linux.
- top(1) omits offline CPUs from the totals when CPU totals are
combined into a single line (the '-1' flag).
Originally prompted by deraadt@. Discussed endlessly with deraadt@,
ketennis@, and sthen@. Tested by jmc@ and jca@. Earlier versions also
discussed with jca@. Earlier versions tested by jmc@, tb@, and many
others.
docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@,
"Is your stuff in yet?" deraadt@
|
|
From NetBSD (maxv). OK deraadt@ visa@
|
|
|
|
|
|
of kern_descrip.c r1.177 and sys_pipe.c r1.82, the call always
returned an error.
OK jca@ anton@ mpi@
|
|
handle arg as a process ID if the value is positive and as a process
group ID if the value is negative. In addition, now the signal sending
checks privileges.
OK mpi@
|
|
It centralizes IO signal privilege checking and makes possible to revoke
a registration when the target process or process group is deleted.
Adapted from FreeBSD.
OK kettenis@ mpi@ guenther@
|
|
all types of mbufs. Also introduce some KASSERT in the m_*space() functions
to ensure that no negative number is returned. This also introduces two
internal macros M_SIZE() & M_DATABUF() which return the right size and start
pointer of the mbuf data area. Use it in a few obvious places to simplify code.
OK bluhm@
|
|
|
|
posix file locks is defined. Also, detect overflows when dealing with positive
lengths.
ok millert@ visa@
|
|
m_leadingspace() and m_trailingspace(). Convert all callers to call
directly the functions and remove the defines.
OK krw@, mpi@
|
|
|
|
|
|
|
|
binary so it should bypass unveil restrictions. This is similar
(but different...) to how the ELF linker (ld.so) is loaded (after
unveils get dropped). Discovered in doas, due to more accurate unveil
semantics.
ok guenther tedu beck
|
|
|
|
back rev 1.90.
----
mbufs and mbuf clusters are now backed by large pools. Because of this
we can relax the oversubscribe limit of socketbuffers a fair bit.
Instead of maxing out as sb_max * 1.125 or 2 * sb_hiwat the maximum is
increased to 8 * sb_hiwat -- which seems to be a good compromise between
memory waste and better socket buffer usage.
OK deraadt@
----
ok benno@
|
|
|
|
unveil for each unveil in the process at unveil() time, and refactoring the
handling of current directory and ISDOTDOT to be much more sensible.
Worked out at ns2k18 with guenther@.
ok deraadt@
|
|
While here, improve existing lockf debug routines and sprinkle some more logging
related to list manipulation.
ok deraadt@ visa@ (as part of a larger diff)
|
|
runs. This is a second attempt in which the lockf structure is turned into a
doubly linked list which makes it easier to ensure correctness during list
insertion and deletion.
ok deraadt@ visa@
|
|
If a connection that is being accepted gets aborted early, or if the
user-supplied buffer is invalid, doaccept() leaks a socket. This is
a regression caused by r1.153 of uipc_syscalls.c.
Correct the issue by associating the socket with the file early enough.
In case soaccept() or copyaddrout() fails, the socket will be freed
as a result of the file closing. This logic was used by the pre-r1.153
code.
closef() may block, so it is hoisted outside the fdp lock.
OK bluhm@ mpi@
|
|
Change the process time accounting back to the original code before
spinning time was added. No change for scheduler time. Spinning
interrupts are no longer accounted to process system time.
input and OK visa@
|
|
introduced. Account spinning time to the process system time again.
time(1) has no spinning, it only shows real, user, sys.
OK visa@ mpi@ deraadt@
|
|
This brings it back in line with the macros.
via Paco A. and the FRRouting project.
ok deraadt@ visa@ guenther@ tb@
|
|
update the next pointer for the preceding lock. Prevents a double free panic.
ok millert@
|
|
ok kettenis deraadt
|
|
race between the reaper and unveil_removevnode() that would trigger a
KASSERT. At least as far as I can tell. Pointed out by semarie@
ok beck@, deraadt@
|
|
in raw IP delivery and UDP broadcast loops. There inpcbtable_mtx
is held and sorwakeup() is called within the loop. As sowakeup()
grabs the kernel lock, we have a lock ordering problem.
found by Hrvoje Popovski; OK deraadt@ mpi@
|
|
to unsigned int.
OK deraadt@
|
|
This lets userspace distinguish between idle CPUs and those that are
not schedulable because hw.smt=0.
A subsequent commit probably needs to add documentation for this
to sysctl.2 (and perhaps elsewhere) after the dust settles.
Also included here are changes to systat(1) and top(1) that account
for the ENODEV case and adjust behavior accordingly:
- systat(1)'s cpu view prints placeholder marks ('-') instead of
percentages for each state if the given CPU is offline.
- systat(1)'s vmstat view checks for offline CPUs when computing the
machine state total and excludes them, so the CPU usage graph
only represents the states for online CPUs.
- top(1) does not draw CPU rows for offline CPUs when the view is
redrawn. If CPUs "go offline", percentages for each state are
replaced by placeholder marks ('-'); the view will need to be
redrawn to remove these rows. If CPUs "go online" the view will
need to be redrawn to show these new CPUs. In "combined CPU" mode,
the count and the state totals only represent online CPUs.
Ports using KERN_CPTIME2 will need to be updated. The changes
described above to make systat(1) and top(1) aware of the ENODEV
case *and* gracefully handle a changing HW_NCPUONLINE while the
application is running are not necessarily appropriate for each
and every port.
The changes described above are so extensive in part to demonstrate
one way a program *might* be made robust to changing CPU availability.
In particular, changing hw.smt after boot is an extremely rare event,
and this needs to be weighed when updating ports.
The logic needed to account for the KERN_CPTIME2 ENODEV case is
very roughly:
if (sysctl(...) == -1) {
if (errno != ENODEV) {
/* Actual error occurred. */
} else {
/* CPU is offline. */
}
} else {
/* CPU is online and CPU states were set by sysctl(2). */
}
Prompted by deraadt@. Basic idea for ENODEV from kettenis@. Discussed at
length with kettenis@. Additional testing by tb@.
No complaints from hackers@ after a week.
ok kettenis@, "I think you should commit [now]" deraadt@
|
|
dedicated functions.
OK deraadt@ mpi@
|
|
ok beck@
|
|
We were using spacing after ellipses in an inconsistent way in the
installer. Standardize on using "... " everywhere and take into account
the cursor position while we are waiting for the task to complete: the
cursor is now always positioned after the last dot, and the space is
added when displaying completion confirmation.
While there, also take cursor position into account in vfs_shutdown(),
and remove the extra leading space before ticks in dhclient.
OK deraadt@
|