linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [RFC PATCH v5] f2fs: support data compression
Date: Thu, 19 Dec 2019 10:53:52 +0100	[thread overview]
Message-ID: <CAMuHMdVvqccd_iwdz8khxYKUjrD-pnBYggagVCYZyNmbZxB9Tw@mail.gmail.com> (raw)
In-Reply-To: <20191216062806.112361-1-yuchao0@huawei.com>

On Mon, Dec 16, 2019 at 7:29 AM Chao Yu <yuchao0@huawei.com> wrote:
> This patch tries to support compression in f2fs.

> +static int f2fs_write_raw_pages(struct compress_ctx *cc,
> +                                       int *submitted,
> +                                       struct writeback_control *wbc,
> +                                       enum iostat_type io_type,
> +                                       bool compressed)
> +{
> +       int i, _submitted;
> +       int ret, err = 0;
> +
> +       for (i = 0; i < cc->cluster_size; i++) {
> +               if (!cc->rpages[i])
> +                       continue;
> +retry_write:
> +               BUG_ON(!PageLocked(cc->rpages[i]));
> +
> +               ret = f2fs_write_single_data_page(cc->rpages[i], &_submitted,
> +                                               NULL, NULL, wbc, io_type);
> +               if (ret) {
> +                       if (ret == AOP_WRITEPAGE_ACTIVATE) {
> +                               unlock_page(cc->rpages[i]);
> +                               ret = 0;
> +                       } else if (ret == -EAGAIN) {
> +                               ret = 0;
> +                               cond_resched();
> +                               congestion_wait(BLK_RW_ASYNC, HZ/50);

On some platforms, HZ can be less than 50.
What happens if congestion_wait() is called with a zero timeout?

> +                               lock_page(cc->rpages[i]);
> +                               clear_page_dirty_for_io(cc->rpages[i]);
> +                               goto retry_write;
> +                       }
> +                       err = ret;
> +                       goto out_fail;
> +               }
> +
> +               *submitted += _submitted;
> +       }
> +       return 0;
> +
> +out_fail:
> +       /* TODO: revoke partially updated block addresses */
> +       BUG_ON(compressed);
> +
> +       for (++i; i < cc->cluster_size; i++) {
> +               if (!cc->rpages[i])
> +                       continue;
> +               redirty_page_for_writepage(wbc, cc->rpages[i]);
> +               unlock_page(cc->rpages[i]);
> +       }
> +       return err;
> +}

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds


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

  parent reply	other threads:[~2019-12-19  9:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16  6:28 [f2fs-dev] [RFC PATCH v5] f2fs: support data compression Chao Yu
2019-12-16 11:08 ` Markus Elfring
2019-12-16 13:12   ` Chao Yu
2019-12-16 11:32 ` Markus Elfring
2019-12-16 13:24   ` Chao Yu
2019-12-16 11:51 ` Markus Elfring
2019-12-16 13:28   ` Chao Yu
2019-12-16 13:38     ` [f2fs-dev] [v5] " Markus Elfring
2019-12-18 21:46 ` [f2fs-dev] [RFC PATCH v5] " Jaegeuk Kim
2019-12-23  3:32   ` Chao Yu
2019-12-23  3:58     ` Chao Yu
2019-12-23 19:29     ` Jaegeuk Kim
2019-12-31  0:46     ` Jaegeuk Kim
2019-12-31  1:45       ` Chao Yu
2020-01-02 18:18         ` Jaegeuk Kim
2020-01-02 19:00           ` Jaegeuk Kim
2020-01-03  6:50             ` Chao Yu
2020-01-06  9:01               ` Chao Yu
2020-01-06 18:16                 ` Jaegeuk Kim
2020-01-10 23:52                   ` Jaegeuk Kim
2020-01-11  9:08                     ` Chao Yu
2020-01-11 18:02                       ` Jaegeuk Kim
2020-01-13  8:56                         ` Chao Yu
2020-01-13 16:11                           ` Jaegeuk Kim
2020-01-14  1:52                             ` Chao Yu
2020-01-14 22:48                               ` Jaegeuk Kim
2020-01-15 10:12                                 ` Chao Yu
2020-01-15 21:38                                   ` Jaegeuk Kim
2020-01-03  1:19           ` Chao Yu
2019-12-19  9:53 ` Geert Uytterhoeven [this message]
2019-12-23  3:36   ` Chao Yu
2019-12-19 10:18 ` Geert Uytterhoeven
2019-12-19 10:25 ` Geert Uytterhoeven
2019-12-20 21:26   ` Jaegeuk Kim

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=CAMuHMdVvqccd_iwdz8khxYKUjrD-pnBYggagVCYZyNmbZxB9Tw@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.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).