OpenBSD CVS

CVS log for src/sys/sys/pipe.h


[BACK] Up to [local] / src / sys / sys

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.29 / (download) - annotate - [select for diffs], Sat Jul 9 12:48:21 2022 UTC (23 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Unwrap klist from struct selinfo as this code no longer uses selwakeup().

OK jsg@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jun 20 01:39:44 2022 UTC (23 months, 3 weeks ago) by visa
Branch: MAIN
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (colored)

Remove unused struct fileops field fo_poll and callbacks.

OK mpi@

Revision 1.27 / (download) - annotate - [select for diffs], Mon Jun 29 18:23:18 2020 UTC (3 years, 11 months ago) by anton
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.26: +4 -1 lines
Diff to previous 1.26 (colored)

Bring back revision 1.122 with a fix preventing a use-after-free by
serializing calls to pipe_buffer_free(). Repeating the previous commit
message:

Instead of performing three distinct allocations per created pipe,
reduce it to a single one. Not only should this be more performant, it
also solves a kqueue related issue found by visa@ who also requested
this change: if you attach an EVFILT_WRITE filter to a pipe fd, the
knote gets added to the peer's klist. This is a problem for kqueue
because if you close the peer's fd, the knote is left in the list whose
head is about to be freed. knote_fdclose() is not able to clear the
knote because it is not registered with the peer's fd.
FreeBSD also takes a similar approach to pipe allocations.

once again ok mpi@ visa@

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jun 19 02:08:48 2020 UTC (3 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.25: +0 -3 lines
Diff to previous 1.25 (colored)

backout pipe change, it crashes some arch

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jun 17 18:29:28 2020 UTC (3 years, 11 months ago) by anton
Branch: MAIN
Changes since 1.24: +4 -1 lines
Diff to previous 1.24 (colored)

Instead of performing three distinct allocations per created pipe,
reduce it to a single one. Not only should this be more performant, it
also solves a kqueue related issue found by visa@ who also requested
this change: if you attach an EVFILT_WRITE filter to a pipe fd, the
knote gets added to the peer's klist. This is a problem for kqueue
because if you close the peer's fd, the knote is left in the list whose
head is about to be freed. knote_fdclose() is not able to clear the
knote because it is not registered with the peer's fd.
FreeBSD also takes a similar approach to pipe allocations.

ok mpi@ visa@

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jan 24 11:07:41 2020 UTC (4 years, 4 months ago) by anton
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.23: +1 -2 lines
Diff to previous 1.23 (colored)

no fields are protected by the kernel lock anymore

Revision 1.23 / (download) - annotate - [select for diffs], Sun Jan 12 09:19:54 2020 UTC (4 years, 4 months ago) by anton
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

tweak locking comment

Revision 1.22 / (download) - annotate - [select for diffs], Thu Jan 9 18:54:33 2020 UTC (4 years, 5 months ago) by anton
Branch: MAIN
Changes since 1.21: +10 -9 lines
Diff to previous 1.21 (colored)

Replace the global pipe_lock with a more fine-grained lock per pipe
pair. One lock per pipe pair is used to guarantee exclusive access to
both ends of a pipe.

Thanks to millert@ and tedu@ for the feedback and ok visa@

Revision 1.21 / (download) - annotate - [select for diffs], Wed Dec 25 09:32:01 2019 UTC (4 years, 5 months ago) by anton
Branch: MAIN
Changes since 1.20: +8 -8 lines
Diff to previous 1.20 (colored)

Protect remaining fields of `struct pipe' using the pipe_lock. In order
to simplify the locking pattern, revert back to using a hand-rolled I/O
lock just like FreeBSD and NetBSD does. The state of pipes is quite
different compared to when I made use of a rwlock for the I/O lock in
revision 1.96. Most notably, the pipe_lock can now be used while
sleeping. This does imply that witness(4) tracking of the I/O lock is
lost but the implementation ends up being simpler.

ok visa@

Revision 1.20 / (download) - annotate - [select for diffs], Thu Dec 19 18:53:37 2019 UTC (4 years, 5 months ago) by anton
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

Start protecting the pipe_peer member of `struct pipe' using the
pipe_lock. This add a potential sleeping point in the kqueue filter
routines which should be fine by now thanks to changes made to the
kqueue subsystem by visa.

ok visa@

Revision 1.19 / (download) - annotate - [select for diffs], Fri Nov 29 15:15:10 2019 UTC (4 years, 6 months ago) by anton
Branch: MAIN
Changes since 1.18: +16 -10 lines
Diff to previous 1.18 (colored)

Start protecting the pipe_busy field of struct pipe using a global
rwlock. This lock is shared among all pipes for simplicity. In the
future, the lock will probably be replaced with one lock per pipe pair,
just like FreeBSD and NetBSD does.

While here, extract the common rundown wakeup logic into a dedicated
function.

Thanks to cheloha@ for testing and feedback.

ok mpi@ visa@

Revision 1.18 / (download) - annotate - [select for diffs], Sat Nov 9 19:02:31 2019 UTC (4 years, 7 months ago) by anton
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Replace the hand-rolled pipe lock with a rwlock. A necessary first step
towards unlocking pipes.

ok cheloha@ mpi@ visa@

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jul 14 10:21:11 2019 UTC (4 years, 10 months ago) by semarie
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

rename PIPE_WANT to PIPE_WANTD.

PIPE_WANT flag is used for signaling the pipe is about to be run-down.
Pending readers/writers will wakeup the closing thread which is waiting.

We already have PIPE_WANTR, PIPE_WANTW and PIPE_LWANT flags, so
PIPE_WANT isn't really descriptive.

No functional changes intented.

ok visa@ anton@ mpi@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Nov 12 16:33:08 2018 UTC (5 years, 6 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.15: +4 -2 lines
Diff to previous 1.15 (colored)

Utilize sigio with pipes. This makes fcntl(fd, F_SETOWN, arg) correctly
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@

Revision 1.15 / (download) - annotate - [select for diffs], Mon Mar 25 17:21:35 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.14: +3 -4 lines
Diff to previous 1.14 (colored)

clean up kernel includes; no need for uvm_extern.h

Revision 1.14 / (download) - annotate - [select for diffs], Fri Mar 22 15:50:16 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.13: +1 -2 lines
Diff to previous 1.13 (colored)

This has no reason to pull in machine/param.h
ok guenther

Revision 1.13 / (download) - annotate - [select for diffs], Mon Nov 21 18:16:46 2005 UTC (18 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

Move contents of sys/select.h to sys/selinfo.h in preparation for a
userland-visible sys/select.h.  Consistent with what Net and Free do.
OK deraadt@, tested with full ports build by naddy@.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jun 24 19:35:26 2004 UTC (19 years, 11 months ago) by tholo
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

This moves access to wall and uptime variables in MI code,
encapsulating all such access into wall-defined functions
that makes sure locking is done as needed.

It also cleans up some uses of wall time vs. uptime some
places, but there is sure to be more of these needed as
well, particularily in MD code.  Also, many current calls
to microtime() should probably be changed to getmicrotime(),
or to the {,get}microuptime() versions.

ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others
"Oh, that is not your problem!" from miod@

Revision 1.4.2.4 / (download) - annotate - [select for diffs], Thu Feb 19 11:01:33 2004 UTC (20 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.4.2.3: +0 -1 lines
Diff to previous 1.4.2.3 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored)

Merge of current from two weeks agointo the SMP branch

Revision 1.11 / (download) - annotate - [select for diffs], Fri Oct 3 16:38:03 2003 UTC (20 years, 8 months ago) by miod
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.10: +1 -2 lines
Diff to previous 1.10 (colored)

Bring several fixes from FreeBSD to our current pipe implementation:
- when allocating or growing a pipe buffer is not possible, do not panic
  but report the error and handle it correctly. (1.73)
- "The pipe_write() code was locking the pipe without busying it first
  in certain cases, and a close() by another process could potentially rip
  the pipe out from under the (blocked) locking operation." (from Al Viro,
  1.81)
- "Remove test in pipe_write() which causes write(2) to return EAGAIN
  on a non-blocking pipe in cases where select(2) returns the file
  descriptor as ready for write. This in turns causes libc_r, for
  one, to busy wait in such cases.
  Note: it is a quick performance fix, a more complex fix might be
  required in case this turns out to have unexpected side effects."
  (1.141)

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Tue Jun 11 03:32:33 2002 UTC (22 years ago) by art
Branch: UBC
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Sync UBC branch to -current

Revision 1.4.2.3 / (download) - annotate - [select for diffs], Thu Mar 28 14:52:01 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.4.2.2: +1 -1 lines
Diff to previous 1.4.2.2 (colored) to branchpoint 1.4 (colored)

Merge in -current from roughly a week ago

Revision 1.10 / (download) - annotate - [select for diffs], Thu Mar 14 01:27:14 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: UBC_SYNC_B, UBC_SYNC_A, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

First round of __P removal in sys

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Tue Nov 13 23:02:30 2001 UTC (22 years, 7 months ago) by niklas
Branch: SMP
Changes since 1.4.2.1: +2 -2 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored)

merge in -current

Revision 1.9 / (download) - annotate - [select for diffs], Tue Nov 6 19:53:21 2001 UTC (22 years, 7 months ago) by miod
Branch: MAIN
CVS Tags: UBC_BASE
Branch point for: UBC
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.
(Look ma, I might have broken the tree)

Revision 1.4.2.1 / (download) - annotate - [select for diffs], Wed Jul 4 11:00:26 2001 UTC (22 years, 11 months ago) by niklas
Branch: SMP
Changes since 1.4: +2 -6 lines
Diff to previous 1.4 (colored)

Merge in -current from two days ago in the SMP branch.
As usual with merges, they do not indicate progress, so do not hold
your breath for working SMP, and do not mail me and ask about the
state of it.  It has not changed.  There is work ongoing, but very, very
slowly.  The commit is done in parts as to not lock up the tree in too
big chunks at a time.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jun 23 06:09:16 2001 UTC (22 years, 11 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.7: +1 -2 lines
Diff to previous 1.7 (colored)

pipe_stat isn't referenced from outside sys_pipe.c anymore

Revision 1.7 / (download) - annotate - [select for diffs], Sat Jun 23 06:04:33 2001 UTC (22 years, 11 months ago) by art
Branch: MAIN
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

Add pipe_init, call it from main, move the pool initialization into it.

Revision 1.6 / (download) - annotate - [select for diffs], Mon May 14 13:43:52 2001 UTC (23 years, 1 month ago) by art
Branch: MAIN
Changes since 1.5: +1 -5 lines
Diff to previous 1.5 (colored)

gc OLD_PIPE.

Revision 1.5 / (download) - annotate - [select for diffs], Mon May 14 10:51:25 2001 UTC (23 years, 1 month ago) by art
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

More generic arguments to pipe_stat.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Oct 29 14:01:44 1999 UTC (24 years, 7 months ago) by art
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Branch point for: SMP
Changes since 1.3: +1 -44 lines
Diff to previous 1.3 (colored)

Remove the "Direct write" code.
We never used it and some parts of it slowed the code down.
Generally clean up the pipe code.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Feb 16 21:27:37 1999 UTC (25 years, 3 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6, OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.2: +16 -1 lines
Diff to previous 1.2 (colored)

Move defining of PIPE_NODIRECT to pipe.h and conditionalize more code with it.
This allows this code to compile on sparc.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Sep 4 22:38:47 1996 UTC (27 years, 9 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +6 -6 lines
Diff to previous 1.1 (colored)

s/KERNEL/_KERNEL/

Revision 1.1 / (download) - annotate - [select for diffs], Tue Aug 27 14:47:07 1996 UTC (27 years, 9 months ago) by shawn
Branch: MAIN

New fast pipe(2) from freebsd without fancy vm stuff.

The old pipes can be used with the "OLD_PIPE" config option.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.