linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org,
	Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [GIT PULL] Ceph fixes for 5.1-rc7
Date: Thu, 25 Apr 2019 14:23:59 -0400	[thread overview]
Message-ID: <342ef35feb1110197108068d10e518742823a210.camel@kernel.org> (raw)
In-Reply-To: <CAHk-=wgPBx9xPWY7obK60=RTnOF3Ln0j9XkhYbekML=Fi3bFXg@mail.gmail.com>

On Thu, 2019-04-25 at 11:02 -0700, Linus Torvalds wrote:
> On Thu, Apr 25, 2019 at 10:48 AM Ilya Dryomov <idryomov@gmail.com> wrote:
> > dentry name handling fixes from Jeff and a memory leak fix from Zheng.
> > Both are old issues, marked for stable.
> 
> Hmm. You probably should have talked to Al about the dentry name
> issue, because he'd most likely have pointed you towards our helper
> function for exactly this thing:
> 
>     struct name_snapshot stable;
> 
>     take_dentry_name_snapshot(&stable, dentry);
>     ... use stable.name ..
>     release_dentry_name_snapshot(&stable);
> 
> which doesn't need any extra memory allocation outside of some fairly
> limited stack allocation for the 'name_snapshot' itself, because it
> knows about the dentry name rules, and
> 
>  - for inline names, it copies it under the d_lock into the fixed
> DNAME_INLINE_LEN-sized buffer
> 
>  - for out-of-line names, it knows that the name allocation is stable
> and ref-counted, and just increments the refcount and uses the
> existing name pointer.
> 
> now, maybe you need to always do that name allocation anyway (looking
> at the diff it looks like you often do that for other cases), so maybe
> the name snapshot capability isn't all that useful for you and the
> above wouldn't have helped, but I suspect you might not even have
> realized that there was an option like this.
> 
> I've pulled this, but maybe Jeff wants to look at whether that
> snapshotting model could have helped.
> 
>                        Linus

Thanks for the info! I think it would have.

I took a quick look at the dcache code to see if we had something like
that before I did this, but I guess I didn't look closely enough. Those
routines do look nicer than my hand-rolled version.

I'll look at spinning up a patch to switch that over in the near future.

Thanks,
-- 
Jeff Layton <jlayton@kernel.org>


  parent reply	other threads:[~2019-04-25 18:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 17:47 [GIT PULL] Ceph fixes for 5.1-rc7 Ilya Dryomov
2019-04-25 18:02 ` Linus Torvalds
2019-04-25 18:21   ` Al Viro
2019-04-25 18:24     ` Linus Torvalds
2019-04-25 18:31       ` Al Viro
2019-04-25 18:36       ` Jeff Layton
2019-04-25 18:23   ` Jeff Layton [this message]
2019-04-25 20:09     ` Al Viro
2019-04-26 16:25       ` Jeff Layton
2019-04-26 16:36         ` Linus Torvalds
2019-04-26 16:43           ` Linus Torvalds
2019-04-26 17:01           ` Al Viro
2019-04-26 17:08             ` Linus Torvalds
2019-04-26 17:11               ` Al Viro
2019-04-26 20:49             ` Jeff Layton
2019-04-26 21:28               ` Al Viro
2019-04-26 16:50         ` Al Viro
2019-04-26 17:30           ` Jeff Layton
2019-04-28  4:38             ` Al Viro
2019-04-28 13:27               ` Jeff Layton
2019-04-28 14:48                 ` Al Viro
2019-04-28 15:47                   ` Jeff Layton
2019-04-28 15:52                     ` Al Viro
2019-04-28 16:18                       ` Jeff Layton
2019-04-28 16:40                       ` Al Viro
2019-04-25 18:35 ` pr-tracker-bot

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=342ef35feb1110197108068d10e518742823a210.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).