Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2845743rwd; Fri, 26 May 2023 12:08:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6hUErTt/RiVwMt5zmJZCoa2fj4bAXAoQ+lU9emyUsBXsgX1DXfm/h7FZscWFuSm35cZvbv X-Received: by 2002:a05:6a20:3d05:b0:10c:3cf3:ef91 with SMTP id y5-20020a056a203d0500b0010c3cf3ef91mr475685pzi.4.1685128096763; Fri, 26 May 2023 12:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685128096; cv=none; d=google.com; s=arc-20160816; b=mf2lCaYh3uX7N1a7Zn3Hv9rbDKirq9FuEN2XmNlFHh3jwR3AGfR0kZmEk2enRyr2vx DWqpqauZeXzkUHW2GC44moeDJMNU4xnceOLOTaqpM3JgKg+B8Bk63ofeX2Y0vzbowWCT B4rohWRnN0JYIdSiPCZqAC1kvRCtBbF7PhJhBlgRL+kPueVyvkyM/RFYpXLidH2A0J52 PodF4u00ezn34nPaPjLeI/oJplYavIUG6JiAm8hBibRAeaXmbSqdBJ5g8kz3VVxQEpqM QowDUCYG4Vo2FBwUD3xSpb96bzUfOdHDxIk7UK7Xdyw65tdt2vDuWmdO7FJKHMiLGQsq WexA== 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=mSsoE+0p2sc9kGpcn+WU5AUctLzpkgWUGD8f1AoBzvo=; b=S/JpMfGyO4Bc1wy942HAresUKBijx6n2Jf1ljTvq74J9IK2UQHoXfY5zIjtPV9e1YR ovmAxai4j6s1FC5aZp9hnQ3rD6no+AGDEbKmTytl+VqPcxbC3fOHuhPmGSvtzJzGtbjy ONYtsHhCLnmaWx9rEbgj4adWDUHkNS9MEYyfuHvnYAAVNf5hifliaKmKvSCW2mXZaiKb EIDAFALBAS0yl5fHbq0N+YTnyiSIVmNyFd8vSzJZKbMG3ZrLNuUq9Mhe5/wDlzWp1rXM W1CMVNt3vZxvZah8hh7Vdbm/rv/ynLviD+VgpGPsZqHjZ/76X+NBebulmI0U9muMDvKo ruJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="ltD/wwR9"; 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 c19-20020a637253000000b0053145cd75besi4138185pgn.41.2023.05.26.12.08.04; Fri, 26 May 2023 12:08:16 -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="ltD/wwR9"; 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 S242328AbjEZSmg (ORCPT + 99 others); Fri, 26 May 2023 14:42:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbjEZSme (ORCPT ); Fri, 26 May 2023 14:42:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50ED4E71; Fri, 26 May 2023 11:41:58 -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=mSsoE+0p2sc9kGpcn+WU5AUctLzpkgWUGD8f1AoBzvo=; b=ltD/wwR9voMJdzOfZ705IzKtCB eZA7RNSbiHcpZdR1w/wBRURZPc/ijS/ori312B41S0Xufrmw922txQtPZmPY5+qP7FUIDuM4hr1ug 8d8UfgpK2eQOcxlveydCE6bMK2cbIXaKTL2pTOCI+ZAwJz2C2e8g7WFv21oqk8rYJaMQzBL2vqCsT /FPZsbcufMQFKMJoeBRxZMGJQv8E5b41Ajp9qlQLTNUnWkA07uvkkW0OZ1+PePVtaAvQqQSBO8N0T 0raE2IBPXMiOsqaWqfVKuHy/9DDEOR8NyExErim0sjxvhnMKn/DdO77faDX89uXK5n7vdl26kjTRW hATqoiAA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1q2cNe-0032Q1-F3; Fri, 26 May 2023 18:41:38 +0000 Date: Fri, 26 May 2023 19:41:38 +0100 From: Matthew Wilcox To: Luis Chamberlain Cc: hughd@google.com, akpm@linux-foundation.org, brauner@kernel.org, djwong@kernel.org, p.raghav@samsung.com, da.gomez@samsung.com, rohan.puri@samsung.com, rpuri.linux@gmail.com, a.manzanares@samsung.com, dave@stgolabs.net, yosryahmed@google.com, keescook@chromium.org, hare@suse.de, kbusch@kernel.org, patches@lists.linux.dev, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v2 2/8] shmem: convert to use is_folio_hwpoison() Message-ID: References: <20230526075552.363524-1-mcgrof@kernel.org> <20230526075552.363524-3-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Fri, May 26, 2023 at 10:41:00AM -0700, Luis Chamberlain wrote: > On Fri, May 26, 2023 at 03:32:54PM +0100, Matthew Wilcox wrote: > > On Fri, May 26, 2023 at 12:55:46AM -0700, Luis Chamberlain wrote: > > > The PageHWPoison() call can be converted over to the respective folio > > > call is_folio_hwpoison(). This introduces no functional changes. > > > > Yes, it very much does! > > > > > @@ -4548,7 +4548,7 @@ struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, > > > return &folio->page; > > > > > > page = folio_file_page(folio, index); > > > - if (PageHWPoison(page)) { > > > + if (is_folio_hwpoison(folio)) { > > > folio_put(folio); > > > > Imagine you have an order-9 folio and one of the pages in it gets > > HWPoison. Before, you can read the other 511 pages in the folio. > > But before we didn't use high order folios for reads on tmpfs? Sure we did! If SHMEM_HUGE_ALWAYS is set, we can see reads of THPs (order-9 folios) in this path.