Re: dev_base_lock and ->get_stats()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




David Dillow writes:
 > F.e. anything that calls rtmsg_ifinfo() almost always calls it without
 > the dev_base_lock held. This includes the dev_ioctl(), dev_ifsioc(),
 > dev_change_flags(), dev_open() call chain, among others. And anything
 > that notfies using the netdev_chain notifier list.

Holding the rtnl_sem semaphore makes holding the dev_base_lock()
unnecessary in most cases.

Actually, let's go over the cases in detail:

net/core/rtnetlink.c:rtnetlink_fill_ifinfo()

	Called from:

	1) rtnetlink_dump_ifinfo, holds dev_base_lock
	2) rtmsg_ifinfo, all callers paths hold rtnl_sem

net/core/dev.c:sprintf_stats()

	Caller dev_get_info() holds dev_base_lock

And that's it.

Later,
David S. Miller
davem@redhat.com
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux