lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56C895CD.9070702@cumulusnetworks.com>
Date:	Sat, 20 Feb 2016 09:35:25 -0700
From:	David Ahern <dsa@...ulusnetworks.com>
To:	Edward Cree <ec429@...tab.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [RFC] sysfs: defer instantiation of default attrs

Hi Ed:

Thank for taking the to look into this.

On 2/20/16 3:42 AM, Edward Cree wrote:
> Testing this in a VM, and with udevd disabled (being too lazy to do it
>   properly), created 1024 bridges.  On ls'ing
>   /sys/class/net/bridge*/queues/*/, saw free memory drop by 64kB,
>   suggesting that much had been saved by deferral.  It's not very much,
>   hopefully deferring attribute groups will do better.

That sounds consistent with what I found by cutting out attributes in 
netdev_register_kobject. e.g., from my patch:

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index b6c8a6629b39..f0df828a2f20 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1524,7 +1524,8 @@ int netdev_register_kobject(struct net_device *ndev)
         int error = 0;

         device_initialize(dev);
-       dev->class = &net_class;
+       if (!netif_is_lwt(ndev))
+               dev->class = &net_class;
         dev->platform_data = ndev;
         dev->groups = groups;

@@ -1535,7 +1536,8 @@ int netdev_register_kobject(struct net_device *ndev)
         if (*groups)
                 groups++;

-       *groups++ = &netstat_group;
+       if (!netif_is_lwt(ndev)) {
+               *groups++ = &netstat_group;

  #if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211)
         if (ndev->ieee80211_ptr)


The big memory savings came in when I bypassed register_queue_kobjects:

         error = device_add(dev);
         if (error)
                 return error;

-       error = register_queue_kobjects(ndev);
-       if (error) {
-               device_del(dev);
-               return error;
+       if (!netif_is_lwt(ndev)) {
+               error = register_queue_kobjects(ndev);
+               if (error) {
+                       device_del(dev);
+                       return error;
+               }
         }

         pm_runtime_set_memalloc_noio(dev, true);


Yes, this is a bit Draconian and does have impacts to tools looking for 
/sys files but the return is huge when you look at 1000's of netdevices 
(ports, vlans, bridges, bonds).


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ