Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Mar 2010 10:44:28 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= <des@des.no>, Andriy Gapon <avg@icyb.net.ua>
Subject:   Re: periodically save current time to time-of-day hardware
Message-ID:  <201003291044.28544.jhb@freebsd.org>
In-Reply-To: <86fx3k7jqi.fsf@ds4.des.no>
References:  <4BACC791.70502@icyb.net.ua> <20100327214634.GI32799@server.vk2pj.dyndns.org> <86fx3k7jqi.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 28 March 2010 7:45:25 am Dag-Erling Sm=C3=B8rgrav wrote:
> Peter Jeremy <peterjeremy@acm.org> writes:
> > A new kthread which sleeps on channel "update_rtc".  When woken, it
> > checks to see if it's within (say) 50msec of a second boundary and so,
> > it does a trylock on the (new) RTC mutex.  If it grabs the mutex then
> > it performs the update.  If it was too far from the second boundary or
> > it fails to grab the mutex then it sleeps until the next second
> > boundary and tries again.
> >
> > The existing resettodr() would then turn into a wakeup(update_rtc).
>=20
> Sounds good to me, but if only that thread has access to the RTC, why
> bother with a mutex?

I would dispense with the kthread and just use a callout (or have a callout=
=20
schedule a task for taskqueue_thread).

=2D-=20
John Baldwin



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