From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Greg KH <greg@kroah.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>,
linux-kernel@vger.kernel.org, apw <apw@shadowen.org>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: device struct bloat
Date: Mon, 05 Nov 2007 11:46:21 +0100 [thread overview]
Message-ID: <1194259581.27652.418.camel@twins> (raw)
In-Reply-To: <20071105035855.GA25511@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 1334 bytes --]
On Sun, 2007-11-04 at 19:58 -0800, Greg KH wrote:
> On Sun, Nov 04, 2007 at 09:29:18PM +0100, Peter Zijlstra wrote:
> >
> > On Sat, 2007-11-03 at 12:48 -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.
> >
> > The thing that surprised me most was that it contains a struct
> > semaphore, Greg, is that really needed?
>
> Yes, it serializes bind and unbind stuff for the device. There are
> comments about it in drivers/base/dd.c if you want to look into it.
Ah, that is not what I meant. My question was, why a semaphore, not a
mutex? Semaphores should not be used if at all possible - for one you
don't get lockdep checking your code.
/me converts the stuff over, and boots
Ah, that probably is the reason. This device tree is hard to annotate.
I'll try and think of something..
Anyway, Andy, could you make checkpatch whine on something like:
^\+[[::space:]]*struct semaphore
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-11-05 10:46 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
2007-11-04 20:29 ` Peter Zijlstra
2007-11-05 3:58 ` Greg KH
2007-11-05 10:46 ` Peter Zijlstra [this message]
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=1194259581.27652.418.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=apw@shadowen.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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