From: "Drokin, Oleg" <oleg.drokin@intel.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>,
"<linux-fsdevel@vger.kernel.org>" <linux-fsdevel@vger.kernel.org>,
"<devel@driverdev.osuosl.org>" <devel@driverdev.osuosl.org>,
"<linux-kernel@vger.kernel.org>" <linux-kernel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
"Dilger, Andreas" <andreas.dilger@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 1/2] vfs: export symbol 'getname' and 'putname'
Date: Fri, 24 Apr 2015 02:38:15 +0000 [thread overview]
Message-ID: <619812A7-B5A5-46AC-B6DA-0F3825B722F9@intel.com> (raw)
In-Reply-To: <20150422073430.GA5305@infradead.org>
On Apr 22, 2015, at 3:34 AM, Christoph Hellwig wrote:
> On Wed, Apr 22, 2015 at 06:49:08AM +0000, Drokin, Oleg wrote:
>> I know this is not going to be a popular opinion with you, but sometimes opening a file
>> is just too expensive. 1 RPC roudntrip to open a file and then another one to close it.
> Use O_PATH to avoid this.
Hm, I guess I can open with O_PATH, but…
if (unlikely(f->f_flags & O_PATH)) {
f->f_mode = FMODE_PATH;
f->f_op = &empty_fops;
return 0;
}
so with such an fd I am never getting into my ioctl handler, you see…
Let's suppose I overcome this somehow, still that does not completely solve my problem
that has more dimensions.
So, imagine I have this huge file tree (common with really big filesystems), and I want to do a one-off find
on it for whatever reason.
I do not want to pollute my dentry and inode cache with all the extra entries because (I think) I know I will
never need them again.
So with our broken ioctl from the past that was somewhat easy - I just open a dir, I do getdents, I get
a bunch of names and I proceed to call my ioctl on this bunch of names and get all the info I need
(one rpc per entry, which is not all that great, but oh well) and my dentry cache is only getting
directories, but not the files.
Now, if I convert to O_PATH (or to some other single call thing that does not need it, like say getxattr
that might work for some subset of intended usage), I get pretty much the same thing, but I also get dcache pollution
and in order to guard my dcache, I am getting a bunch of lustre locks (the expensive kind of lustre locks
issued by server so that the cache stays coherent cluster wide), even if I somehow do uncached dentries so I
can avoid the lock, there would still be that pesky LOOKUP RPC (that I would need to somehow teach to
not just do lookup, but to bring me other interesting things, kind of like with open intents).
This looks like it's getting out of hand rather fast.
Now, I probably can create some sort of an RPC that is "extended getdents with attributes" and so my extended_getdents_rpc
would return me the name and a bunch of other data like file striping, stat information and the like. This also saves me some
more RPCs, but I imagine if I try to expose that over an ioctl, you would not be very happy with it either and I don't think
we have this sort of an extended getdents interface at the kernel too, do we (though I think internally nfs is capable
of such a thing)?
Do you think any of this makes sense, or do you think I should just convert this ioctl from our broken getname version to
something like user_path_at() (an exported symbol) to do the lookup+fetch whatever info I need and immediately unhash the
resultant dentry/inode and be done with it (at least then I do not need any tools changes).
Do you think there's something else I might be doing, but not yet realizing this?
Thanks.
Bye,
Oleg
next prev parent reply other threads:[~2015-04-24 2:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 3:50 [PATCH 0/2] staging: lustre: Replace ll_getname with vfs' getname Boqun Feng
2015-04-22 3:50 ` [PATCH 1/2] vfs: export symbol 'getname' and 'putname' Boqun Feng
2015-04-22 5:53 ` Christoph Hellwig
2015-04-22 6:27 ` Drokin, Oleg
2015-04-22 6:31 ` Christoph Hellwig
2015-04-22 6:49 ` Drokin, Oleg
2015-04-22 7:34 ` Christoph Hellwig
2015-04-24 2:38 ` Drokin, Oleg [this message]
2015-04-22 6:31 ` Greg Kroah-Hartman
2015-04-22 6:40 ` Drokin, Oleg
2015-04-22 3:50 ` [PATCH 2/2] staging: lustre: replace ll_{get,put}name() with {get,put}name() Boqun Feng
2015-04-22 5:45 ` Dilger, Andreas
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=619812A7-B5A5-46AC-B6DA-0F3825B722F9@intel.com \
--to=oleg.drokin@intel.com \
--cc=andreas.dilger@intel.com \
--cc=boqun.feng@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®