From: Greg KH <greg@kroah.com>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: device struct bloat
Date: Sat, 3 Nov 2007 16:14:03 -0700 [thread overview]
Message-ID: <20071103231403.GB6161@kroah.com> (raw)
In-Reply-To: <20071103124823.6059640e@shemminger-laptop>
On Sat, Nov 03, 2007 at 12:48:23PM -0700, Stephen Hemminger wrote:
> The sizeof(struct device) is way too big, especially in the network device case.
> We want to support 1000's of device's and the change from class_device to
> net_device has caused needless bloat.
>
> sizeof(struct device) = 272
> sizeof(struct class_device) = 92
> * not the class_id in class_device could also be removed or changed to
> a ptr, since it is redundant for net_devices.
I agree that struct device is bigger than perhaps it should be (Kay is
working on getting rid of the bus_id field and we both just trimmed down
the base kobject by about 20 bytes) but is this really a problem that is
noticable by anyone?
I'm all for saving memory, but 1000's of struct devices is not anything
that the kernel should even notice. s390 machines create tens of
thousands of these all the time, and they are severly memory limited,
with no apparent problem.
And I'm guessing that embedded systems would not be the ones that would
be creating 1000's of network devices, right? Are these virtual devices
or backed by real, physical devices?
If it is an issue, we can start to work on slimming the structure down.
At first glance, I'm sure we can save memory by just rearanging the
fields to get rid of some structure padding that I'm sure is there.
After that, I'm sure we can push a lot of other fields out into a
separate structure to handle if the device is "virtual" or not, which
would let us drop a bunch of the dma and other resource-type things.
thanks,
greg k-h
next prev parent reply other threads:[~2007-11-03 23:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-03 19:48 device struct bloat Stephen Hemminger
2007-11-03 23:14 ` Greg KH [this message]
2007-11-04 20:29 ` Peter Zijlstra
2007-11-05 3:58 ` Greg KH
2007-11-05 10:46 ` Peter Zijlstra
2007-11-05 10:57 ` Peter Zijlstra
2007-11-05 22:33 ` Stefan Richter
2007-11-05 22:49 ` Greg KH
2007-11-06 1:38 ` [linux-usb-devel] " David Brownell
2007-11-06 9:43 ` Peter Zijlstra
2007-11-06 9:48 ` Peter Zijlstra
2007-11-06 15:36 ` Alan Stern
2007-11-06 15:58 ` Peter Zijlstra
2007-11-06 16:32 ` Alan Stern
2007-11-06 17:19 ` Peter Zijlstra
2007-11-06 18:05 ` Alan Stern
2007-11-06 18:57 ` Peter Zijlstra
2007-11-07 16:42 ` Alan Stern
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=20071103231403.GB6161@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shemminger@linux-foundation.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