callout patch - make callouts per-cpu and MP safe.

Matthew Dillon dillon at apollo.backplane.com
Tue Sep 14 09:41:05 PDT 2004


:On Mon, Sep 13, 2004 at 10:53:13PM -0700, Matthew Dillon wrote:
:>     This patch makes the kernel callout_*() interface per-cpu and MP safe.
:>     Individual callouts may also be registered as MP safe or not via a second
:>     argument to callout_reset() (using the same API a FreeBSD-5).
:
:I never liked the additional argument in FreeBSD-5, but I guess it can't be
:avoided for SMP safety. Does it imply that a MP-safe callout always runs on
:the CPU it was initially registered on? Have you looked at the timeout API
:from NetBSD/OpenBSD, they bind e.g. the function at init time. This might
:be more appropiate on this case.

    Well, except init time is usually in the startup code which is running
    on only one cpu.  I'm binding the cpu when the timeout is actually 
    started, in callout_reset().  We should probably have another API
    call to specify the cpu, e.g. callout_reset_oncpu(), for those
    subsystems which want to start their timeouts in the initialization
    code.

:I've been working on this already for dev/netif whenever I did greater changes
:to a driver. I've been working on other parts of the code base. If someone
:wants to submit patches, I'd like to coordinate this effort off-list.
:
:Joerg

    That would be helpful.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list