From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: virtio-fs-list <virtio-fs@redhat.com>,
Max Reitz <mreitz@redhat.com>, Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: [Virtio-fs] [RFC] Using hard links instead of lo_inode->fd
Date: Mon, 12 Apr 2021 19:28:28 +0100 [thread overview]
Message-ID: <YHSRTO4EGRFPWKqs@work-vm> (raw)
In-Reply-To: <20210412180519.GC1199348@redhat.com>
* Vivek Goyal (vgoyal@redhat.com) wrote:
> On Mon, Apr 12, 2021 at 06:54:52PM +0100, Dr. David Alan Gilbert wrote:
> > * Vivek Goyal (vgoyal@redhat.com) wrote:
> > > Hi All,
> > >
> > > Max has been trying to solve the problem of not having to keep an O_PATH
> > > fd open for every file (until inode goes away). Lot of inodes can get
> > > cached in guest inode cache and soon we can hit number of max fd limit.
> > >
> > > Today Christophe de Dinechin mentioned that can we maintain hardlinks
> > > for these files and open these hardlinks instead whenever we need
> > > lo_inode->fd.
> > >
> > > So say there is a notion of "workdir" which is passed to virtiofs where
> > > virtiofsd can create hardlinks. Once inode comes into existence, we
> > > create this link in workdir/<file-link>. Once last reference to inode
> > > is dropped, workdir/<file-link> is removed.
> > >
> > > Now any operation which needs the lo_inode->fd, can do operation on
> > > workdir/<file-link>.
> > >
> > > How does this proposal sound. What are the issues where. Some of the
> > > which came to surface during discussion with david gilbert are.
> > >
> > > 1. links can't be created for directories. So this will only help with
> > > regular files.
> > >
> > > 2. There might be a performance penalty. We don't know yet.
> > >
> > > 3. More overhead of managing workdir by the user/tools.
> > >
> > >
> > > Anything else? Is this a viable idea even if we can implement only
> > > for regular files.
> >
> > The other one is that linkat(, AT_EMPTY_PATH) which can create the
> > link from the existing O_PATH we have, can only be used with
> > CAP_DAC_READ_SEARCH - which is a shame since otherwise it would seem to
> > make life easier.
>
> But that does not mitigate issues w.r.t submounts (links across
> filesytem) and ctime updates?
submounts no, I don't think I understand the ctime changes though.
> So only thing this linkat(,AT_EMPTY_PATH) seems to buy is that link
> source can be an fd instead of path, right?
Yes, and we already have that fd.
Dave
> Vivek
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
prev parent reply other threads:[~2021-04-12 18:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 17:51 [Virtio-fs] [RFC] Using hard links instead of lo_inode->fd Vivek Goyal
2021-04-09 9:03 ` Miklos Szeredi
2021-04-09 12:57 ` Vivek Goyal
2021-04-09 9:53 ` Max Reitz
2021-04-09 12:59 ` Vivek Goyal
2021-04-12 17:54 ` Dr. David Alan Gilbert
2021-04-12 18:05 ` Vivek Goyal
2021-04-12 18:28 ` Dr. David Alan Gilbert [this message]
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=YHSRTO4EGRFPWKqs@work-vm \
--to=dgilbert@redhat.com \
--cc=miklos@szeredi.hu \
--cc=mreitz@redhat.com \
--cc=vgoyal@redhat.com \
--cc=virtio-fs@redhat.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.