Re: Wrong rights for ELF interpreters

2013-10-20 Thread Ted Unangst
On Sun, Oct 20, 2013 at 18:00, Maxime Villard wrote: It should check with VEXEC instead of VREAD. Interpreters get executed, so they have to be executable; a read-only interpreter shouldn't be loaded by the kernel. I am not sure I agree on this. Why? How is loading the interpreter

Re: threaded prof signals

2013-10-04 Thread Ted Unangst
On Thu, Oct 03, 2013 at 18:12, Philip Guenther wrote: How about we take an idea from FreeBSD and have hardclock() just set a flag on the thread and then have the thread send SIGPROF (and SIGVTALRM) to itself from userret(). The signal gets sent by the thread itself right before it checks for

Re: pthread_getspecific is too slow

2013-09-25 Thread Ted Unangst
We haven't done a lot of work to optimize performance except in response to specific issues. Sounds like you found one. Would you mind providing a test case? I just want to make sure we fix the right thing. On Wed, Sep 25, 2013 at 13:12, John Carr wrote: Problem in a nutshell:

Re: rman.h

2013-09-18 Thread Ted Unangst
On Tue, Sep 17, 2013 at 13:54, Kyle R W Milz wrote: tech@, I was porting over some freebsd kernel code and came across a struct rman and some rman_* utility functions, defined in fbsd's sys/rman.h . Does obsd have an equivalent interface? Maybe something like bus_space. Find a FreeBSD

Re: Iso image integrity verification

2013-09-13 Thread Ted Unangst
I think you're in trouble. Some of the software on the openbsd CDs was written by me, and I never made any promises it's safe to use on an important server. Not that you should trust me even if I did make such a promise. It's software you're getting from the Internet. Made by people from the

Re: ntpd jump ahead

2013-09-04 Thread Ted Unangst
On Wed, Sep 04, 2013 at 14:28, Reyk Floeter wrote: Bah. I tend to turn ntpd off and rely on the internal clock synchronization of the hypervisor. But fixing ntpd inside VMs would probably be a big win. Can you explain what you do? I have a vmt timedelta sensor that shows host time, but how

Re: threaded prof signals

2013-08-28 Thread Ted Unangst
On Fri, Aug 16, 2013 at 02:12, Ted Unangst wrote: As per http://research.swtch.com/macpprof We deliver all prof signals to the main thread, which is unlikely to result in accurate profiling info. I think the diff below fixes things. floating this again. note that it's not the clock being

threaded prof signals

2013-08-16 Thread Ted Unangst
As per http://research.swtch.com/macpprof We deliver all prof signals to the main thread, which is unlikely to result in accurate profiling info. I think the diff below fixes things. Index: kern/kern_clock.c === RCS file:

Re: mandoc term width

2013-08-16 Thread Ted Unangst
On Wed, Aug 14, 2013 at 16:51, Ingo Schwarze wrote: I think mandoc should adjust its default output width based on the terminal size. At least in the case where the terminal is narrow. This diff doesn't change anything if you have wider than 80 column terminals. I agree with your idea for

Re: threaded prof signals

2013-08-16 Thread Ted Unangst
On Fri, Aug 16, 2013 at 12:33, Mike Belopuhov wrote: On 16 August 2013 09:23, Ted Unangst t...@tedunangst.com wrote: Actually, here's my concern. There's only one timeout for the process. What happens when two threads are running on two CPUs? Is there a guarantee that cpu0 will both set

mandoc term width

2013-08-10 Thread Ted Unangst
One machine I use has terminals that happen to be very nicely sized at 75 columns wide. Day to day, this is almost perfect, except when trying to view a man page, because just a little too much text goes on each line. I think mandoc should adjust its default output width based on the terminal

Re: netbt, Bluetooth kernel code

2013-07-11 Thread Ted Unangst
On Thu, Jul 11, 2013 at 21:46, Tony Sidaway wrote: So hi, and if there's anybody else looking at this code, please get in touch. I hope I'll be able to fix the problems of the device sleeping in mutexed code. If there is a high likelihood that this code will soon be removed from the tree,

libc malloc poison

2013-07-03 Thread Ted Unangst
change the junking to be word size. maybe later we can also change the values to be random or something. Index: stdlib/malloc.c === RCS file: /cvs/src/lib/libc/stdlib/malloc.c,v retrieving revision 1.149 diff -u -p -r1.149 malloc.c

Re: libc malloc poison

2013-07-03 Thread Ted Unangst
On Wed, Jul 03, 2013 at 17:21, Theo de Raadt wrote: + int pval = 0xd0d0caca; Can you explain the choice of this? I thought it sounded clever. There are arguments to make this MI; other arguments to make it MD; and other arguments to introduce a bit of randomness. I'd like to know

Re: help X11 performance: make sigprocmask(2) SY_NOLOCK

2013-06-19 Thread Ted Unangst
On Wed, Jun 19, 2013 at 14:19, Marc Espie wrote: On Wed, Jun 19, 2013 at 01:40:19PM +0200, Martin Pelikan wrote: If you're right that atomic_{clear,set}bits_int is correct and sufficient and actually faster, then all dynamic executables would benefit from this speedup (sigprocmask is used

Re: sysctl fix

2013-06-09 Thread Ted Unangst
On Thu, Jun 06, 2013 at 23:58, Sylvestre Gallon wrote: Here is a second one to add fuse sysctls. +#define FUSEFS_NB_OPENDEVS 1 /* # of fuse devices opened */ Applied, except I changed this to FUSEFS_OPENDEVS, which seemed a little simpler. Thanks.

Re: add nl(1)

2013-06-07 Thread Ted Unangst
On Tue, May 28, 2013 at 20:52, Arto Jonsson wrote: ping Updated diff. I removed the int width handling and modified the separator printing based on your comment. I suppose since I stuck my nose in this before, I'm on the hook to give you a decent reply. I have an active interest in chasing

Re: bzip2

2013-06-06 Thread Ted Unangst
On Thu, Jun 06, 2013 at 14:20, Mark Kettenis wrote: I've ranted before about implementing standard tools in Perl. The user experience just isn't the same as with C code. But even more so than with nl(1), why would we want to use something that's different from what everybody else uses? If

Re: sysctl fix

2013-06-06 Thread Ted Unangst
On Thu, Jun 06, 2013 at 15:39, Sylvestre Gallon wrote: Hi tech@ I was currently trying to get the fuse sysctls working when I found a bug in sbin/sysctl.c If you look at sys/kern/vfs_init.c MOUNT_FUSEFS use the biggest typenum : 18. So when the function vfsinit in sbin/sysctl.c gets

Re: sysctl fix

2013-06-06 Thread Ted Unangst
On Thu, Jun 06, 2013 at 11:42, patrick keshishian wrote: Just curious, how do the variable name changes help any warrnings? nflag - nf -Wshadow. nflag is a global, which becomes hidden by giving a local parameter the same name. The code is kind of silly anyway, since the only call to that

Re: sysctl fix

2013-06-06 Thread Ted Unangst
On Thu, Jun 06, 2013 at 23:53, Sylvestre Gallon wrote: Hi, Sorry for the last mistakes. Here is a new diff that allow the maxtypenum to be reached. Cheers, Index: sysctl.c === RCS file: /cvs/src/sbin/sysctl/sysctl.c,v

Re: correct includes in man(2) pages

2013-06-05 Thread Ted Unangst
On Wed, Jun 05, 2013 at 17:56, Jason McIntyre wrote: we should be careful here. mandoc renders it like this: SYNOPSIS #include ufs/ufs/quota.h /* for ufs quotas */ #include unistd.h whereas groff does this: SYNOPSIS #include ufs/ufs/quota.h /* for ufs quotas */ #include unistd.h

Re: correct mistake in logger(1) man page

2013-06-05 Thread Ted Unangst
On Wed, Jun 05, 2013 at 19:28, Andr? St?be wrote: logger -f, as described in the man page, -f file Log to the specified file. actually logs (the contents of) the specified file. Thanks. I changed the wording to Read from the specified file. so it's even more clear.

Re: put procs on rb tree

2013-06-05 Thread Ted Unangst
On Wed, Jun 05, 2013 at 14:13, Alexandre Ratchov wrote: On Tue, Jun 04, 2013 at 11:33:12PM -0400, Ted Unangst wrote: Instead of using a fixed size hash table for procs, use an rb tree. Makes thread/process lookup even more web scale. any measurement? o ye of little faith... stock 54.65

bzip2

2013-06-05 Thread Ted Unangst
} ${DESTDIR}${BINDIR}/bzip2 + + +.include bsd.prog.mk --- /dev/null Wed Jun 5 20:55:02 2013 +++ bzip2/bzip2.pl Wed Jun 5 20:53:23 2013 @@ -0,0 +1,113 @@ +#!/usr/bin/perl -w +# $OpenBSD$ +# Copyright (c) Ted Unangst t...@openbsd.org +# +# Permission to use, copy, modify, and distribute

put procs on rb tree

2013-06-04 Thread Ted Unangst
Instead of using a fixed size hash table for procs, use an rb tree. Makes thread/process lookup even more web scale. Index: kern/init_main.c === RCS file: /cvs/src/sys/kern/init_main.c,v retrieving revision 1.189 diff -u -p -r1.189

Re: correct includes in man(3) pages

2013-06-04 Thread Ted Unangst
On Mon, Jun 03, 2013 at 23:21, Jan Klemkow wrote: This diff converts all obsolete '.Fd' tags into '.In' tags of manpages of category three. I hope this diff is ok so. If something is wrong with is, just wrote me and I will fix it. Thanks! I fixed most of them, the ones that are clearly our

Re: Fuse (and sshfs) support for OpenBSD

2013-06-03 Thread Ted Unangst
On Mon, Jun 03, 2013 at 17:14, Sylvestre Gallon wrote: You will find in this mail a patch for fuse support in kernel. I will send 2 other mails for the userland and the ports patch. There is still work to do on my fuse implementation but as I understand there is an hackathon occuring at the

Re: [PATCH] add filter by host functionality to syslogd

2013-05-23 Thread Ted Unangst
On Thu, May 23, 2013 at 12:57, Gregory Edigarov wrote: On 05/22/2013 06:39 PM, Ted Unangst wrote: On Wed, May 22, 2013 at 12:06, Gregory Edigarov wrote: works for me, with only one limitation: now only for resolvable hosts, i.e one cannot have +192.168.2.1 * /some/file Looking

Re: [PATCH] add filter by host functionality to syslogd

2013-05-23 Thread Ted Unangst
On Thu, May 23, 2013 at 19:55, Gregory Edigarov wrote: That's just a string compare. The remote host can send any string it wants. yes, it doesn't do any host resolution itself and there is no need in this, because syslogd already does this. (the resolution happens in main cycle, namely

mandoc strlcat

2013-05-23 Thread Ted Unangst
I was looking at mandoc and noticed it has too many strlcats (a common affliction affecting quite a few programs.) It's faster and simpler to use snprintf. The code in roff.c was doing something twisty with the length argument to strlcpy. Doing fancy length tricks kind of defeats the purpose of

simplify strlcat in tcpdump

2013-05-23 Thread Ted Unangst
just pfctl_osfp.c. harder to replace strlcat when it's in a loop, but some of the straight line calls can be done as snprintf followed by one strlcat. worth it? Index: pfctl_osfp.c === RCS file:

Re: mandoc strlcat

2013-05-23 Thread Ted Unangst
On Thu, May 23, 2013 at 21:38, Theo de Raadt wrote: In glibc snprintf has a memory allocation failure mode. I'm curious: is OpenBSD committed to avoiding extensions (locale features, etc) which might trigger allocation failure? Yes. I mean, what in the world is snprintf doing allocating some

Re: [PATCH] add filter by host functionality to syslogd

2013-05-22 Thread Ted Unangst
On Wed, May 22, 2013 at 12:06, Gregory Edigarov wrote: works for me, with only one limitation: now only for resolvable hosts, i.e one cannot have +192.168.2.1 * /some/file Looking at the diff, I think it's not resolvable hosts, but whatever hostname the sending machine decides

Re: cvsweb says 'No viewable change' for i915_drv.c diffs

2013-05-15 Thread Ted Unangst
On Wed, May 15, 2013 at 13:25, Stefan Sperling wrote: This should make it work. See also r1.82 of usr.bin/diff/diffreg.c. I love this bug! There's lots of copies so everybody gets a chance to fix it. Index: diff.c === RCS

apmd messages

2013-05-15 Thread Ted Unangst
I would like for apmd to tell me when the system goes to sleep, not just when it wakes up. Index: apmd.c === RCS file: /cvs/src/usr.sbin/apmd/apmd.c,v retrieving revision 1.59 diff -u -p -r1.59 apmd.c --- apmd.c 29 Apr 2013

Re: adduser default blowfish rounds

2013-05-14 Thread Ted Unangst
On Tue, May 14, 2013 at 13:16, Mike Belopuhov wrote: I think the minimum number of rounds needs to be documented somehow. I think this magic number needs to be documented. Here is a simpler version with fewer magic numbers. Nothing uses this yet, of course, I just want to get the facility

Re: adduser default blowfish rounds

2013-05-13 Thread Ted Unangst
On Mon, May 13, 2013 at 20:44, Stuart Henderson wrote: On 2013/05/13 19:32, Mark Lumsden wrote: I agree. tedu suggest 9 for the number of user rounds and 11 for root back in 2010. Are these numbers reasonable on most archs? Note that login.conf defaults can be adjusted on a per arch basis. We

Re: add nl(1)

2013-05-08 Thread Ted Unangst
On Tue, Apr 30, 2013 at 18:57, Arto Jonsson wrote: Taken from netbsd with minor modifications. Comments? I don't think you've received much feedback. I don't know how other developers feel, but the question I have is can't this be done with a rather simple awk script? or perl? One of the reasons

Re: CryptoCard support broken on AMD64

2013-05-07 Thread Ted Unangst
On Tue, May 07, 2013 at 11:13, Matthias Pitzl wrote: Hi! I think the support for CryptoCards is broken on AMD64. The diff below fixes it again. Very good!

Re: ftpd log address format

2013-05-07 Thread Ted Unangst
On Sun, May 05, 2013 at 15:18, Stuart Henderson wrote: I don't feel too strongly about it but my preference would be to log both. There are circumstances (e.g. dhcp with dynamic dns updates) where it's useful to have the reverse at the time of connection. Are you talking about internal or

Re: ftpd log address format

2013-05-07 Thread Ted Unangst
On Tue, May 07, 2013 at 20:54, Stuart Henderson wrote: I don't like logging both because there's a not unreasonable chance the reverse name will be a complete lie, which will just mislead you. Oh, it doesn't do a forward check of the name it got from reverse lookup? Yes that's bad. Well,

Re: ftpd log address format

2013-05-07 Thread Ted Unangst
On Tue, May 07, 2013 at 21:15, Stuart Henderson wrote: On 2013/05/07 16:09, Ted Unangst wrote: On Tue, May 07, 2013 at 20:54, Stuart Henderson wrote: I don't like logging both because there's a not unreasonable chance the reverse name will be a complete lie, which will just mislead you

realloc errno

2013-05-06 Thread Ted Unangst
If growing the current region fails, realloc will leave errno set, even though the function will eventually succeed. Index: stdlib/malloc.c === RCS file: /cvs/src/lib/libc/stdlib/malloc.c,v retrieving revision 1.149 diff -u -p

remove amd64 ioperm

2013-05-04 Thread Ted Unangst
We have never implemented amd64_get_ioperm and amd64_set_ioperm. There are libarch stubs, but the kernel support has never been enabled. I'm guessing nobody will miss it when it's gone. The man page also contains amusing lies like The permission bitmap contains 1024 bits in 32 longwords. It's

i387 cleanup

2013-05-04 Thread Ted Unangst
remove some old 387 flotsam and jetsam. Index: include/npx.h === RCS file: /cvs/src/sys/arch/i386/include/npx.h,v retrieving revision 1.17 diff -u -p -r1.17 npx.h --- include/npx.h 23 Mar 2011 16:54:35 - 1.17 +++

tweak for lockmgr

2013-05-03 Thread Ted Unangst
As much as I hate adding more code to lockmgr, the recent rototill made one incompatible change. We need to preserve the difference between shared and exclusive locks (only tmpfs seems to care). Index: kern_rwlock.c === RCS file:

Re: tweak for lockmgr

2013-05-03 Thread Ted Unangst
On Fri, May 03, 2013 at 09:55, Ted Unangst wrote: As much as I hate adding more code to lockmgr, the recent rototill made one incompatible change. We need to preserve the difference between shared and exclusive locks (only tmpfs seems to care). Thinking about this some more, I like it even

Re: ftpd log address format

2013-05-03 Thread Ted Unangst
On Sat, May 04, 2013 at 07:26, Martijn van Duren wrote: For a lot of cases this isn't a problem. But there are a couple of instances where the domain name resolves to something a little to generic to be useful to determine it's origin and hence I'm not able to decide if it's a legit connection

Re: Behaviour of ksh(1)

2013-05-02 Thread Ted Unangst
On Thu, May 02, 2013 at 13:12, Steffen Daode Nurpmeso wrote: Hi, you should try echo BEFORE unset KSH_VERSION echo AFTER ksh: unset: KSH_VERSION is read only So don't unset it?

Re: Test needed: ehci(4) suspend/resume rework

2013-05-01 Thread Ted Unangst
On Sun, Apr 28, 2013 at 15:44, Martin Pieuchot wrote: Diff below is a rework of the suspend/resume logic in ehci(4). In case this diff doesn't help or if you have a problem when resuming, I left an #ifdef 0 block in the DVACT_RESUME. Try enabling it and tell me if it changes something. Got

Re: faster fast grep

2013-05-01 Thread Ted Unangst
On Wed, May 01, 2013 at 04:28, J?r?mie Courr?ges-Anglas wrote: Ted Unangst t...@tedunangst.com writes: For simple patterns, grep has an optimization to avoid regex and run about 50% faster. The problem is its idea of simple patterns is too simple. IIUC the idea is to optimize for a lazy

Re: accept(2) - mention ECONNABORTED in CAVEATS

2013-04-30 Thread Ted Unangst
On Tue, Apr 30, 2013 at 22:11, J?r?mie Courr?ges-Anglas wrote: Mark Kettenis mark.kette...@xs4all.nl writes: From: j...@wxcvbn.org (=?utf-8?Q?J=C3=A9r=C3=A9mie_Courr=C3=A8ges-Anglas?=) Date: Tue, 30 Apr 2013 20:53:36 +0200 New diff with .Pp suggested by jmc (which was ok otherwise -

Re: DPI for pf(4)

2013-04-30 Thread Ted Unangst
On Wed, May 01, 2013 at 00:16, Franco Fichtner wrote: Yes, I am proposing a lightweight approach: hard-wired regex-like code, no allocations, no reassembly or state machines. I've seen far worse things being put into Kernels and I assure you that I do refrain from putting in anything that

faster fast grep

2013-04-30 Thread Ted Unangst
For simple patterns, grep has an optimization to avoid regex and run about 50% faster. The problem is its idea of simple patterns is too simple. This diff switches the logic around from a whitelist to a blacklist. We only need to abort the fast path if we see a magic regex character. Index:

Re: rm(1) static addition

2013-04-27 Thread Ted Unangst
On Sat, Apr 27, 2013 at 08:10, Otto Moerbeek wrote: On Sat, Apr 27, 2013 at 01:08:06AM -0400, Eitan Adler wrote: Adding static to internal function allows the compiler to better detect dead code (functions, variables, etc) and makes it easier for the compiler to optimize; e.g., since it knows

Re: m4 cleanup

2013-04-23 Thread Ted Unangst
On Tue, Apr 23, 2013 at 16:00, Marc Espie wrote: Did you try to get actual tests arranged ? cleaning this up is fairly low-pri for me... there are other issues concerning our m4, such as making it work with recent bison/recent libtool that concern me waaay more. There is no functional benefit

m4 cleanup

2013-04-21 Thread Ted Unangst
For whatever reason, I found myself looking at the m4 code. In eval.c, there are some funny functions. I figure if you have to cast every instance of a variable to a different type, maybe the problem is you're starting with the wrong type. Switching to unsigned char * inputs makes these functions

tee rewrite

2013-04-21 Thread Ted Unangst
ok, it's not a rewrite, but I changed a lot of the lines. Use better types, check errors against -1, delete some casts, stack buffer eliminates one malloc, braces for long blocks. Index: tee.c === RCS file:

ffs inode blocks

2013-04-21 Thread Ted Unangst
From FreeBSD. FFS2 inodes have unsigned block counts, so we have to perform the underflow test before the substraction. Index: ffs_inode.c === RCS file: /cvs/src/sys/ufs/ffs/ffs_inode.c,v retrieving revision 1.62 diff -u -p -r1.62

Re: xor lists

2013-04-18 Thread Ted Unangst
On Wed, Apr 17, 2013 at 20:06, Ted Unangst wrote: +#define XSIMPLEQ_INIT(head) do { \ + (head)-sqx_cookie = arc4random(); \ + if (sizeof(unsigned long) == 8

Re: tmpfs

2013-04-17 Thread Ted Unangst
On Mon, Apr 15, 2013 at 15:27, Pedro Martelletto wrote: http://block.io/tmpfs/tmpfs4.diff My bad, the correct URL is: http://block.io/tmp/tmpfs4.diff -p. One more note. We already have a fmt_scaled function in libutil which would be better than introducing a private dehumanisze_number.

Re: mp only sched functions

2013-04-17 Thread Ted Unangst
On Wed, Apr 17, 2013 at 13:41, Theo de Raadt wrote: Please #ifdef the bodies of the functions, rather than adding wrappers afterwards. The problem is sched_proc_to_cpu_cost has a bunch of globals outside it, so excluding them would add several more ifdef/endif sections. Doable, I just didn't

Re: mp only sched functions

2013-04-17 Thread Ted Unangst
On Wed, Apr 17, 2013 at 15:39, Ted Unangst wrote: Some functions dealing with pegging procs to CPUs and migration costs are only meaningful if we are running a multiprocessor kernel. Leave dummy versions in to avoid ifdef mazes elsewhere. Here's a variant that covers a bit more code

xor lists

2013-04-17 Thread Ted Unangst
At some point, every young programmer hears a story about how you can use xor to store the pointers of a list. It's a stupid story for many reasons, not least of which is the fact that nobody ever does this. Sounds like a challenge. This diff doesn't actually implement anything like what you're

Re: tmpfs

2013-04-10 Thread Ted Unangst
On Tue, Apr 09, 2013 at 17:26, Pedro Martelletto wrote: This diff fixes a couple of 64 vs 32-bit inconsistencies in the original diff, as well as a missing call to uvm_vnp_uncache() upon truncation. Many thanks to Chris Jackman for testing on sparc64. Speaking of, I see a lot of int64_max

Re: biowaittime

2013-04-08 Thread Ted Unangst
On Sun, Apr 07, 2013 at 22:31, Navan Carson wrote: Hi Ted, I really like the idea of gathering data about time spent waiting for a disk, but where do I find this data? (as root) pstat -d lld biowaittime it's not exported anywhere, at least not as part of that diff.

lockmgr exorcism

2013-04-05 Thread Ted Unangst
take 42. http://marc.info/?l=openbsd-techm=130999022613838w=2 Updated diff follows below. Add rrwlocks. Make lockmgr a wrapper shim. Tests, oks, the whole nine yards, please. And maybe if I get lucky this can get committed before it's two years old... Index: kern/kern_lock.c

Re: lockmgr exorcism

2013-04-05 Thread Ted Unangst
On Fri, Apr 05, 2013 at 02:06, Ted Unangst wrote: take 42. http://marc.info/?l=openbsd-techm=130999022613838w=2 Updated diff follows below. Add rrwlocks. Make lockmgr a wrapper shim. + * Copyright (c) 2011 Thordur Bjornsson h...@secnorth.net I suffered a minor highlighted text targeting

rthreads are always enabled

2013-04-05 Thread Ted Unangst
The small bits of code hiding behind rthreads_enabled aren't really experimental anymore. At this point, it's just one more knob you can twist to break your system. Index: kern/kern_exit.c === RCS file:

Re: rthreads are always enabled

2013-04-05 Thread Ted Unangst
On Fri, Apr 05, 2013 at 15:35, Matthew Dempsky wrote: Maybe leave a comment that 74 was KERN_RTHREADS like for KERN_PROC? easy peasy. { file2, CTLTYPE_STRUCT }, \ - { rthreads, CTLTYPE_INT }, \ + { rthreads, 0 }, \ Maybe change rthreads to gap like the other removed

libc warnings

2013-04-04 Thread Ted Unangst
To prevent the future recurrence of some rather serious libc build bugs, such as a macro like strong_alias suddenly turning into an implicit function prototype, I think we should add some warnings and use as much -Werror as possible. (I'm not entirely sure this would have caught the missing

biowaittime

2013-04-04 Thread Ted Unangst
This is a stupid simple diff to see just how much time you spend waiting for your disk. If you're into measuring that kind of thing. Index: vfs_bio.c === RCS file: /cvs/src/sys/kern/vfs_bio.c,v retrieving revision 1.146 diff -u -p

ffs meta layout policy

2013-04-02 Thread Ted Unangst
This is a more or less direct port of the kernel portion of a recent change Kirk McKusick recently made to FreeBSD. I'll link to his commit message which in turn links to lots of interesting reading, but the short version is that we can speed up both the filesystem and fsck by clustering metadata

Re: sys/socket.h __BSD_VISIBLE

2013-04-01 Thread Ted Unangst
On Mon, Apr 01, 2013 at 22:54, James Turner wrote: I've come across a piece of software that defines __POSIX_C_SOURCE which causes __BSD_VISIBLE to bet set to 0. In sys/socket.h if __BSD_VISIBLE is 0 sys/_types.h is included instead of sys/types.h. This is fine however in three cases we

Re: sys/socket.h __BSD_VISIBLE

2013-04-01 Thread Ted Unangst
On Mon, Apr 01, 2013 at 20:40, Philip Guenther wrote: There won't be any side effects from using __uint64_t, but I think of it more like a building block for another type. Not to be used directly. Disagree. Indeed, I just committed James's diff (plus one additional change to CMSG_DATA()).

poison shuffling

2013-03-30 Thread Ted Unangst
here's diff x/y. most of the big pieces in place, so now I want to rearrange the deckchairs just the way I like. A bunch of unreleated changes collected here instead of mailing out a pile of overlapping diffs you could never apply independently. This settles things down in prep for some more

pool poison

2013-03-29 Thread Ted Unangst
Use the common memory poisoning functions to eliminate some funky loops in pool. There are some more changes to come, but this is a almost strictly mechanical change. Index: subr_pool.c === RCS file: /cvs/src/sys/kern/subr_pool.c,v

save some lookups

2013-03-29 Thread Ted Unangst
for your amusement i present the following diff, which slightly reorders the include search path for a kernel. this doesn't change anything, except to spare us some lookups for files that don't exist. ktrace results, before and after, namei calls: 304420 1217680 14560939 k2 266626 1066504

namecache and bpf

2013-03-27 Thread Ted Unangst
What does bpf have to do with the namecache? I was wondering the same thing every time I saw bpf.o get recompiled after editing namei.h. Oh, vnode.h includes namei.h. Just because. Shuffle that line out to the exactly one place that needs it. Index: kern/vfs_init.c

sysctl rndstats

2013-03-26 Thread Ted Unangst
sysctl kern.random prints out a series of unintelligble numbers. add some labels for more pretty. also stop printing unused values. i don't need to verify that the pad bytes are still zero. for that matter, we don't even need pad bytes. Index: sys/dev/rndvar.h

cleanup ossaudio compat

2013-03-26 Thread Ted Unangst
As much as it pains me to submit a diff that contains + in the compat directory, this is still mostly -. Calling our mixer devices NetBSD devices doesn't make a whole lot of sense. Also kill some other dead code. The comment still doesn't make a lot of sense to me. The comment says only 32

ye olde magicke

2013-03-26 Thread Ted Unangst
An analysis of the kernel using sophisticated machine learning pattern matching algorithms reveals the presence of several function that are never called and can be deleted. Index: sys/exec_aout.h === RCS file:

nfs pathconf

2013-03-26 Thread Ted Unangst
After an absence of 9 years, I make my triumphant return to sys/nfs. There are some silly programs out there (looking at you boost) that actually use pathconf instead of just hard coding 1024 for max path length. If you run them from nfs, fireworks ensue. Here's a pathconf implementation for nfs,

max crypto

2013-03-26 Thread Ted Unangst
There's a rather futile check for wrap around in crypto.c. The problem is, if the number of crypto devs is anywhere near wrapping, the malloc call a few lines below has long since exploded. Just define a static max count and don't go over it. Index: crypto.c

uvm combine clearbits

2013-03-26 Thread Ted Unangst
uvm_pagefree calls atomic_clearbits_int too many times. Just accumulate the flags we need to zap, then do it once. Index: uvm_page.c === RCS file: /cvs/src/sys/uvm/uvm_page.c,v retrieving revision 1.122 diff -u -p -r1.122 uvm_page.c

mpls includes

2013-03-26 Thread Ted Unangst
the netmpls code includes various headers it doesn't really need. Index: mpls.h === RCS file: /cvs/src/sys/netmpls/mpls.h,v retrieving revision 1.25 diff -u -p -r1.25 mpls.h --- mpls.h 8 Sep 2010 08:00:56 - 1.25 +++

rename NCHNAMLEN

2013-03-26 Thread Ted Unangst
it's 2013. we don't have to pay extra for vowels. Index: nfs/nfs_vnops.c === RCS file: /cvs/src/sys/nfs/nfs_vnops.c,v retrieving revision 1.140 diff -u -p -r1.140 nfs_vnops.c --- nfs/nfs_vnops.c 17 Nov 2012 22:28:26 -

goodbye to some isa devices

2013-03-26 Thread Ted Unangst
These isa devs are already disabled and not particularly popular among our users. affected: tcic, sea, wds, eg, el Index: arch/i386/conf/GENERIC === RCS file: /cvs/src/sys/arch/i386/conf/GENERIC,v retrieving revision 1.744 diff -u

Re: rename NCHNAMLEN

2013-03-26 Thread Ted Unangst
On Tue, Mar 26, 2013 at 10:09, Mark Kettenis wrote: Date: Tue, 26 Mar 2013 05:03:59 -0400 From: Ted Unangst t...@tedunangst.com it's 2013. we don't have to pay extra for vowels. Even in 2013, my terminals are still 80 columns wide. This makes some of the lines wrap. Not really

Re: goodbye to some isa devices

2013-03-26 Thread Ted Unangst
On Tue, Mar 26, 2013 at 11:13, Mark Kettenis wrote: Date: Tue, 26 Mar 2013 05:20:27 -0400 From: Ted Unangst t...@tedunangst.com These isa devs are already disabled and not particularly popular among our users. affected: tcic, sea, wds, eg, el The reason these devices are disabled

Re: goodbye to some isa devices

2013-03-26 Thread Ted Unangst
On Tue, Mar 26, 2013 at 14:26, Creamy wrote: but I honestly question the utility of any of these ISA network and SCSI drivers. Perhaps somebody who is new to coding might be able to learn something from them? The last thing this world needs is more programmers who learned to code by

Re: goodbye to some isa devices

2013-03-26 Thread Ted Unangst
If I'm testing hardware support and such, I'm going to want to get thorough coverage of the drivers we build and purport to support. Next time mail in your dmesg! :) I'd wager a bet that I could make my sea(4) scsi adapter work more reliably than any variant of usb wi(4), so perhaps we

Re: nfs pathconf

2013-03-26 Thread Ted Unangst
On Tue, Mar 26, 2013 at 12:51, Bob Beck wrote: On Tue, Mar 26, 2013 at 11:58 AM, Theo de Raadt dera...@cvs.openbsd.org wrote: and doing EINVAL in the v2 case. Which won't solve the problem described in his mail. Of course it will - in the NFS v3 case, and in theory you'll be getting what

Re: Adds product ATI RADEON_HD5570

2013-03-24 Thread Ted Unangst
On Sun, Mar 24, 2013 at 16:59, Abel Abraham Camarillo Ojeda wrote: When I used nail it _always_ segfaults when trying to open my gmail inbox via IMAP, maybe it has something to do with my 30,000 mails in inbox... smtp and imap are separate and unrelated protocols. your mail client doesn't need

fix top wchan

2013-03-23 Thread Ted Unangst
top tests to see if wchan is set before printing wmesg, but this doesn't work anymore, since regular users can't see wchan. this fixes it. note that some of the removed code was already busted since wmesg is an array, not a pointer. Index: machine.c

wmesg in ps

2013-03-23 Thread Ted Unangst
same as in top. Index: print.c === RCS file: /cvs/src/bin/ps/print.c,v retrieving revision 1.53 diff -u -p -r1.53 print.c --- print.c 10 Jul 2012 17:24:45 - 1.53 +++ print.c 23 Mar 2013 10:36:01 - @@ -447,7

better kmem pointer hiding

2013-03-23 Thread Ted Unangst
this hides more kernel pointers in the kinfo proc struct and introduces a backdoor for the kmem group. also hoist the permission test up out of the loops. Index: sys/sysctl.h === RCS file: /cvs/src/sys/sys/sysctl.h,v retrieving

Re: better kmem pointer hiding

2013-03-23 Thread Ted Unangst
On Sat, Mar 23, 2013 at 14:19, Todd C. Miller wrote: On Sat, 23 Mar 2013 06:55:40 -0400, Ted Unangst wrote: this hides more kernel pointers in the kinfo proc struct and introduces a backdoor for the kmem group. also hoist the permission test up out of the loops. Why should we have

kern malloc simpleq

2013-03-21 Thread Ted Unangst
kern malloc rolls its own linked list code. for the sake of clarity and to make future changes easier, i'd like to make it a simpleq. it would be very nice if this could be tested on a few different kinds of machines. it's not supposed to actually change anything, but that's what testing is to

<    8   9   10   11   12   13   14   15   16   17   >