linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Oliver Sang <oliver.sang@intel.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
	linux-fsdevel@vger.kernel.org,
	Christian Brauner <brauner@kernel.org>,
	linux-doc@vger.kernel.org, ying.huang@intel.com,
	feng.tang@intel.com, fengwei.yin@intel.com,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [viro-vfs:work.dcache2] [__dentry_kill()]  1b738f196e: stress-ng.sysinfo.ops_per_sec -27.2% regression
Date: Wed, 6 Dec 2023 05:49:46 +0000	[thread overview]
Message-ID: <20231206054946.GM1674809@ZenIV> (raw)
In-Reply-To: <ZW/fDxjXbU9CU0uz@xsang-OptiPlex-9020>

On Wed, Dec 06, 2023 at 10:40:15AM +0800, Oliver Sang wrote:
> hi, Al Viro,

> > Oh, well - let's see what profiles show...  I still hope that it's not where
> > the trouble comes from - it would've lead the extra cycles in shrink_dcache_parent()
> > or d_walk() called from it and profiles you've posted do not show that, so...
> > 
> 
> our auto-bisect pointed to
> 3f99656f7bc2f step 5: call __dentry_kill() without holding a lock on parent

Nuts.  All that commit is doing is
	* don't bother with taking parent's ->d_lock in lock_for_kill()
	* don't bother with dropping it in __dentry_kill(), since now we don't have it
	  taken.

And that somehow manages to give a 30% performance drop on that test?

Seriously, not touching parent's ->d_lock aside, there is only one change
I see in there.  Namely,
	having failed trylock on inode
	unlocked dentry
	locked inode
	relocked dentry
	noticed that inode does not match ->d_inode
	... and it turns out that ->d_inode is NULL now
In that situation new variant treats goes "OK, unlock the old
inode and we are done".  The old one unlocked old inode,
unlocked dentry, relocked it, checked that its ->d_inode has
not become non-NULL while we had it unlocked and only then
succeeded.  If ->d_inode has changed, it repeated the whole
loop (unlocked dentry, etc.)

Let's try to isolate that; step 5 split in two and branch
force-pushed.  Instead of
dc3cf789eb259 step 4: make shrink_kill() keep the parent pinned until after __dentry_kill() of victim
3f99656f7bc2f step 5: call __dentry_kill() without holding a lock on parent
we have
dc3cf789eb259 step 4: make shrink_kill() keep the parent pinned until after __dentry_kill() of victim
854e9f938aafe step 4.5: call __dentry_kill() without holding a lock on parent
e2797564725a5 step 5: clean lock_for_kill()
;  git diff e2797564725a5 3f99656f7bc2f
;

Intermediate step preserves the control flow in lock_for_kill() -
the only change in that one is "don't bother with parent's ->d_lock".

The step after it does the change in lock_for_kill() described above.

Could you profile 854e9f938aafe and see where does it fall - is it like
dc3cf789eb259 or like 3f99656f7bc2f?

I really don't get it...

  reply	other threads:[~2023-12-06  5:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30  4:54 [viro-vfs:work.dcache2] [__dentry_kill()] 1b738f196e: stress-ng.sysinfo.ops_per_sec -27.2% regression kernel test robot
2023-11-30  7:55 ` Al Viro
2023-12-01  2:13   ` Oliver Sang
2023-12-01  2:42     ` Oliver Sang
2023-12-01  4:09     ` Al Viro
2023-12-01  6:56       ` Al Viro
2023-12-01 20:04         ` Al Viro
2023-12-04 13:37           ` Oliver Sang
2023-12-04 19:53             ` Al Viro
2023-12-06  2:40               ` Oliver Sang
2023-12-06  5:49                 ` Al Viro [this message]
2023-12-06 14:56                   ` Oliver Sang
2023-12-06 16:15                     ` Al Viro
2023-12-06 16:30                       ` Mateusz Guzik
2023-12-06 16:42                         ` Mateusz Guzik
2023-12-06 17:09                           ` Al Viro
2023-12-06 17:24                             ` Mateusz Guzik
2023-12-06 18:30                               ` Mateusz Guzik
2023-12-07  2:29                                 ` Oliver Sang
2023-12-08 18:07                                   ` Mateusz Guzik
2023-12-06 21:07                               ` Al Viro
2023-12-06 21:41                                 ` Mateusz Guzik
2023-12-06 16:45                         ` Al Viro
2023-12-06 16:52                           ` Mateusz Guzik

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=20231206054946.GM1674809@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=brauner@kernel.org \
    --cc=feng.tang@intel.com \
    --cc=fengwei.yin@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=ying.huang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).