Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7067321rwp; Tue, 18 Jul 2023 09:31:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlH7E8fBCaxbDPG93VFwkJ+hDMaNctGOzanW6q6OZSphkr1+xkpHZQXAFJENEAhlRA5UZvK5 X-Received: by 2002:a05:651c:2109:b0:2b7:34c0:a03a with SMTP id a9-20020a05651c210900b002b734c0a03amr7818507ljq.3.1689697908150; Tue, 18 Jul 2023 09:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689697908; cv=none; d=google.com; s=arc-20160816; b=tCGYYqlSQUCziiISUxSBB35QxVyDSGlitILyhctUVxSolpsiIfPwXk3NGHGcf/yB12 E7BnMIncvgareIc0xf2PB2PVCZWPvBg1lO8+SnUnsNvBVeu1egoGQZpg2fW9uXeLEM7j xm9slU5a5EeKY19gdbACbxtI4igq6aXxlQmYaY9OhXooVYOjhLKE8N83L7X+1q/52W0E RQQVtwgD5BCkoCAvOB6vshdR4PwzpRiNB7pQO6yh+sAW4smQnmXli19QaaLM35Zwh2k3 DIwRL9UqOl4WvErEzGTITvXYFpPUSFABWSIfOHi3P5bw/7xIP3fugdTvNTfVV604WXHf hGdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=u9BHQvttlzeTCBclAmv6cmgN9khV9hmdF8Tu8zmlFTU=; fh=dWeR9wpoaXb0M+TXQSM86sgqguqHQwh22SAXrSDuSAY=; b=sUqL9YoC3/wIlhEKS32hWyjNX27sOlLoF+H/MN1kOlosk5t65Dn4TYFKYvRyTlUd+L i4JOjXArGpDCkEiaV98lwjUs65+sUjvqrAyGzngFtC7AJvuP5GG4NBDKhBDcq/jKsqYW g0bn6f6uU5HbknOeBRviZuyyRrPg5IIiSIqZ/yI2SY+VPp2tcoL/5RLKukkclxmZPyin 0XM0TMVc+Y8vp4+F1AqEahGYASvwZXfvicpFf4hXtzyXmd7zvSiUaUQn3zioi1xnTVMs IEci3NCtdDGgprBuv7s5JB8mSDhHEwEiCdMvnp02v/5nYHrzu9tNjzZPa9IS7NcqFt0r zsTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uQm6oxEI; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a170906449300b00992e9af8186si1326137ejo.13.2023.07.18.09.31.23; Tue, 18 Jul 2023 09:31:48 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uQm6oxEI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232374AbjGRQQb (ORCPT + 99 others); Tue, 18 Jul 2023 12:16:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbjGRQQa (ORCPT ); Tue, 18 Jul 2023 12:16:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9758BE2 for ; Tue, 18 Jul 2023 09:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=u9BHQvttlzeTCBclAmv6cmgN9khV9hmdF8Tu8zmlFTU=; b=uQm6oxEIquBuljibWe2eg/7ooK 3O2yX4DWQ0bQlHX0OzR9gmCw/hGWjVzy+xl9K7Q7YYAK5pOQgu1/aHxgoQZ49pl+ah8UV/OUBJxWU UmQxXrmSGQ8umVKYnzWopkASq20NyuCDsCdJ+7BxU85UyrXN3A9bS36QXUpy3DkhRqOsjPY4fyJya HxJyH+TFE9Gbw+AgNNoUdfIJaUvQQHGeCr6pJmS7hUsJEX1HmVVxrXs/3Vo5Dzz/BF79Y/QoTwmXu Eji9FUkyHXRW0+lMzX64YAi5/TkMdxjGcIiPXmPgHDqCIjBtl9zWKx0h+FItadl3zYJ2YBqMCEytm eWEBJjsg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qLnN1-0054rl-Ja; Tue, 18 Jul 2023 16:16:15 +0000 Date: Tue, 18 Jul 2023 17:16:15 +0100 From: Matthew Wilcox To: "zhangpeng (AS)" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, sidhartha.kumar@oracle.com, akpm@linux-foundation.org, wangkefeng.wang@huawei.com, sunnanyong@huawei.com Subject: Re: [PATCH 1/6] mm/page_io: use a folio in __end_swap_bio_read() Message-ID: References: <20230717132602.2202147-1-zhangpeng362@huawei.com> <20230717132602.2202147-2-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, Jul 18, 2023 at 08:56:16PM +0800, zhangpeng (AS) wrote: > > > 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? How does _this_ folio end up in btrfs's write_dev_supers()? This is a swap read. The only folios which are swapped are anonymous and tmpfs. btrfs takes care of doing its own I/O. wait_dev_supers() is looking for the error set in btrfs_end_super_write() which is the completion routine for write_dev_supers(). The pages involved there are attached to a btrfs address_space, not shmem or anon.