public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: adilger@turbolabs.com, linux-kernel@vger.kernel.org
Subject: Re: optimize DNAME_INLINE_LEN
Date: Fri, 14 Dec 2001 01:10:34 +0100	[thread overview]
Message-ID: <20011214011034.A7845@wotan.suse.de> (raw)
In-Reply-To: <3C192A37.4547D2A7@colorfullife.com> <20011213160706.E940@lynx.no> <20011214002957.A24984@wotan.suse.de> <20011213170350.G940@lynx.no>
In-Reply-To: <20011213170350.G940@lynx.no>

On Thu, Dec 13, 2001 at 05:03:50PM -0700, Andreas Dilger wrote:
> On Dec 14, 2001  00:29 +0100, Andi Kleen wrote:
> > On Thu, Dec 13, 2001 at 04:07:06PM -0700, Andreas Dilger wrote:
> > > Alternately (also ugly) you could just define struct dentry the as now,
> > > but have a fixed size declaration for d_iname, like:
> > > 
> > > #define DNAME_INLINE_MIN 16
> > > 
> > > 	unsigned char d_iname[DNAME_INLINE_MIN];
> >                    Using [0] here would also work 
> 
> Well, not really.  If we wanted to have a minimum size for the d_iname
> field, then if we declare it as zero and it just squeaks into a chacheline,
> then we may be stuck with 0 bytes of inline names, and _all_ names will
> be kmalloced.

That can be avoided by using a suitable formula for DNAME_INLINE_MIN

> 
> > #define d_... has a similar problem => the potential to break previously
> > compiling source code.
> 
> Again, not really.  The #define d_... scheme would leave all of the fields
> in their original locations, just giving them new names within the named
> struct, and the defines would be the backwards compatible (and probably
> still preferrable) way to access these fields.  I don't _think_ it would
> cause any compiler struct alignment issues to just put the same fields
> in another struct, but I could be wrong.

It won't help if any code is doing

void function()
{ 
	int d_name;
	...
}

Preprocessor doesn't care about scopes so it would turn that into
an syntax error.

Anyways it is moot as Manfred's latest solution looks like the way to go.

-Andi


      reply	other threads:[~2001-12-14  0:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-13 22:22 optimize DNAME_INLINE_LEN Manfred Spraul
2001-12-13 23:07 ` Andreas Dilger
2001-12-13 23:24   ` Manfred Spraul
2001-12-13 23:29   ` Andi Kleen
2001-12-14  0:03     ` Andreas Dilger
2001-12-14  0:10       ` Andi Kleen [this message]

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=20011214011034.A7845@wotan.suse.de \
    --to=ak@suse.de \
    --cc=adilger@turbolabs.com \
    --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