From: Miklos Szeredi <miklos@szeredi.hu>
To: Bernd Schubert <bernd.schubert@fastmail.fm>
Cc: Askar Safin <safinaskar@gmail.com>,
Luis Chamberlain <mcgrof@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org,
fuse-devel <fuse-devel@lists.sourceforge.net>
Subject: Re: [PATCH 0/6] vfs: provide automatic kernel freeze / resume
Date: Wed, 7 Jun 2023 09:21:45 +0200 [thread overview]
Message-ID: <CAJfpeguQ87Vxdn-+c4yYy7=hKnSYwWJNe22f-6dG8FNAwjWBXA@mail.gmail.com> (raw)
In-Reply-To: <5d69a11e-c64e-25dd-a982-fd4c935f2bf3@fastmail.fm>
On Tue, 6 Jun 2023 at 22:18, Bernd Schubert <bernd.schubert@fastmail.fm> wrote:
>
>
>
> On 6/6/23 16:37, Miklos Szeredi wrote:
> > On Sun, 14 May 2023 at 00:04, Askar Safin <safinaskar@gmail.com> wrote:
> >>
> >> Will this patch fix a long-standing fuse vs suspend bug? (
> >> https://bugzilla.kernel.org/show_bug.cgi?id=34932 )
> >
> > No.
> >
> > The solution to the fuse issue is to freeze processes that initiate
> > fuse requests *before* freezing processes that serve fuse requests.
> >
> > The problem is finding out which is which. This can be complicated by
> > the fact that a process could be both serving requests *and*
> > initiating them (even without knowing).
> >
> > The best idea so far is to let fuse servers set a process flag
> > (PF_FREEZE_LATE) that is inherited across fork/clone. For example the
> > sshfs server would do the following before starting request processing
> > or starting ssh:
> >
> > echo 1 > /proc/self/freeze_late
> >
> > This would make the sshfs and ssh processes be frozen after processes
> > that call into the sshfs mount.
>
> Hmm, why would this need to be done manually on the server (daemon)
> side? It could be automated on the fuse kernel side, for example in
> process_init_reply() using current task context?
Setting the flag for the current task wouldn't be sufficient, it would
need to set it for all threads of a process. Even that wouldn't work
for e.g. sshfs, which forks off ssh before starting request
processing.
So I'd prefer setting this explicitly. This could be done from
libfuse, before starting threads. Or, as in the case of sshfs, it
could be done by the filesystem itself.
>
> A slightly better version would give scores, the later the daemon/server
> is created the higher its freezing score - would help a bit with stacked
> fuse file systems, although not perfectly. For that struct task would
> need to be extended, though.
If we can quiesce the top of the stack, then hopefully all the lower
ones will also have no activity. There could be special cases, but
that would need to be dealt with in the fuse server itself.
Thanks,
Miklos
next prev parent reply other threads:[~2023-06-07 7:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-13 22:03 [PATCH 0/6] vfs: provide automatic kernel freeze / resume Askar Safin
2023-06-06 14:37 ` Miklos Szeredi
2023-06-06 15:47 ` Askar Safin
2023-06-06 19:37 ` [fuse-devel] " Nikolaus Rath
2023-06-07 7:04 ` Miklos Szeredi
2023-06-06 20:18 ` Bernd Schubert
2023-06-07 7:21 ` Miklos Szeredi [this message]
2023-06-07 8:11 ` Bernd Schubert
2023-06-07 9:29 ` Miklos Szeredi
2023-06-07 11:13 ` Askar Safin
2023-06-07 13:42 ` Miklos Szeredi
2023-06-09 12:49 ` Askar Safin
-- strict thread matches above, loose matches on Subject: below --
2023-05-08 1:17 Luis Chamberlain
2023-05-08 1:21 ` Luis Chamberlain
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='CAJfpeguQ87Vxdn-+c4yYy7=hKnSYwWJNe22f-6dG8FNAwjWBXA@mail.gmail.com' \
--to=miklos@szeredi.hu \
--cc=bernd.schubert@fastmail.fm \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=safinaskar@gmail.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).