Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Feb 2007 17:05:05 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        John E Hein <jhein@timing.com>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/compat/ndis kern_ndis.c src/sys/dev/acpica/Osd OsdSchedule.c src/sys/dev/ata ata-all.c atapi-cd.c atapi-tape.c src/sys/dev/ppc ppc.c
Message-ID:  <200702231705.05492.jhb@freebsd.org>
In-Reply-To: <17887.20595.540648.699149@gromit.timing.com>
References:  <200702231625.l1NGP86A029885@repoman.freebsd.org> <17887.20595.540648.699149@gromit.timing.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 23 February 2007 15:37, John E Hein wrote:
> John Baldwin wrote at 16:25 +0000 on Feb 23, 2007:
>  > jhb         2007-02-23 16:25:08 UTC
>  > 
>  >   FreeBSD src repository
>  > 
>  >   Modified files:
>  >     sys/compat/ndis      kern_ndis.c 
>  >     sys/dev/acpica/Osd   OsdSchedule.c 
>  >     sys/dev/ata          ata-all.c atapi-cd.c atapi-tape.c 
>  >     sys/dev/ppc          ppc.c 
>  >   Log:
>  >   Use 'pause' in several places rather than trying to tsleep() on NULL 
(which
>  >   triggers a KASSERT) or local variables.  In the case of kern_ndis, the
>  >   tsleep() actually used a common sleep address (curproc) making it
>  >   susceptible to a premature wakeup.
> 
> Nice.  Maybe you should pass in priority so pause(9) users don't
> always wake up at PRI_MIN.

Right now they wakeup at whatever they were when they weng to sleep
(passing 0 to tsleep() results in no priority change).  This way,
pause() doesn't affect your priority at all.

> If not, PZERO might be a more sensible default perhaps.
> 
> PCATCH complicates this slightly since pause(9) currently returns
> nothing, but I could see cases where users might want PCATCH.

If people want to catch signals they can use tsleep() directly, but
this intended for saying "I want to wait 100ms for the hardware to
settle, but don't want to hog the CPU while I do it", and those
places don't use PCATCH now.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702231705.05492.jhb>