linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
	<linux-f2fs-devel@lists.sourceforge.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Chao Yu <chao@kernel.org>
Subject: Re: [RFC PATCH v5] f2fs: support data compression
Date: Mon, 23 Dec 2019 11:36:51 +0800	[thread overview]
Message-ID: <f8072007-94c9-6d37-b0ff-37538cf8bf98@huawei.com> (raw)
In-Reply-To: <CAMuHMdVvqccd_iwdz8khxYKUjrD-pnBYggagVCYZyNmbZxB9Tw@mail.gmail.com>

On 2019/12/19 17:53, Geert Uytterhoeven wrote:
> 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?

Thanks for the report, will fix in a separated patch.

Thanks,

> 
>> +                               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
> 

  reply	other threads:[~2019-12-23  3:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16  6:28 [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   ` [f2fs-dev] " Chao Yu
2019-12-16 11:51 ` Markus Elfring
2019-12-16 13:28   ` Chao Yu
2019-12-16 13:38     ` [v5] " Markus Elfring
2019-12-18 21:46 ` [RFC PATCH v5] " Jaegeuk Kim
2019-12-23  3:32   ` Chao Yu
2019-12-23  3:58     ` [f2fs-dev] " 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               ` [f2fs-dev] " 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
2019-12-23  3:36   ` Chao Yu [this message]
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=f8072007-94c9-6d37-b0ff-37538cf8bf98@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=chao@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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).