Question(s) kernel

Matthew Dillon dillon at apollo.backplane.com
Tue Sep 25 11:57:07 PDT 2007


:Hi
:
:I have been browsing the Dragonfly kernel code and two questions came up=
::
:
:(1) if a user process causes many "lwkt_sendmsg", either by directly  =
:
:invoking it or through
:     some table based system call. Could this lead to memory exhaustion =
:in  =
:
:the kernel by flooding
:     the target port and eventually crash the system?

    Theoretically if the message is being allocated dynamically, but
    lwkt_sendmsg() is only used in a few fairly restricted situations.
    Most of the hot-path messaging uses lwkt_domsg(), which is synchronous,
    or a facility will pre-allocate a message for signaling purposes and
    only allows one to be in transit at any given moment.

:(2) http://fxr.watson.org/fxr/source/netinet/if_ether.c?v=3DDFBSD#L832
:   "lwkt_domsg(rtable_portfn(0), &msg.netmsg.nm_lmsg, 0);"
:   Is this always using cpu 0 ? And if, why?
:
:Thank you for your answers or pointers to previous posts I missed :-)
:
:Dominic

    This code is adding the ARP information to the route table.  Because
    the route table is per-cpu the message must be chained to all the cpus
    starting with cpu 0.  It's just easier to do it that way, ARP does
    not require a high performance algorithm and once the BGL is removed
    from that path the overhead will be distributed evenly across all cpus.

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Kernel mailing list