Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6786171rwp; Tue, 18 Jul 2023 06:02:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlFt5UKjCwoUwx2UQldy0p0aMAZsznicfKQsYO6OA8GhZiD4TEPNqt1IJ9RbcPDRSyKKc9OL X-Received: by 2002:a05:6a20:8e10:b0:132:87da:5b57 with SMTP id y16-20020a056a208e1000b0013287da5b57mr18951333pzj.59.1689685343216; Tue, 18 Jul 2023 06:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689685343; cv=none; d=google.com; s=arc-20160816; b=xZrGNl7Q4Vlfxm9fPxafceYI8HRkFQgsaxbAfQlwUoAi/kzMxG3S7SJqrwbNuSQI3G gqZ8TBYNGn5tgVYKrZp/2hKn+MoArt/qymmK21cyvHd/MVUVs6BRKDUl2RQY9ppSQIEo vWa7F3tweyfDyWjlN2j9/1FimuJPZL9FdocF8gxcduiidZCvQh8H4QJJKOFwdjauOJ3X QHVEmZtB5W+TJ3DpUVNULf8bCOCsrH9iE8CgmNLNTg45kzYoiPbfyFswgkRK2+Tt0XvW df7DGFBQ6/Tt2WCIMnvUWfhCTXZFISfH8d3NP0dp6U0LD9Hdtzb1JsI4fdKC6A7qrVuF /yLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=38/HcavGMLdOTdEvWvrDYrwSNnsmKOja8fA+/259gms=; fh=Jp+ytMKeMTZKR7jSteZKAGcJbZI5xYndYufcPmLPvnI=; b=DALdoEt1kBhPucFmTlnZa4EL/C6T1hkmoObFDJekxWeXk7fX5W7jdattekV7lbTjvS 7FyR/gutj/ioMaAePlatmhfN2GIJzMxvKQIVn5VIJuJ7hq6ob7mznJkGaGvZPwqlQjD8 VO0rMhabu9oDjpJqwSMgZAqVXVkQMAqcMdFjocc2rC0OvOC4wBYFA4jv9Tp0pU4iOY+1 vyNX7NPAxbO2pF+E0fi6WQP5BXCz1K09W1c9ctTP2kj9oTbfnl8cS3m3ekz9oYm2IEDa VFWiEKLzqW2dNXv7SWxJs9JIaGL7llSiBhrtjyJhyGfqqkJ7YEAjntigZZ6LFAkrX7/0 8f5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020a63ef13000000b0055b76613808si1530261pgh.214.2023.07.18.06.01.42; Tue, 18 Jul 2023 06:02:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232303AbjGRM4Y (ORCPT + 99 others); Tue, 18 Jul 2023 08:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbjGRM4X (ORCPT ); Tue, 18 Jul 2023 08:56:23 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6FB4D1 for ; Tue, 18 Jul 2023 05:56:21 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R4zQJ1GN1ztRBF; Tue, 18 Jul 2023 20:53:12 +0800 (CST) Received: from [10.174.179.160] (10.174.179.160) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 18 Jul 2023 20:56:17 +0800 Message-ID: Date: Tue, 18 Jul 2023 20:56:16 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 1/6] mm/page_io: use a folio in __end_swap_bio_read() Content-Language: en-US To: Matthew Wilcox CC: , , , , , References: <20230717132602.2202147-1-zhangpeng362@huawei.com> <20230717132602.2202147-2-zhangpeng362@huawei.com> From: "zhangpeng (AS)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.160] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/7/17 21:34, Matthew Wilcox wrote: > On Mon, Jul 17, 2023 at 09:25:57PM +0800, Peng Zhang wrote: >> +++ b/mm/page_io.c >> @@ -58,18 +58,18 @@ static void end_swap_bio_write(struct bio *bio) >> >> static void __end_swap_bio_read(struct bio *bio) >> { >> - struct page *page = bio_first_page_all(bio); >> + struct folio *folio = page_folio(bio_first_page_all(bio)); > Should we have a bio_first_folio_all()? It wouldn't save any calls to > compound_head(), but it's slightly easier to use. Yes, I'll convert bio_first_page_all() to bio_first_folio_all() in a v2. Thanks. >> if (bio->bi_status) { >> - SetPageError(page); >> - ClearPageUptodate(page); >> + folio_set_error(folio); > I appreciate this is a 1:1 conversion, but maybe we could think about > this a bit. Is there anybody who checks the > PageError()/folio_test_error() for this page/folio? Maybe wait_dev_supers() checks the PageError() after write_dev_supers() in fs/btrfs/disk-io.c? >> + folio_clear_uptodate(folio); > Similarly ... surely the folio is already !uptodate, so we don't need to > clear the flag? Indeed, the folio is already !uptodate. I'll drop this line in a v2. Thanks for your feedback. -- Best Regards, Peng