All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: John Levon <levon@movementarian.org>
Cc: linux-fsdevel@vger.kernel.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	robert.richter@amd.com, oprofile-list@lists.sf.net
Subject: Re: [patch][rfc] fs: shrink struct dentry
Date: Tue, 2 Dec 2008 08:06:08 +0100	[thread overview]
Message-ID: <20081202070608.GA28080@wotan.suse.de> (raw)
In-Reply-To: <20081201193818.GB16828@totally.trollied.org.uk>

On Mon, Dec 01, 2008 at 07:38:18PM +0000, John Levon wrote:
> On Mon, Dec 01, 2008 at 07:04:55PM +0100, Nick Piggin wrote:
> 
> > On Mon, Dec 01, 2008 at 05:51:13PM +0000, John Levon wrote:
> > > On Mon, Dec 01, 2008 at 09:33:43AM +0100, Nick Piggin wrote:
> > > 
> > > > I then got rid of the d_cookie pointer. This shrinks it to 192 bytes. Rant:
> > > > why was this ever a good idea? The cookie system should increase its hash
> > > > size or use a tree or something if lookups are a problem.
> > > 
> > > Are you saying you've made this change without even testing its
> > > performance impact?
> > 
> > For oprofile case (maybe if you are profiling hundreds of vmas and
> > overflow the 4096 byte hash table), no. That case is uncommon and
> > must be fixed in the dcookie code (as I said, trivial with changing
> > data structure). I don't want this pointer in struct dentry
> > regardless of a possible tiny benefit for oprofile.
> 
> Don't you even have a differential profile showing the impact of
> removing d_cookie? This hash table lookup will now happen on *every*
> userspace sample that's processed. That's, uh, a lot.

I don't know what you mean by every sample that's processed, but
won't the hash lookup only happen for the *first* time that a given
name is asked for a dcookie (ie. fast_get_dcookie, which, as I said,
should actually be moved to fs/dcookies.c).

If get_dcookie is called "a lot" of times, then this profiling code
is broken anyway. There is a global mutex in that function. It's bad
enough that it takes mmap_sem and does find_vma...


> (By all means make your change, but I don't get how it's OK to regress
> other code, and provide no evidence at all as to its impact.)

Tradeoffs are made all the time. This is obviously a good one, and
I provided evidence of the impact of the improvement in the common
case. I also acknowledge it can slow down the uncommon case, but
showed ways that can easily be improved. Do you want me to just try
to make an artificial case where I mmap thousands of tiny shared
libraries and try to overflow the hash and try to detect a difference?

Did you add d_cookie? If so, then surely at the time you must have
justified that with some numbers to show a significant improvement
to outweigh the clear downsides. Care to share? Then I might be able
to just reuse your test case.



WARNING: multiple messages have this Message-ID (diff)
From: Nick Piggin <npiggin@suse.de>
To: John Levon <levon@movementarian.org>
Cc: linux-fsdevel@vger.kernel.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	robert.richter@amd.com, oprofile-list@lists.sf.net
Subject: Re: [patch][rfc] fs: shrink struct dentry
Date: Tue, 2 Dec 2008 08:06:08 +0100	[thread overview]
Message-ID: <20081202070608.GA28080@wotan.suse.de> (raw)
In-Reply-To: <20081201193818.GB16828@totally.trollied.org.uk>

On Mon, Dec 01, 2008 at 07:38:18PM +0000, John Levon wrote:
> On Mon, Dec 01, 2008 at 07:04:55PM +0100, Nick Piggin wrote:
> 
> > On Mon, Dec 01, 2008 at 05:51:13PM +0000, John Levon wrote:
> > > On Mon, Dec 01, 2008 at 09:33:43AM +0100, Nick Piggin wrote:
> > > 
> > > > I then got rid of the d_cookie pointer. This shrinks it to 192 bytes. Rant:
> > > > why was this ever a good idea? The cookie system should increase its hash
> > > > size or use a tree or something if lookups are a problem.
> > > 
> > > Are you saying you've made this change without even testing its
> > > performance impact?
> > 
> > For oprofile case (maybe if you are profiling hundreds of vmas and
> > overflow the 4096 byte hash table), no. That case is uncommon and
> > must be fixed in the dcookie code (as I said, trivial with changing
> > data structure). I don't want this pointer in struct dentry
> > regardless of a possible tiny benefit for oprofile.
> 
> Don't you even have a differential profile showing the impact of
> removing d_cookie? This hash table lookup will now happen on *every*
> userspace sample that's processed. That's, uh, a lot.

I don't know what you mean by every sample that's processed, but
won't the hash lookup only happen for the *first* time that a given
name is asked for a dcookie (ie. fast_get_dcookie, which, as I said,
should actually be moved to fs/dcookies.c).

If get_dcookie is called "a lot" of times, then this profiling code
is broken anyway. There is a global mutex in that function. It's bad
enough that it takes mmap_sem and does find_vma...


> (By all means make your change, but I don't get how it's OK to regress
> other code, and provide no evidence at all as to its impact.)

Tradeoffs are made all the time. This is obviously a good one, and
I provided evidence of the impact of the improvement in the common
case. I also acknowledge it can slow down the uncommon case, but
showed ways that can easily be improved. Do you want me to just try
to make an artificial case where I mmap thousands of tiny shared
libraries and try to overflow the hash and try to detect a difference?

Did you add d_cookie? If so, then surely at the time you must have
justified that with some numbers to show a significant improvement
to outweigh the clear downsides. Care to share? Then I might be able
to just reuse your test case.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-12-02  7:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-01  8:33 [patch][rfc] fs: shrink struct dentry Nick Piggin
2008-12-01  8:33 ` Nick Piggin
2008-12-01 11:09 ` Andi Kleen
2008-12-01 11:09   ` Andi Kleen
2008-12-01 11:26   ` Nick Piggin
2008-12-01 11:26     ` Nick Piggin
2008-12-01 17:51 ` John Levon
2008-12-01 17:51   ` John Levon
2008-12-01 18:04   ` Nick Piggin
2008-12-01 18:04     ` Nick Piggin
2008-12-01 19:38     ` John Levon
2008-12-01 19:38       ` John Levon
2008-12-02  7:06       ` Nick Piggin [this message]
2008-12-02  7:06         ` Nick Piggin
2008-12-02 13:04         ` John Levon
2008-12-02 13:04           ` John Levon
2008-12-02 13:49           ` Nick Piggin
2008-12-02 13:49             ` Nick Piggin
2008-12-02 14:49             ` John Levon
2008-12-02 14:49               ` John Levon
2008-12-02 15:11               ` Nick Piggin
2008-12-02 15:11                 ` Nick Piggin
2008-12-10  6:00 ` [patch] " Nick Piggin
2008-12-10  6:53   ` Al Viro
2008-12-10  7:19     ` Nick Piggin

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=20081202070608.GA28080@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=levon@movementarian.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oprofile-list@lists.sf.net \
    --cc=robert.richter@amd.com \
    /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.