:> 
:>     Yes.  Because the route table may be flushed from an interrupt in
:>     a low memory situation.
:
:I guess I didn't state the question very well.  I realize that RTFREE
:has to be executed at splnet.  But I think it's likely that rtalloc
:and rtalloc_ign are always called at splnet or better.  If that's the
:case and it's already required, then adding the redundant splnet calls
:would be obfuscatory.  I'd rather add a comment instead.

    I ran across this situation in a number of places while fixing the VM
    system.

    If you want to get rid of the splnet() calls you have to document
    the procedure containing the calls in the comments above the procedure,
    adding something like:

    /*
     *  fubar:          fubar the kernel
     *
     *  This procedure must be called at splnet()
     *  This procedure does not block
     *  This procedure must ....
     */

    And then make sure that all calls to the procedure indeed occur at
    splnet().  Then you can get rid of the splnet() calls within the 
    procedure.

    For examples of the type of documentation necessary, look 
    at vm/swap_pager.c.

    So what it comes down to are the requirements you wish to impose on
    the official use of the procedure.

    Note that making spl*() calls when the current process is already at
    that spl level do not impose any real overhead.

:
:John
:-- 
:  John Polstra                                               [EMAIL PROTECTED]

    

                                        -Matt
                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to