All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daeho Jeong <daeho43@gmail.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: Eric Biggers <ebiggers@kernel.org>,
	Daeho Jeong <daehojeong@google.com>,
	Nathan Huckleberry <nhuck@google.com>,
	kernel-team@android.com, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: handle decompress only post processing in softirq
Date: Tue, 14 Jun 2022 09:46:50 -0700	[thread overview]
Message-ID: <CACOAw_wjCyTmwusY6S4+NgMuLOZm9fwGfrvCT272GJ01-RP6PQ@mail.gmail.com> (raw)
In-Reply-To: <YqhRBZMYPp/kyxoe@B-P7TQMD6M-0146.local>

>
> Some my own previous thoughts about this strategy:
>
>  - If we allocate all memory and map these before I/Os, all inflight I/Os
>    will keep such temporary pages all the time until decompression is
>    finished. In contrast, if we allocate or reuse such pages just before
>    decompression, it would minimize the memory footprints.
>
>    I think it will impact the memory numbers at least on the very
>    low-ended devices with bslow storage. (I've seen f2fs has some big
>    mempool already)
>
>  - Many compression algorithms are not suitable in the softirq contexts,
>    also I vaguely remembered if softirq context lasts for > 2ms, it will
>    push into ksoftirqd instead so it's actually another process context.
>    And it may delay other important interrupt handling.
>
>  - Go back to the non-deterministic scheduling of workqueues. I guess it
>    may be just due to scheduling punishment due to a lot of CPU consuming
>    due to decompression before so the priority becomes low, but that is
>    just a pure guess. May be we need to use RT scheduling policy instead.
>
>    At least with WQ_HIGHPRI for dm-verity at least, but I don't find
>    WQ_HIGHPRI mark for dm-verity.
>
> Thanks,
> Gao Xiang

I totally understand what you are worried about. However, in the real
world, non-determinism from workqueues is more harsh than we expected.
As you know, reading I/Os in the system are critical paths most of the
time and now I/O variations with workqueue are too bad.

I also think it's better that we have RT scheduling like things here.
We could think about it more.

Thanks,

WARNING: multiple messages have this Message-ID (diff)
From: Daeho Jeong <daeho43@gmail.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: Daeho Jeong <daehojeong@google.com>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	Eric Biggers <ebiggers@kernel.org>,
	Nathan Huckleberry <nhuck@google.com>,
	kernel-team@android.com
Subject: Re: [f2fs-dev] [PATCH] f2fs: handle decompress only post processing in softirq
Date: Tue, 14 Jun 2022 09:46:50 -0700	[thread overview]
Message-ID: <CACOAw_wjCyTmwusY6S4+NgMuLOZm9fwGfrvCT272GJ01-RP6PQ@mail.gmail.com> (raw)
In-Reply-To: <YqhRBZMYPp/kyxoe@B-P7TQMD6M-0146.local>

>
> Some my own previous thoughts about this strategy:
>
>  - If we allocate all memory and map these before I/Os, all inflight I/Os
>    will keep such temporary pages all the time until decompression is
>    finished. In contrast, if we allocate or reuse such pages just before
>    decompression, it would minimize the memory footprints.
>
>    I think it will impact the memory numbers at least on the very
>    low-ended devices with bslow storage. (I've seen f2fs has some big
>    mempool already)
>
>  - Many compression algorithms are not suitable in the softirq contexts,
>    also I vaguely remembered if softirq context lasts for > 2ms, it will
>    push into ksoftirqd instead so it's actually another process context.
>    And it may delay other important interrupt handling.
>
>  - Go back to the non-deterministic scheduling of workqueues. I guess it
>    may be just due to scheduling punishment due to a lot of CPU consuming
>    due to decompression before so the priority becomes low, but that is
>    just a pure guess. May be we need to use RT scheduling policy instead.
>
>    At least with WQ_HIGHPRI for dm-verity at least, but I don't find
>    WQ_HIGHPRI mark for dm-verity.
>
> Thanks,
> Gao Xiang

I totally understand what you are worried about. However, in the real
world, non-determinism from workqueues is more harsh than we expected.
As you know, reading I/Os in the system are critical paths most of the
time and now I/O variations with workqueue are too bad.

I also think it's better that we have RT scheduling like things here.
We could think about it more.

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2022-06-14 16:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13 15:56 [f2fs-dev] [PATCH] f2fs: handle decompress only post processing in softirq Daeho Jeong
2022-06-13 15:56 ` Daeho Jeong
2022-06-14  5:38 ` Eric Biggers
2022-06-14  5:38   ` [f2fs-dev] " Eric Biggers
2022-06-14  9:12   ` Gao Xiang
2022-06-14  9:12     ` Gao Xiang
2022-06-14 16:46     ` Daeho Jeong [this message]
2022-06-14 16:46       ` Daeho Jeong
2022-06-14 17:00       ` Gao Xiang
2022-06-14 17:00         ` Gao Xiang
2022-06-14 17:49         ` Daeho Jeong
2022-06-14 17:49           ` Daeho Jeong
2022-06-14 18:10           ` Gao Xiang
2022-06-14 18:10             ` Gao Xiang
2022-06-14 16:33   ` Daeho Jeong
2022-06-14 16:33     ` [f2fs-dev] " Daeho Jeong

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=CACOAw_wjCyTmwusY6S4+NgMuLOZm9fwGfrvCT272GJ01-RP6PQ@mail.gmail.com \
    --to=daeho43@gmail.com \
    --cc=daehojeong@google.com \
    --cc=ebiggers@kernel.org \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=kernel-team@android.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nhuck@google.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.