2.6.8.1 sockets create-bind-unbind-bind

From: jmerkey
Date: Sun Aug 22 2004 - 11:02:02 EST


In 2.6.8.1 af_packet.c the logic in create and bind wastes cycles. When you create a socket
it calls
create which sets the socket state on po-> to "running". Then when bind is
first called
it checks this "running" flag, unbinds the previous state created with "create"
frees the sk and
prot hook structures sets the state to running=0 then resets the state again to
running=1 and
reallocates these structures. This seems to waste some cycles. caught this
since I hook create, bind, and unbind in af_packet for our software. It looks
like the logic in the sockets layer above causes this behavior.

Is there a reason it should act this way. Seems wasteful of cycles since most
peoples just
call create, bind, send send rcv rcv rcv send send, unbind

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/