[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f8072007-94c9-6d37-b0ff-37538cf8bf98@huawei.com>
Date: Mon, 23 Dec 2019 11:36:51 +0800
From: Chao Yu <yuchao0@...wei.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
CC: Jaegeuk Kim <jaegeuk@...nel.org>,
<linux-f2fs-devel@...ts.sourceforge.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Chao Yu <chao@...nel.org>
Subject: Re: [RFC PATCH v5] f2fs: support data compression
On 2019/12/19 17:53, Geert Uytterhoeven wrote:
> On Mon, Dec 16, 2019 at 7:29 AM Chao Yu <yuchao0@...wei.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
>
Powered by blists - more mailing lists