Re: CVS commit: src/sys/netinet

2013-03-12 Thread Greg Troxel

"Christos Zoulas"  writes:

> Module Name:  src
> Committed By: christos
> Date: Tue Mar 12 21:54:36 UTC 2013
>
> Modified Files:
>   src/sys/netinet: in4_cksum.c
>
> Log Message:
> - Don't panic on short packets unless DIAGNOSTIC. In general we should try
>   to make the kernel survive errors...

This seems odd.  Either there's an invariant that there can't be a short
packet, or there isn't.  DIAGNOSTIC is basically supposed to add checks
for invariants, but that's not about not crashing on not DIAGNOSTIC but
avoiding the run-time costs of the checks.
So is a short packet a "can't happen" case?


pgp6M39ybliFu.pgp
Description: PGP signature


Re: CVS commit: src/lib/libc/arch/alpha/gen

2013-03-12 Thread Christos Zoulas
In article <20130312193820.a36b017...@cvs.netbsd.org>,
Martin Husemann  wrote:

is the memset() in longjmp desired? It will just slow down things.

christos



Re: CVS commit: src/sys/kern

2013-03-12 Thread David Laight
On Tue, Mar 12, 2013 at 01:31:21PM +1100, matthew green wrote:
> 
> > > Modified Files:
> > >   src/sys/kern: subr_pool.c
> > > 
> > > Log Message:
> > > In pool_cache_put_slow(), pool_get() can block (it does mutex_enter()),
> > > so we need to retry if curlwp took a context switch during the call.
> > 
> > I didn't think mutex_enter() blocked - isn't it a spinlock.
> > Which means that if things are going wrong they can go wrong
> > even if the mutex is available immediately.
> 
> netbsd kernel mutexes can be either, but this one is a spinlock yeah.

Hmmm I thought that internal test had gone with lockmgr :-)
My guess is that every call site knows whether sleeping is allowed,
so it could be a property of the mutex type.
Then there would be no confusion about whether the code might sleep.

I know the uncontended path is now common to both (and fast) - unlike
lockmgr which took a couple of 100 instructions to decide what to do.

David

-- 
David Laight: da...@l8s.co.uk