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 C81B4C433E0 for ; Thu, 2 Jul 2020 21:01:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 855BC2075D for ; Thu, 2 Jul 2020 21:01:54 +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="YHo6SjUK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 855BC2075D 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 EAEE96B0102; Thu, 2 Jul 2020 17:01:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5FD66B0103; Thu, 2 Jul 2020 17:01:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D74FA8D0016; Thu, 2 Jul 2020 17:01:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id C32336B0102 for ; Thu, 2 Jul 2020 17:01:53 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2F7EC181AC9CC for ; Thu, 2 Jul 2020 21:01:53 +0000 (UTC) X-FDA: 76994357706.18.hook18_2d1849326e8c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id AF5C8100ED3CE for ; Thu, 2 Jul 2020 21:01:52 +0000 (UTC) X-HE-Tag: hook18_2d1849326e8c X-Filterd-Recvd-Size: 3463 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Jul 2020 21:01: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=xLAHMKuvjHjW0Bk3o8DJ+Q2rgh0ivKy23B3+CJs1Sic=; b=YHo6SjUKzPDB1fvJYbulMlFxQ4 wFOY0HrhYDtNdP+XQC7cchwqwixqoVrDaly8k5fnGEIrsqvaNZAq3porUxLEDVVo4QnwqDuH/Nssx Thg7h3YaTX2iIgQFcIrsWOnC5IAM+HN7ZYRM3WOmeA7Om+gowCi+I6hQyHLMmeq1VX7zUzsB2P8kl KdrjizRO+GOkfguiErVEpwaBzBy27EnV9f851y7ah94Z7iIPZ2dkwP33U2DBynAbB9bkOp2CWpaOP 1dKhwMh58rsWjaNES4pmi/tn5sIXhebjdF0YZ7vfL48ROSGSzAl2TqHwKuA2jF4sYPpqIHNA4vEcC Zf15r8Fg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jr6Ky-0005Xk-Ek; Thu, 02 Jul 2020 21:01:40 +0000 Date: Thu, 2 Jul 2020 22:01:40 +0100 From: Matthew Wilcox To: "Kirill A. Shutemov" Cc: Vlastimil Babka , John Hubbard , linux-mm@kvack.org, Andrew Morton , "Kirill A. Shutemov" , Mike Kravetz Subject: Re: [PATCH 1/3] mm: Print head flags in dump_page Message-ID: <20200702210140.GC25523@casper.infradead.org> References: <20200629151918.15537-2-willy@infradead.org> <20200629225134.GL25523@casper.infradead.org> <29baf5ca-1187-e00a-ee5c-5f08f7b69683@nvidia.com> <49e5da43-88bd-bac5-4dcc-5f5abb0d9a1b@suse.cz> <20200630115950.GM25523@casper.infradead.org> <20200702155336.san26vjcasbnbswy@box> <20200702203907.tgp7eblxquy3zmef@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200702203907.tgp7eblxquy3zmef@box> X-Rspamd-Queue-Id: AF5C8100ED3CE X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Thu, Jul 02, 2020 at 11:39:07PM +0300, Kirill A. Shutemov wrote: > On Thu, Jul 02, 2020 at 06:19:08PM +0200, Vlastimil Babka wrote: > > Really? We are calculatting index (pgoff) of tail page, which should be index of > > head page plus n for n'th tail page; the unit is base pages. > > But ff HugeTLB head pages use the unit of huge page in page->index, and > > page_to_pgoff() translates it to unit of base pages, then we should do the same > > when calculating the index of tail page, no? Otherwise we are adding up units of > > huge pages (from head->index) with units of base page (n'th tail) and get > > garbage as a result, AFAICS? > > You are right. I guess we can get away with this because nobody calls > page_to_pgoff() on tail pages of hugetlb page. Except when something goes > wrong and dump_page() has to deal with it. > > I'm not sure if it's worth fixing and whether the fix should be inside > page_to_pgoff(). > > The best fix would be to remove hugetlb pages special-casing: it has to > have ->index in base pagesize, not huge page. https://lore.kernel.org/linux-mm/20200629152033.16175-1-willy@infradead.org/ would be a good place to start. We'll use 8 entries for an order-9 page instead of the 1 entry that we currently do, but that's a lot better than using 512 entries.