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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Jul 2007 13:21:19 +0800
From:	"rae l" <crquan@...il.com>
To:	"Al Viro" <viro@....linux.org.uk>
Cc:	"Alexander Viro" <viro@...iv.linux.org.uk>,
	linux-kernel@...r.kernel.org, "Greg Kroah-Hartman" <gregkh@...e.de>
Subject: Re: [RFC] fs/super.c: Why alloc_super use a static variable default_op?

On 7/25/07, Al Viro <viro@....linux.org.uk> wrote:
> On Wed, Jul 25, 2007 at 12:29:17PM +0800, rae l wrote:
> > But is it valuable? Compared to a waste of sizeof(struct super_block)
> > bytes memory.
>
> It's less that struct super_block, actually.
>
> > When some code want to refer fs_type->s_op, it almost always want to
> > refer some function pointer in s_op with fs_type->s_op->***, but all
> > pointers in default_op are all NULLs, what about this scenario?
>
> Yes, and?  You still need one test instead of two.  Which gets you
> more than 21 words used by that sucker, only in .text instead of .bss.
>
> > and if you do grep s_op in the source code, you will found nowhere
> > will want to test s_op or dependent on s_op not NULL.
>
> What?  fs/inode.c:
>         if (sb->s_op->alloc_inode)
>                 inode = sb->s_op->alloc_inode(sb);
>         else
>                 inode = (struct inode *) kmem_cache_alloc(inode_cachep, GFP_KERNEL);
> and the same goes everywhere else.  Of course we don't check for
> sb->s_op not being NULL - that's exactly why we are safe skipping such
> tests.
Oh, Thank you.

But there are also many other subsystems will do
fs/dcache.c:
void dput(struct dentry *dentry)
	if (dentry->d_op && dentry->d_op->d_delete) {
Do you think it's worth optimizing it with a static d_op filled?

we can add a static variable to d_alloc and set its initial d_op to
this static variable?
struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)

>

-- 
Denis Cheng
Linux Application Developer

"One of my most productive days was throwing away 1000 lines of code."
 - Ken Thompson.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ