Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-14 Thread Miod Vallat
> So I implemented a new function called > copyin_futex(9), which is all we really need. But it is not specific to futex - in fact, it could be used in syscall() as well. Better call it fuword() or aligned_fuword() since it has the extra alignment requirement that fuword

rasops: fix virtual console initialization

2017-05-14 Thread joshua stein
Only copy the console buffer contents to a rasops virtual console if it's the first one (visible). Otherwise all of the other virtual consoles initialize with the trailing end of the kernel messages and then getty writes over them, like this: https://imgur.com/a/mAXKf Index: dev/rasops/rasops.c

Re: pf queue definition: bandwidth resolution problem

2017-05-14 Thread Carl Mascott
OK, I was indeed missing something. Thanks, Theo and Mike. I think I see another very minor problem, though. Let the pf BW be 9,999,999. Shift right 3 digits (divide by 1000) : yields 9,999K. (If we were doing floating point arithmetic, would yield 9,999.999K.) You (Mike) don't round this, presuma

Re: pf queue definition: bandwidth resolution problem

2017-05-14 Thread Mike Belopuhov
On Sun, May 14, 2017 at 20:29 +, Carl Mascott wrote: > It looks to me like you are rounding on each iteration of the for-loop: > > +for (i = 0; rate > && i <= 3; i++) { > +rtmp = rate / 1000; > +if (rtmp < ) > +rtmp += (rate % 1000) / 500; > +ra

Re: pf queue definition: bandwidth resolution problem

2017-05-14 Thread Theo Buehler
On Sun, May 14, 2017 at 08:29:18PM +, Carl Mascott wrote: > It looks to me like you are rounding on each iteration of the for-loop: > > +for (i = 0; rate > && i <= 3; i++) { > +rtmp = rate / 1000; > +if (rtmp < ) This is only true in the last iteration. > +

Re: pf queue definition: bandwidth resolution problem

2017-05-14 Thread Carl Mascott
It looks to me like you are rounding on each iteration of the for-loop: +for (i = 0; rate > && i <= 3; i++) { +rtmp = rate / 1000; +if (rtmp < ) +rtmp += (rate % 1000) / 500; +rate = rtmp; +} Am I missing something? I'll post my patch on Tuesd

Re: pf queue definition: bandwidth resolution problem

2017-05-14 Thread Mike Belopuhov
On Sun, May 14, 2017 at 19:48 +, Carl Mascott wrote: > I have a suggestion RE your pftop.c patch. You are rounding > multiple times, after each scale operation. This is known as > rounding the intermediate results of a calculation and degrades > accuracy. If you're not familiar with the issu

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-14 Thread Mark Kettenis
> Date: Fri, 12 May 2017 13:34:38 + > From: Visa Hankala > > On Mon, May 01, 2017 at 06:02:24PM +0200, Mark Kettenis wrote: > > The futex(2) syscall needs to be able to atomically copy the futex in > > and out of userland. The current implementation uses copyin(9) and > > copyout(9) for that

Re: pf queue definition: bandwidth resolution problem

2017-05-14 Thread Carl Mascott
I have a suggestion RE your pftop.c patch. You are rounding multiple times, after each scale operation. This is known as rounding the intermediate results of a calculation and degrades accuracy. If you're not familiar with the issue do a Google search on rounding intermediate. I suggest assignin

Re: pf queue definition: bandwidth resolution problem

2017-05-14 Thread Theo Buehler
On Sun, May 14, 2017 at 02:02:39AM +0200, Mike Belopuhov wrote: > Good call. This one is a bit more complicated since we have 5 positions > to display and the last one is sort of reserved for the unit specifier. > > So ignoring the unit we can display numbers from 1 to . > However, when trunc

Re: printcap(5) error

2017-05-14 Thread Antoine Jacoutot
On Sat, May 13, 2017 at 12:52:04PM -0400, mar...@martinbrandenburg.com wrote: > printcap(5) says: > > NameTypeDefault Description > sd str /var/spool/outputspool directory > > However as far as I can tell, the actual default is > /var/spool/output/lpd.