Re: [PATCH v12 2/2] fuse: add default_request_timeout and max_request_timeout sysctls

Joanne Koong
2025-01-23T16:51:46Z

On Thu, Jan 23, 2025 at 6:42 AM Bernd Schubert <bschubert@ddn.com> wrote:
>
>
>
> On 1/23/25 15:28, Miklos Szeredi wrote:
> > On Thu, 23 Jan 2025 at 10:21, Luis Henriques <luis@igalia.com> wrote:
> >>
> >> Hi Joanne,
> >>
> >> On Wed, Jan 22 2025, Joanne Koong wrote:
> >>
> >>> Introduce two new sysctls, "default_request_timeout" and
> >>> "max_request_timeout". These control how long (in seconds) a server can
> >>> take to reply to a request. If the server does not reply by the timeout,
> >>> then the connection will be aborted. The upper bound on these sysctl
> >>> values is 65535.
> >>>
> >>> "default_request_timeout" sets the default timeout if no timeout is
> >>> specified by the fuse server on mount. 0 (default) indicates no default
> >>> timeout should be enforced. If the server did specify a timeout, then
> >>> default_request_timeout will be ignored.
> >>>
> >>> "max_request_timeout" sets the max amount of time the server may take to
> >>> reply to a request. 0 (default) indicates no maximum timeout. If
> >>> max_request_timeout is set and the fuse server attempts to set a
> >>> timeout greater than max_request_timeout, the system will use
> >>> max_request_timeout as the timeout. Similarly, if default_request_timeout
> >>> is greater than max_request_timeout, the system will use
> >>> max_request_timeout as the timeout. If the server does not request a
> >>> timeout and default_request_timeout is set to 0 but max_request_timeout
> >>> is set, then the timeout will be max_request_timeout.
> >>>
> >>> Please note that these timeouts are not 100% precise. The request may
> >>> take roughly an extra FUSE_TIMEOUT_TIMER_FREQ seconds beyond the set max
> >>> timeout due to how it's internally implemented.
> >>>
> >>> $ sysctl -a | grep fuse.default_request_timeout
> >>> fs.fuse.default_request_timeout = 0
> >>>
> >>> $ echo 65536 | sudo tee /proc/sys/fs/fuse/default_request_timeout
> >>> tee: /proc/sys/fs/fuse/default_request_timeout: Invalid argument
> >>>
> >>> $ echo 65535 | sudo tee /proc/sys/fs/fuse/default_request_timeout
> >>> 65535
> >>>
> >>> $ sysctl -a | grep fuse.default_request_timeout
> >>> fs.fuse.default_request_timeout = 65535
> >>>
> >>> $ echo 0 | sudo tee /proc/sys/fs/fuse/default_request_timeout
> >>> 0
> >>>
> >>> $ sysctl -a | grep fuse.default_request_timeout
> >>> fs.fuse.default_request_timeout = 0
> >>>
> >>> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> >>> Reviewed-by: Bernd Schubert <bschubert@ddn.com>
> >>> Reviewed-by: Josef Bacik <josef@toxicpanda.com>
> >>> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
> >
> > Thanks, applied and pushed with some cleanups including Luis's clamp idea.
>
> Hi Miklos,
>
> I don't think the timeouts do work with io-uring yet, I'm not sure
> yet if I have time to work on that today or tomorrow (on something
> else right now, I can try, but no promises).

Hi Bernd,

What are your thoughts on what is missing on the io-uring side for
timeouts? If a request times out, it will abort the connection and
AFAICT, the abort logic should already be fine for io-uring, as users
can currently abort the connection through the sysfs interface and
there's no internal difference in aborting through sysfs vs timeouts.

Thanks,
Joanne

>
> How shall we handle it, if I don't manage in time?
>
>
> Thanks,
> Bernd
>