From: Tejun Heo <teheo@suse.de>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org,
Jesse Barnes <jbarnes@virtuousgeek.org>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/3] Sysfs: Allow directories to be populated dynamically
Date: Thu, 29 Oct 2009 17:28:14 +0100 [thread overview]
Message-ID: <4AE9C29E.6090706@suse.de> (raw)
In-Reply-To: <20091029162145.GM10555@parisc-linux.org>
Matthew Wilcox wrote:
> On Thu, Oct 29, 2009 at 05:20:00PM +0100, Tejun Heo wrote:
>> This will increase the size of struct sysfs_dirent by three pointers
>> which is considerable. Bloating the size of sysfs_dirent can waste
>> large amount of memory on machines with a lot of disks.
>
> No it won't. It's in a union with sysfs_inode_attrs which contains a
> struct iattr, which is at least 52 bytes.
struct sysfs_dirent {
atomic_t s_count;
atomic_t s_active;
struct sysfs_dirent *s_parent;
struct sysfs_dirent *s_sibling;
const char *s_name;
union {
struct sysfs_elem_dir s_dir;
struct sysfs_elem_symlink s_symlink;
struct sysfs_elem_attr s_attr;
struct sysfs_elem_bin_attr s_bin_attr;
};
unsigned int s_flags;
ino_t s_ino;
umode_t s_mode;
struct sysfs_inode_attrs *s_iattr;
^^
};
>> The implementation looks quite scary to me. Is this the only way to
>> do this? It it because trying to create individual entries for msix
>> will end up creating too many sysfs entries? If so, how many are we
>> talking about?
>
> While that's the original motivation, shrinking the amount of memory
> taken by sysfs overall is a worthwhile achievement, don't you think?
It feels a bit too convoluted to me. sysfs is already pretty
convoluted and adding yet more convolution would require pretty good
justification, so I'm curious about the numbers.
Thanks.
--
tejun
next prev parent reply other threads:[~2009-10-29 16:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-20 5:47 [PATCH 0/3] Allow sysfs to be dynamically populated Matthew Wilcox
2009-10-20 5:49 ` [PATCH 1/3] Fix updating of named attribute groups Matthew Wilcox
2009-10-29 15:59 ` Tejun Heo
2009-10-29 16:19 ` Matthew Wilcox
2009-10-29 16:24 ` Tejun Heo
2009-10-20 5:50 ` [PATCH 2/3] Sysfs: Allow directories to be populated dynamically Matthew Wilcox
2009-10-29 16:20 ` Tejun Heo
2009-10-29 16:21 ` Matthew Wilcox
2009-10-29 16:28 ` Tejun Heo [this message]
2009-10-29 19:24 ` Matthew Wilcox
2009-10-30 10:17 ` Tejun Heo
2009-10-30 11:14 ` Matthew Wilcox
2009-10-30 16:06 ` Tejun Heo
2009-10-20 5:50 ` [PATCH 3/3] Expose MSI-X interrupts through a dynamically generated sysfs directory Matthew Wilcox
2009-10-20 8:14 ` Américo Wang
2009-10-20 8:26 ` Matthew Wilcox
2009-10-27 17:32 ` Greg KH
2009-10-20 5:52 ` [PATCH 0/3] Allow sysfs to be dynamically populated Matthew Wilcox
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=4AE9C29E.6090706@suse.de \
--to=teheo@suse.de \
--cc=gregkh@suse.de \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=matthew@wil.cx \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.