Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp77306pxb; Wed, 20 Oct 2021 16:57:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylRyxsxyrxoCB4nnlgqvQnC2u252EBbSVETctp8XrwPKl80Ur76aq4beBq8+kueLC+G/4I X-Received: by 2002:a17:907:6d9f:: with SMTP id sb31mr2935375ejc.109.1634774274185; Wed, 20 Oct 2021 16:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634774274; cv=none; d=google.com; s=arc-20160816; b=HQ0ngvryksE4vPjWd6NFWjXp2RqrGIxtlN4DMKrJ+pcas5wAILqu9Qe0tk1Gul/zgi b3/o5ClciT0rECel0gDMBuCHJ0GxdPrPhaKBQS+sK9UPzJxsbDVbPPCTH3a3Kk6ph7DS d1o5ozaL7tRSyrODAPrcmjmkz+rDTO4hLccgYy9WYdnwA0EPkv5lh+4iqLdJ9CKMH0kA OKTqQ0taF0MCN6up9smq5tFiwSpkK/mtpISiGEBXVk9c7jn4CcB4JFUe8OJgExvXJh5M dmC5mCtO/dd1m/+1wQxpI8VjfddA+aF8aSUqqV9f42dG9kltm6EPp7LKOaKVt9dpYcok vYKg== 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=+Eio57oEZSpnsX9I7fCKLL4P+h3R1RqCxuN4ifMdK4g=; b=x3KS3sZJ+DnA+24T4mytCSzOUTqenx8P2+1DUJ/qcTX44oAYCW3owWetxOMoIzta2I hQIJDIenls+D5fmIrH3/JxMKJeAJLlSVPGy5y+Pw81Fq+ELgBK4X9Azaw79X90VNSg9F L1a5vacWT05c7CdgL9cKDC6WyR4Wn7T4n6t7bC4uy4ZkDNAImBZ0iMQ42qzDCkAjBQLU ptxFZLvHScrnosAlr9OL6D0WUnzs2C5AqMHVp+F1xysaaNQ2C8uh1GgW9oFZRMhoBWab TtAwIdXLmiVG+eT4l0ICyGDufwgwcRJF9dMin2PNuxUA2iDmDuzfiRS7v/NXyDkgSJ3G Gr3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=k+v5i7yb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fy2si4865476ejb.381.2021.10.20.16.57.05; Wed, 20 Oct 2021 16:57:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=k+v5i7yb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbhJTXyD (ORCPT + 99 others); Wed, 20 Oct 2021 19:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230343AbhJTXyC (ORCPT ); Wed, 20 Oct 2021 19:54:02 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722DBC06161C; Wed, 20 Oct 2021 16:51:47 -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=+Eio57oEZSpnsX9I7fCKLL4P+h3R1RqCxuN4ifMdK4g=; b=k+v5i7ybYI/mDCEVENeKt+R9of XGOJ0+COAA1DPOWD/P71NccqSGeWCnnsIqe5kGM+CMi1A1eBB1jmPS4tVee1kC9Ricl6Q8RVHbcdW JAzP7f/SjR/y5PkwpokYP0q4PZyAlEaWuu/2ZTOruTzaVJ/9GETnUxxwgq0Vzu4KPnvcX6ce3yRse Cvyym9DaATNrvIMzpWiB81zS2g+jQ9MUkw93KnvSg4hOV6tzQZanw2JwDtaBa3L+Ux84dNMogBuSv aZcxkehAPS/jy95u/rZUEWWPeVruweGIT7tMcMaP269riU2JQv0j5m0bFRSnDDqnnmVETY+EmJFCy 3ZLNFdkA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdLLD-00CvF6-R8; Wed, 20 Oct 2021 23:50:11 +0000 Date: Thu, 21 Oct 2021 00:49:51 +0100 From: Matthew Wilcox To: Yang Shi Cc: Hugh Dickins , Song Liu , Andrew Morton , Hao Sun , Linux MM , Linux FS-devel Mailing List , Linux Kernel Mailing List , Song Liu Subject: Re: [PATCH] fs: buffer: check huge page size instead of single page for invalidatepage Message-ID: References: <20210917205731.262693-1-shy828301@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 04:38:49PM -0700, Yang Shi wrote: > > However, it still doesn't make too much sense to have thp_size passed > > to do_invalidatepage(), then have PAGE_SIZE hardcoded in a BUG > > assertion IMHO. So it seems this patch is still useful because > > block_invalidatepage() is called by a few filesystems as well, for > > example, ext4. Or I'm wondering whether we should call > > do_invalidatepage() for each subpage of THP in truncate_cleanup_page() > > since private is for each subpage IIUC. > > Seems no interest? No. I have changes in this area as part of the folio patchset (where we end up converting this to invalidate_folio). I'm not really interested in doing anything before that, since this shouldn't be reachable today. > Anyway the more I was staring at the code the more I thought calling > do_invalidatepage() for each subpage made more sense. So, something > like the below makes sense? Definitely not. We want to invalidate the entire folio at once.