From: Nick Piggin <npiggin@suse.de>
To: Brad Boyer <flar@allandria.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [rfc][patch] fs: introduce iget, mark igrab as must_check
Date: Mon, 22 Mar 2010 12:57:56 +1100 [thread overview]
Message-ID: <20100322015755.GD9733@laptop> (raw)
In-Reply-To: <20100320201338.GA27478@cynthia.pants.nu>
On Sat, Mar 20, 2010 at 01:13:38PM -0700, Brad Boyer wrote:
> On Thu, Mar 18, 2010 at 12:11:12AM +1100, Nick Piggin wrote:
> > I thought I would ask for opinions on this because it can come in handy
> > to avoid locking to use an iget() rather than igrab() if we do lazy LRU
> > (like the dcache), then iget() just increments the refcount and doesn't
> > require any more locking.
> >
> > I thought it might be useful anyway to avoid igrab misuse by
> > filesystems? So after this patch we should use igrab for when we don't
> > already have the inode pinned. Introduce iget for when we do.
> > The interfaces don't change, but __must_check will prompt filesystems to
> > use the correct API.
>
> I'm not sure if this matters, but I have to say I don't like the name. In
> particular, iget used to exist and be iget(sb, ino). A lot of the code
> still has leftovers from this including iget_locked. I'm not sure if
> there is a more obvious name, especially since __iget is effectively the
> unlocked version of what you added. It's something to consider if you
> haven't already.
Yeah, I can't think of a better name. It would be annoying to introduce
a worse name because of legacy reasons.
>
> Also, are you really avoiding any locking? It looks the same to me.
Not in this patch, but I have a patch in my icache scalability series
(which can be broken out of course) that basically does a "lazy lru"
for inodes, like we do for dentries now.
So iget will become basically what dget is now. It would not have to
check inode state or move it between lists.
Whether or not we actually do that is another question, but either way
I think this patch is worthwhile.
Thanks,
Nick
next prev parent reply other threads:[~2010-03-22 5:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-17 13:11 [rfc][patch] fs: introduce iget, mark igrab as must_check Nick Piggin
2010-03-20 20:13 ` Brad Boyer
2010-03-22 1:57 ` Nick Piggin [this message]
2010-03-23 6:24 ` Brad Boyer
2010-03-24 22:01 ` Dave Chinner
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=20100322015755.GD9733@laptop \
--to=npiggin@suse.de \
--cc=flar@allandria.com \
--cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).