From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98EB0C433E0 for ; Thu, 21 May 2020 23:30:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5A01220825 for ; Thu, 21 May 2020 23:30:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="N5J5du6C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A01220825 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB59F80008; Thu, 21 May 2020 19:30:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E65C580007; Thu, 21 May 2020 19:30:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D7AED80008; Thu, 21 May 2020 19:30:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id BC38180007 for ; Thu, 21 May 2020 19:30:42 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 83077180AD81F for ; Thu, 21 May 2020 23:30:42 +0000 (UTC) X-FDA: 76842323124.23.knot08_7a94369903a33 X-HE-Tag: knot08_7a94369903a33 X-Filterd-Recvd-Size: 2518 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 May 2020 23:30:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=RhE3yWup8bHUwtywMD5yH07SvtWjgpVhodD0ZZuomP0=; b=N5J5du6CShT9yrhCSYdsYxYRZg +xctwrcmgRx7E1WIBTd/kqRzdaaqMPw+9dL390Bga2Heo3zXhU2LR4FV3JcGqHZ/tIOY7aOQIGWdJ lCjCZC4TxxVYTHhj8KEDMc3pN1/DYq18prmZ7q8uFBtu5vy51KaJnOt/Zy3a3AphyIw+LeynfQRb7 rRQXvzpR1ssWXjzj5CnnIWICS++w+/2aUGu1V5ZwVoFHPG0P+h8JQKNumwr76fbQyqssJ7y9a3rx9 hHVryxdOhYpFD7b2qT4f39LFXvmWAnXhhfnfP9rIl+vTKYC9z7m8sbbIcQh7pgIP+CotEMMe1Dyzz m6wB7xaQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbue9-0000Na-6b; Thu, 21 May 2020 23:30:41 +0000 Date: Thu, 21 May 2020 16:30:41 -0700 From: Matthew Wilcox To: Dave Chinner Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: Re: [PATCH v4 10/36] fs: Make page_mkwrite_check_truncate thp-aware Message-ID: <20200521233041.GG28818@bombadil.infradead.org> References: <20200515131656.12890-1-willy@infradead.org> <20200515131656.12890-11-willy@infradead.org> <20200521220139.GS2005@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521220139.GS2005@dread.disaster.area> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, May 22, 2020 at 08:01:39AM +1000, Dave Chinner wrote: > On Fri, May 15, 2020 at 06:16:30AM -0700, Matthew Wilcox wrote: > > if (page->mapping != inode->i_mapping) > > return -EFAULT; > > > > /* page is wholly inside EOF */ > > - if (page->index < index) > > - return PAGE_SIZE; > > + if (page->index + hpage_nr_pages(page) - 1 < index) > > + return thp_size(page); > > Can we make these interfaces all use the same namespace prefix? > Here we have a mix of thp and hpage and I have no clue how hpages > are different to thps. If they refer to the same thing (i.e. huge > pages) then can we please make the API consistent before splattering > it all over the filesystem code? Yes, they're the same thing. I'll rename hpage_nr_pages() to thp_count().