<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-openbsd/lib/libc/gen/seekdir.c, branch jd/queueboosts</title>
<subtitle>WireGuard implementation for the OpenBSD kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-openbsd/atom/lib/libc/gen/seekdir.c?h=jd%2Fqueueboosts</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-openbsd/atom/lib/libc/gen/seekdir.c?h=jd%2Fqueueboosts'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/'/>
<updated>2015-09-12T13:34:22Z</updated>
<entry>
<title>Wrap &lt;dirent.h&gt; so that internal calls go direct and they're all weak symbols</title>
<updated>2015-09-12T13:34:22Z</updated>
<author>
<name>guenther</name>
<email>guenther@openbsd.org</email>
</author>
<published>2015-09-12T13:34:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=209e395206c9b2564b5720b7e81f09b0eb38e552'/>
<id>urn:sha1:209e395206c9b2564b5720b7e81f09b0eb38e552</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Optimization, no functional change:</title>
<updated>2014-03-10T07:54:14Z</updated>
<author>
<name>schwarze</name>
<email>schwarze@openbsd.org</email>
</author>
<published>2014-03-10T07:54:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=06373755481a12c92842f7d38e4928ce5f3de6cf'/>
<id>urn:sha1:06373755481a12c92842f7d38e4928ce5f3de6cf</id>
<content type='text'>
Save a cookie pointing to the very first entry in the DIR.dd_buf
cache buffer and use that to speed up seekdir(3) when rewinding
to that first entry.
No libc bump because DIR is an opaque struct.

When the optimization applies, which in particular it always does
for rewinddir(3) after reading less than about 500 entries,
seekdir(3) execution time drops from 100 to 0.05 milliseconds
on my i386 notebook.  Other cases are not slowed down.

Based on an idea from and ok by guenther@.
</content>
</entry>
<entry>
<title>Search the userland buffer of dirent structures before falling back to</title>
<updated>2013-11-06T20:35:25Z</updated>
<author>
<name>schwarze</name>
<email>schwarze@openbsd.org</email>
</author>
<published>2013-11-06T20:35:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=46537584433a2cf02efa1da6830b813a313fa9e8'/>
<id>urn:sha1:46537584433a2cf02efa1da6830b813a313fa9e8</id>
<content type='text'>
getdents(2).  No functional change, but considerable speedup in many
cases, see http://marc.info/?l=openbsd-tech&amp;m=138369623117934 for some
approximate numbers.
ok guenther@,  "good diagnosis" deraadt@
</content>
</entry>
<entry>
<title>Cleanup, no functional change:</title>
<updated>2013-11-05T20:36:51Z</updated>
<author>
<name>schwarze</name>
<email>schwarze@openbsd.org</email>
</author>
<published>2013-11-05T20:36:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=c7d031fa60681dcdda5712e0964a0c2fba71462b'/>
<id>urn:sha1:c7d031fa60681dcdda5712e0964a0c2fba71462b</id>
<content type='text'>
1. avoid code duplication in rewinddir() by calling seekdir() directly
2. move __seekdir() into seekdir() and _telldir_unlocked() into telldir()
Both functions were called from nowhere else.
3. remove some unused #include directives and one unused function prototype
ok otto@ millert@
</content>
</entry>
<entry>
<title>_FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, so</title>
<updated>2007-06-05T18:11:48Z</updated>
<author>
<name>kurt</name>
<email>kurt@openbsd.org</email>
</author>
<published>2007-06-05T18:11:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=45e14c381361430fbd1edeac8cedeeb0decb1480'/>
<id>urn:sha1:45e14c381361430fbd1edeac8cedeeb0decb1480</id>
<content type='text'>
isolate its usage to libpthread only and replace with generic non-static
mutex support in the one place it is needed:
 - remove _FD_LOCK/UNLOCK from lseek and ftruncate in libc and make the
   functions weak so that libpthread can override with its own new
   versions that do the locking.
 - remove _thread_fd_lock/unlock() weak functions from libc and adjust
   libpthread for the change.
 - add generic _thread_mutex_lock/unlock/destroy() weak functions in libc
   to support non-static mutexes in libc and add libpthread and librthread
   implementations for them. libc can utilize non-static mutexes via the
   new _MUTEX_LOCK/UNLOCK/DESTROY() macros. Actually these new macros can
   support both static and non-static mutexes but currently only using
   them for non-static.
 - make opendir/closedir/readdir/readdir_r/seekdir/telldir() thread-safe
   for both thread libraries by using a non-static mutex in the struct
   _dirdesc (typedef DIR), utilizing it in the *dir functions and remove
   remaining and incorrect _FD_LOCK/UNLOCK() use in libc.
 - add comments to both thread libraries to indicate libc depends on the
   current implementation of static mutex initialization. suggested by
   marc@
 - major bump libc and libpthread due to function removal, structure
   change and weak symbol conversions.
okay marc@, tedu@
</content>
</entry>
<entry>
<title>- Plug huge mem leak; mostly samba was suffering.</title>
<updated>2006-04-01T18:06:59Z</updated>
<author>
<name>otto</name>
<email>otto@openbsd.org</email>
</author>
<published>2006-04-01T18:06:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=3e18185e19be33c32bc49797a90a3e13be7554e7'/>
<id>urn:sha1:3e18185e19be33c32bc49797a90a3e13be7554e7</id>
<content type='text'>
- Fix semantics: seekdir(pos); telldir() shoud return pos. The code
that implements this will be made faster in a later commit.
- We loose documented behaviour (after closedir() the telldir()
positions are not valid anymore). This was never in Posix, and most
other systems have nothing like it.

Diff originally from Paul Thorn, rewritten by me using some FreeBSD
code.  "slap it in" deraadt@
</content>
</entry>
<entry>
<title>zap remaining rcsid.</title>
<updated>2005-08-08T08:05:33Z</updated>
<author>
<name>espie</name>
<email>espie@openbsd.org</email>
</author>
<published>2005-08-08T08:05:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=c2c925dec2134a12f472359f2a189e9a312dd721'/>
<id>urn:sha1:c2c925dec2134a12f472359f2a189e9a312dd721</id>
<content type='text'>
Kill old files that are no longer compiled.

okay theo
</content>
</entry>
<entry>
<title>ansify function definitions and zap some `register'</title>
<updated>2004-05-18T02:05:52Z</updated>
<author>
<name>jfb</name>
<email>jfb@openbsd.org</email>
</author>
<published>2004-05-18T02:05:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=73b3e3c43784cb5fd04439d34c7436bbf85871db'/>
<id>urn:sha1:73b3e3c43784cb5fd04439d34c7436bbf85871db</id>
<content type='text'>
ok millert@
</content>
</entry>
<entry>
<title>Remove the advertising clause in the UCB license which Berkeley</title>
<updated>2003-06-02T20:18:29Z</updated>
<author>
<name>millert</name>
<email>millert@openbsd.org</email>
</author>
<published>2003-06-02T20:18:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=6580fee3295c971a919cc04bfc3598c5f8bcd2b1'/>
<id>urn:sha1:6580fee3295c971a919cc04bfc3598c5f8bcd2b1</id>
<content type='text'>
rescinded 22 July 1999.  Proofed by myself and Theo.
</content>
</entry>
<entry>
<title>Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.</title>
<updated>2002-02-16T21:27:05Z</updated>
<author>
<name>millert</name>
<email>millert@openbsd.org</email>
</author>
<published>2002-02-16T21:27:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=c72b5b24e14c03dd8b22104fbae0d3921fa2aa37'/>
<id>urn:sha1:c72b5b24e14c03dd8b22104fbae0d3921fa2aa37</id>
<content type='text'>
</content>
</entry>
</feed>
