Commit Graph

198 Commits

Author SHA1 Message Date
martin 3007f1403a Back out the following revisions on behalf of core:
sys/sys/lwp.h: revision 1.228
	sys/sys/pipe.h: revision 1.40
	sys/kern/uipc_socket.c: revision 1.306
	sys/kern/kern_sleepq.c: revision 1.84
	sys/rump/librump/rumpkern/locks_up.c: revision 1.13
	sys/kern/sys_pipe.c: revision 1.165
	usr.bin/fstat/fstat.c: revision 1.119
	sys/rump/librump/rumpkern/locks.c: revision 1.87
	sys/ddb/db_xxx.c: revision 1.78
	sys/ddb/db_command.c: revision 1.187
	sys/sys/condvar.h: revision 1.18
	sys/ddb/db_interface.h: revision 1.42
	sys/sys/socketvar.h: revision 1.166
	sys/kern/uipc_syscalls.c: revision 1.209
	sys/kern/kern_condvar.c: revision 1.60

  Add cv_fdrestart() [...]
  Use cv_fdrestart() to implement fo_restart.
  Simplify/streamline pipes a little bit [...]

This changes have caused regressions and need to be debugged.
The cv_fdrestart() addition needs more discussion.
2023-11-02 10:31:55 +00:00
ad 61757a071b Simplify/streamline pipes a little bit:
- Allocate only one struct pipe not two (no need to be bidirectional here).
- Then use f_flag (FREAD/FWRITE) to figure out what to do in the fileops.
- Never wake the other side or acquire long-term (I/O) lock unless needed.
- Whenever possible, defer wakeups until after locks have been released.
- Do some things locklessly in pipe_ioctl() and pipe_poll().

Some notable results:

- -30% latency on a 486DX2/66 doing 1 byte ping-pong within a single process.
- 2.5x less lock contention during "make cleandir" of src on a 48 CPU machine.
- 1.5x bandwith with 1kB messages on the same 48 CPU machine (8kB: same b/w).
2023-10-13 19:07:08 +00:00
riastradh ff3504bd37 sys: Rename sys/miscfd.h -> sys/memfd.h.
Let's not create new dumping grounds for miscellaneous stuff; one
header file for one purpose.
2023-07-29 08:46:47 +00:00
christos d46449bb48 move the memfd struct to a separate file. Requested by riastradh@ 2023-07-10 15:49:18 +00:00
christos 7eace3da0c Add memfd_create(2) from GSoC 2023 by Theodore Preduta 2023-07-10 02:31:54 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
ozaki-r be0f86d642 Adjust userland commands for struct inpcb separation
Only kvm users are affected.
2022-10-28 05:27:16 +00:00
ozaki-r 1fc70a0860 Adjust userland commands for struct inpcb integration
Only kvm users are affected.
2022-10-28 05:24:07 +00:00
simonb 77228a74f8 Add basic ZFS support to fstat(1).
XXX: Use a local zfs_znode.h for a znode_t definition because the ZFS
kernel code makes it too hard to include headers from userland.
2022-06-19 11:31:19 +00:00
isaki baa8677bbf Support audio descriptor for fstat(1).
sys/dev/audio/*.h: export only what we need for fstat.
2020-09-13 04:14:48 +00:00
christos f55490be1e Provide a helpful error message if we don't have privs to read kernel
addresses.
2020-08-26 23:08:29 +00:00
christos 485ee48134 nuke random stuff that does not exist anymore. 2020-05-02 18:42:30 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
wiz 2555b24764 Use \(em. 2019-09-06 19:05:04 +00:00
christos ebe962e4c8 Add -O to print offsets; align columns properly. 2019-09-06 17:08:22 +00:00
thorpej 68e270a267 Implement support for "pshared" POSIX semaphores.
Fixes lib/53273 (and Firefox's multi-process tab feature).
2019-02-03 03:20:23 +00:00
mrg fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
msaitoh 204f26c6d9 Print BPF direction correctly. 2018-06-26 10:00:25 +00:00
msaitoh 3cd62456f9 Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

 This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
2018-06-26 06:47:57 +00:00
nat 911089b591 Update fstat for audio(4) and pad(4) devices.
XXX - pullup 8.

Ok christos@.
2018-06-04 01:42:49 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
chs ffdbc0ccea rearrange sys/mount.h so that all of the kernel-only parts are together
and not exposed to userland, except do expose struct mount if __EXPOSE_MOUNT
is defined.  define __EXPOSE_MOUNT in the kmem grovellers that want
the definition.  needed for ZFS.
2017-06-09 00:13:29 +00:00
christos f51d1f25b9 Print the interface for bpf. 2016-12-30 21:08:23 +00:00
mrg 0537635d0c for 64 bit mips platforms where we built userland largely as n32 by
default, build a handful of tools as n64 so they work properly.

unfortunately, they're also static as dynamic n64 has a problem.

of these tools pstat is probably the lowest hanging fruit to convert
to sysctl.  systat would be close were it not for the netstat screen,
which includes netstat itself.

the rest are difficult to perhaps foolish.


the upside is that netstat, pmap and fstat all work properly now.
2016-12-23 10:19:57 +00:00
christos 3c25de4497 put _KMEMUSER in the Makefile 2016-01-23 16:12:03 +00:00
christos 2732a80b37 Add rnd ops. 2015-12-30 18:15:38 +00:00
christos dade5d6c98 print the tag symbolically if we don't support it. 2015-12-22 23:35:21 +00:00
mlelstv 170fbd6544 Resolve names of datagram services correctly. 2015-03-08 06:46:51 +00:00
snj f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
tls ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
christos d2bf840533 fix protocol printing order. 2014-02-14 20:43:34 +00:00
christos c7b4698e4c make fstat -f search for unix sockets. 2014-01-17 03:28:01 +00:00
mlelstv 9a7a6e815f Fix output for -A -f ... 2013-12-15 18:56:59 +00:00
wiz 82c52eb924 sync usage with man page 2013-12-15 09:21:03 +00:00
wiz 73135dc321 Sort SYNOPSIS and option descriptions. Bump date for previous. 2013-12-15 09:20:48 +00:00
mlelstv b3d56b5ecb New -A option. Add an output column with the address of the
kernel object (vnode or file) that can be matched with prstat(8) output.
2013-12-15 08:16:24 +00:00
christos 04908d82dd use correct function and symbolic constants 2013-10-19 15:56:05 +00:00
christos 35be7e66a7 use new scopeid functions 2013-10-19 00:28:38 +00:00
christos 3c6b5224e0 avoid pointer gymnastics 2013-10-18 20:18:42 +00:00
riastradh a7f90b2fd2 Fix races in /dev/u?random initialization and accounting.
- Push /dev/random `information-theoretic' accounting into cprng(9).
- Use percpu(9) for the per-CPU CPRNGs.
- Use atomics with correct memory barriers for lazy CPRNG creation.
- Remove /dev/random file kmem grovelling from fstat(1).
2013-07-01 15:22:00 +00:00
riastradh 6290b0987e Rework rndsink(9) abstraction and adapt arc4random(9) and cprng(9).
rndsink(9):
- Simplify API.
- Simplify locking scheme.
- Add a man page.
- Avoid races in destruction.
- Avoid races in requesting entropy now and scheduling entropy later.

Periodic distribution of entropy to sinks reduces the need for the
last one, but this way we don't need to rely on periodic distribution
(e.g., in a future tickless NetBSD).

rndsinks_lock should probably eventually merge with the rndpool lock,
but we'll put that off for now.

cprng(9):
- Make struct cprng_strong opaque.
- Move rndpseudo.c parts that futz with cprng guts to subr_cprng.c.
- Fix kevent locking.  (Is kevent locking documented anywhere?)
- Stub out rump cprng further until we can rumpify rndsink instead.
- Strip code to grovel through struct cprng_strong in fstat.
2013-06-23 02:35:23 +00:00
christos 3d7bb1da45 support printing rnd descriptor info 2012-11-25 15:30:28 +00:00
christos 0548a80ae0 return stuff for ksem 2012-11-25 01:05:49 +00:00
christos c7c1f1a254 - add more debugging.
- in misctrans() we need the file index not the file type.
2012-11-25 00:36:23 +00:00
alnsn 4d1ae9a9af Report jit'ed bpf fildes in fstat. 2012-10-27 22:38:07 +00:00
christos 0d87ef641d print major device numbers symbolically from kinfo_drivers 2012-10-19 02:49:52 +00:00
christos 902a40f133 more info for unix sockets. XXX: chroot handling 2012-10-19 02:11:25 +00:00
wiz fde0458761 - In the example for `-f', reference a directory that is actually
available in a default installation (/usr/src isn't);
- put together two lines which belong to the same sentence;
- remove a spurious space character;
- remove unneeded consecutive argument for `.Nm' macro.

From Bug Hunting.
2012-10-03 19:35:08 +00:00
christos 8e13556964 fix non-numeric address and port printing. 2012-09-26 23:01:04 +00:00
christos 0b08384416 byte swap the inet6 ports. 2012-03-24 21:51:23 +00:00