public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@mandrakesoft.com>
To: Hanna Linder <hannal@us.ibm.com>
Cc: davej@suse.de, torvalds@transmeta.com, viro@math.psu.edu,
	linux-kernel@vger.kernel.org, lse-tech@lists.sourceforge.net
Subject: Re: [Lse-tech] [PATCH] 2.5.5-dj2 - Fast Walk Dcache to Decrease Cacheline Bouncing
Date: 05 Mar 2002 04:30:00 +0100	[thread overview]
Message-ID: <m2sn7f8zev.fsf@localhost.mandrakesoft.com> (raw)
In-Reply-To: <33110000.1015293677@w-hlinder.des>
In-Reply-To: <33110000.1015293677@w-hlinder.des>

>>>>> "hanna" == Hanna Linder <hannal@us.ibm.com> writes:

Hi
hanna> --- linux-2.5.5-dj2/fs/dcache.c	Mon Mar  4 15:56:20 2002
hanna> +++ linux-2.5.5-fastwalk/fs/dcache.c	Fri Mar  1 16:21:40 2002
hanna> @@ -705,13 +705,23 @@
  
hanna> struct dentry * d_lookup(struct dentry * parent, struct qstr * name)
hanna> {
hanna> +	struct dentry *dentry = NULL;

Not needed.


hanna> +int path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
hanna> +{
hanna> +	nd->last_type = LAST_ROOT; /* if there are only slashes... */
hanna> +	nd->flags = flags;
hanna> +	if (*name=='/'){
hanna> +		read_lock(&current->fs->lock);
hanna> +		if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) {
hanna> +			nd->mnt = mntget(current->fs->altrootmnt);
hanna> +			nd->dentry = dget(current->fs->altroot);
hanna> +			read_unlock(&current->fs->lock);
hanna> +			if (__emul_lookup_dentry(name,nd))
hanna> +				return 0;
hanna> +			read_lock(&current->fs->lock);
hanna> +		}
hanna> +		spin_lock(&dcache_lock); /*to avoid cacheline bouncing with d_count*/
hanna> +		nd->mnt = current->fs->rootmnt;
hanna> +		nd->dentry = current->fs->root;
hanna> +		read_unlock(&current->fs->lock);
hanna> +	}
hanna> +	else{
hanna> +		read_lock(&current->fs->lock);
hanna> +		spin_lock(&dcache_lock);
hanna> +		nd->mnt = current->fs->pwdmnt;
hanna> +		nd->dentry = current->fs->pwd;
hanna> +		read_unlock(&current->fs->lock);
hanna> +	}
hanna> +	nd->flags |= LOOKUP_LOCKED;
hanna> +	return (path_walk(name, nd));
hanna> +}
hanna> +

Would you mean retest if the speed is the same using lik the old code

(already static inline)
/* SMP-safe */
static inline int
walk_init_root(const char *name, struct nameidata *nd)
{
	read_lock(&current->fs->lock);
	if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) {
		nd->mnt = mntget(current->fs->altrootmnt);
		nd->dentry = dget(current->fs->altroot);
		read_unlock(&current->fs->lock);
		if (__emul_lookup_dentry(name,nd))
			return 0;
		read_lock(&current->fs->lock);
	}
	nd->mnt = mntget(current->fs->rootmnt);
	nd->dentry = dget(current->fs->root);
	read_unlock(&current->fs->lock);
	return 1;
}

/* SMP-safe */
int path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
{
	nd->last_type = LAST_ROOT; /* if there are only slashes... */
	nd->flags = flags;
	if (*name=='/')
		walk_init_root(name,nd);
        else {
        	read_lock(&current->fs->lock);
                nd->mnt = mntget(current->fs->pwdmnt);
                nd->dentry = dget(current->fs->pwd);
                read_unlock(&current->fs->lock);
        }
	nd->flags |= LOOKUP_LOCKED;
	return (path_walk(name, nd));
}

I think that it should not made difference, and code is IMHO, more
readadble (and you don't duplicate walk_init_root).

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

  reply	other threads:[~2002-03-05  3:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-05  2:01 [PATCH] 2.5.5-dj2 - Fast Walk Dcache to Decrease Cacheline Bouncing Hanna Linder
2002-03-05  3:30 ` Juan Quintela [this message]
2002-03-05 19:16   ` [Lse-tech] " Hanna Linder

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=m2sn7f8zev.fsf@localhost.mandrakesoft.com \
    --to=quintela@mandrakesoft.com \
    --cc=davej@suse.de \
    --cc=hannal@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /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