public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsa@cumulusnetworks.com>
To: Edward Cree <ec429@cantab.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Idea for reducing sysfs memory usage
Date: Tue, 16 Feb 2016 17:44:54 -0700	[thread overview]
Message-ID: <56C3C286.9070307@cumulusnetworks.com> (raw)
In-Reply-To: <56C3C0D2.9090407@cantab.net>

On 2/16/16 5:37 PM, Edward Cree wrote:
> On 16/02/16 23:55, Greg Kroah-Hartman wrote:
>> On Tue, Feb 16, 2016 at 11:46:49PM +0000, Edward Cree wrote:
>>> Sorry if this has been suggested before, but if so I couldn't find it.
>>> Short version: could a sysfs dir reference a list of default attributes
>>> rather than having to instantiate them all?
>> Shorter version, why do you think it is?  :)
>>
>> Have you done some testing of the amount of memory that sysfs entries
>> consume and found any problems with it?
> Two reasons:
> a) in his netdev1.1 talk "Scaling the Number of Network Interfaces on
> Linux",
>     David Ahern claimed a memory overhead of (iirc) about 45kB per
> netdevice,
>     of which he attributed (again, iirc) about 20kB to sysfs entries. He
> also
>     indicated that this was a problem for his use case.  (My apologies to
>     David if I've misrepresented him.  CCed him so he can correct me.)

Close enough. :-)

I analyzed memory allocations for the creation of a dummy netdevice. All 
total 36,450 bytes were requested resulting in 43,944 bytes allocated. 
Of that kobject and sysfs is 14,568. So kobject and sysfs is roughly 1/3 
the memory overhead of a netdevice and is also a significant overhead in 
the time to create the netdevice.

David

  reply	other threads:[~2016-02-17  0:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 23:46 Idea for reducing sysfs memory usage Edward Cree
2016-02-16 23:55 ` Greg Kroah-Hartman
2016-02-17  0:37   ` Edward Cree
2016-02-17  0:44     ` David Ahern [this message]
2016-02-17  2:30       ` Greg Kroah-Hartman
2016-02-17  0:47     ` Greg Kroah-Hartman
2016-02-17  0:53       ` David Ahern
2016-02-17  1:26       ` Edward Cree
2016-02-17  2:27         ` Greg Kroah-Hartman
2016-02-17  0:38 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C3C286.9070307@cumulusnetworks.com \
    --to=dsa@cumulusnetworks.com \
    --cc=ec429@cantab.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox