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.7 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,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 1B842C32792 for ; Thu, 3 Oct 2019 05:09:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CBA0F21D81 for ; Thu, 3 Oct 2019 05:09:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CBA0F21D81 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 51FF16B0005; Thu, 3 Oct 2019 01:09:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4AA286B0006; Thu, 3 Oct 2019 01:09:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 372086B0007; Thu, 3 Oct 2019 01:09:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id 0EEF76B0005 for ; Thu, 3 Oct 2019 01:09:18 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 6DC70181AC9B4 for ; Thu, 3 Oct 2019 05:09:17 +0000 (UTC) X-FDA: 76001294754.24.form92_33cf7c6e77124 X-HE-Tag: form92_33cf7c6e77124 X-Filterd-Recvd-Size: 2025 Received: from mail3-163.sinamail.sina.com.cn (mail3-163.sinamail.sina.com.cn [202.108.3.163]) by imf41.hostedemail.com (Postfix) with SMTP for ; Thu, 3 Oct 2019 05:09:15 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([124.64.2.167]) by sina.com with ESMTP id 5D9582760002DC4C; Thu, 3 Oct 2019 13:09:12 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 28042849284245 From: Hillf Danton To: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/15] mm: Remove hpage_nr_pages Date: Thu, 3 Oct 2019 13:08:59 +0800 Message-Id: <20191003050859.18140-1-hdanton@sina.com> In-Reply-To: <20190925005214.27240-1-willy@infradead.org> References: <20190925005214.27240-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000136, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 24 Sep 2019 17:52:02 -0700 From: Matthew Wilcox (Oracle) >=20 > @@ -354,7 +354,7 @@ vma_address(struct page *page, struct vm_area_struc= t *vma) > unsigned long start, end; >=20 > start =3D __vma_address(page, vma); > - end =3D start + PAGE_SIZE * (hpage_nr_pages(page) - 1); > + end =3D start + page_size(page) - 1; >=20 > @@ -57,7 +57,7 @@ static inline bool pfn_in_hpage(struct page *hpage, u= nsigned long pfn) > unsigned long hpage_pfn =3D page_to_pfn(hpage); >=20 > /* THP can be referenced by any subpage */ > - return pfn >=3D hpage_pfn && pfn - hpage_pfn < hpage_nr_pages(hpage); > + return (pfn - hpage_pfn) < compound_nr(hpage); > } >=20 > @@ -264,7 +264,7 @@ int page_mapped_in_vma(struct page *page, struct vm= _area_struct *vma) > unsigned long start, end; >=20 > start =3D __vma_address(page, vma); > - end =3D start + PAGE_SIZE * (hpage_nr_pages(page) - 1); > + end =3D start + page_size(page) - 1; >=20 > if (unlikely(end < vma->vm_start || start >=3D vma->vm_end)) Be certain that nothing is added other than mechanical replacings in the above hunks.