What is RTNL lock?
pritambankar1988 at gmail.com
Mon Nov 28 02:35:39 EST 2011
This might help you.
From: kernelnewbies-bounces at kernelnewbies.org
[mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of rohan puri
Sent: 28 November 2011 12:36
To: Vimal; kernelnewbies
Subject: Re: What is RTNL lock?
On Mon, Nov 28, 2011 at 12:19 PM, Vimal <j.vimal at gmail.com> wrote:
Yes, I understood this part, but I am wondering what is the purpose of
this lock. I am guessing it's to protect all network related
operations from critical events, for e.g.: protecting a packet
transmit during device removal, protecting routing table entry during
route lookup, etc., but I can't find its precise documentation
On 27 November 2011 22:44, rohan puri <rohan.puri15 at gmail.com> wrote:
> On Sun, Nov 27, 2011 at 10:37 PM, Vimal <j.vimal at gmail.com> wrote:
>> Hi all,
>> In the Linux networking code, I see a lot of comments that say "Must
>> be called with RTNL lock."
>> What is this lock? I tried searching for it but couldn't find any
>> explanation on what it is...
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
> Hello Vimal,
> This is a mutex named rtnl_mutex. Refer file net/core/rtnetlink.c
> static DEFINE_MUTEX(rtnl_mutex);
> void rtnl_lock(void)
> Where ever you see those comments indicate that this mutex is to be held
> before execution of that code path.
This lock is used to serialize changes to net_device instances from runtime
events, conf changes
Refer book understanding Linux network internals for more details.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kernelnewbies