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.8 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 9F432C433DF for ; Mon, 29 Jun 2020 18:14:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B3CA2559D for ; Mon, 29 Jun 2020 18:14:52 +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="a+hxoc/w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B3CA2559D 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 0A7838D0008; Mon, 29 Jun 2020 14:14:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 058A58D0005; Mon, 29 Jun 2020 14:14:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB0ED8D0008; Mon, 29 Jun 2020 14:14:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id D79E78D0005 for ; Mon, 29 Jun 2020 14:14:51 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 93C5F181AC9C6 for ; Mon, 29 Jun 2020 18:14:51 +0000 (UTC) X-FDA: 76983050382.28.dress14_5a0706c26e71 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 6BD286C05 for ; Mon, 29 Jun 2020 18:14:51 +0000 (UTC) X-HE-Tag: dress14_5a0706c26e71 X-Filterd-Recvd-Size: 2871 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Mon, 29 Jun 2020 18:14:50 +0000 (UTC) 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=EzpP6/tXVbYmUjkIkwNB4TNbA0hvgYre2cHIlKy78VY=; b=a+hxoc/wudqJ8fuDdCjBXKmUN/ tMZ+1aHfHQgSQi0zR0LrFrQccoIlxj4biTORp9xc7PJ13llbn3/XJUMvmqc1ljeSf8gFxnVAXXjL9 bvLZyi6HF38DftSqlsQFJwe4yIp6BgWccG/E2jHuOETvda3TUT+4LSclubcfoBuQo6Xym768X1Yoy U+VHxOma/oKZxJvX6V+Lzx8bLckXtuh5GZLZGskHHL+w59C+IXt+Zi8GyacYDI51JYPvIZRdjNMri IyLUDKXjr8Vb/M+nPbzZR86RAnrCV8fczWbWbJafD+ULCiddFLL/CwzPqmB4xi8kScyFHCt8kO4yV TBQKOHzw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpyIi-0005YS-40; Mon, 29 Jun 2020 18:14:40 +0000 Date: Mon, 29 Jun 2020 19:14:40 +0100 From: Matthew Wilcox To: Mike Kravetz Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH 5/7] mm: Replace hpage_nr_pages with thp_nr_pages Message-ID: <20200629181440.GG25523@casper.infradead.org> References: <20200629151959.15779-1-willy@infradead.org> <20200629151959.15779-6-willy@infradead.org> <8bf5ae79-eace-5345-1a77-69d9e2e083b3@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8bf5ae79-eace-5345-1a77-69d9e2e083b3@oracle.com> X-Rspamd-Queue-Id: 6BD286C05 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 Mon, Jun 29, 2020 at 10:40:12AM -0700, Mike Kravetz wrote: > > +++ b/mm/hugetlb.c > > @@ -1593,7 +1593,7 @@ static struct address_space *_get_hugetlb_page_mapping(struct page *hpage) > > > > /* Use first found vma */ > > pgoff_start = page_to_pgoff(hpage); > > - pgoff_end = pgoff_start + hpage_nr_pages(hpage) - 1; > > + pgoff_end = pgoff_start + thp_nr_pages(hpage) - 1; > > anon_vma_interval_tree_foreach(avc, &anon_vma->rb_root, > > pgoff_start, pgoff_end) { > > struct vm_area_struct *vma = avc->vma; > > Naming consistency is a good idea! > > I was wondering why hugetlb code would be calling a 'thp related' routine. > The reason is that hpage_nr_pages was incorrectly added (by me) to get the > number of pages in a hugetlb page. If the name of the routine was thp_nr_pages > as proposed, I would not have made this mistake. > > I will provide a patch to change the above hpage_nr_pages call to > pages_per_huge_page(page_hstate()). Thank you! Clearly I wasn't thinking about this patch and just did a mindless search-and-replace! I should evaluate the other places where I did this and see if any of them are wrong too.