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=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 7E127C433DF for ; Sat, 11 Jul 2020 01:30:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 19CBE2075F for ; Sat, 11 Jul 2020 01:30:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="msO6SEbT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19CBE2075F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5CEF78D0002; Fri, 10 Jul 2020 21:30:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57EF08D0001; Fri, 10 Jul 2020 21:30:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 446BE8D0002; Fri, 10 Jul 2020 21:30:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id 2E1678D0001 for ; Fri, 10 Jul 2020 21:30:53 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C6668181AEF15 for ; Sat, 11 Jul 2020 01:30:52 +0000 (UTC) X-FDA: 77024065944.08.ball05_3e1492826ed3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 9FD3C1819E76B for ; Sat, 11 Jul 2020 01:30:52 +0000 (UTC) X-HE-Tag: ball05_3e1492826ed3 X-Filterd-Recvd-Size: 4090 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Sat, 11 Jul 2020 01:30:51 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 10 Jul 2020 18:29:55 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 10 Jul 2020 18:30:50 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 10 Jul 2020 18:30:50 -0700 Received: from [10.2.51.208] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sat, 11 Jul 2020 01:30:50 +0000 Subject: Re: [PATCH v2 1/6] mm: Handle page->mapping better in dump_page To: "Matthew Wilcox (Oracle)" , CC: Andrew Morton , Vlastimil Babka , "Kirill A. Shutemov" , William Kucharski , Mike Rapoport References: <20200709202117.7216-1-willy@infradead.org> <20200709202117.7216-2-willy@infradead.org> From: John Hubbard Message-ID: <15cff11a-6762-8a6a-3f0e-dd227280cd6f@nvidia.com> Date: Fri, 10 Jul 2020 18:30:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200709202117.7216-2-willy@infradead.org> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1594430995; bh=vE8DJxEWqWGcdBhLpwKFxq6+peWXYfPVmxIkNmlVyhQ=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=msO6SEbTiyfy4EuPc7tN4Ii1slTss2Sh4mt/doFlMLqzPLZxaT7H5T+jdDNai8jF7 uOnpCfYFoNRwVPBQy0BVZFrqJ5zvGuTnNs6+XdCxMLWZEHZhGsOENstObh2sVZ4Bun eQz/bzSgcGQ3mL7vfwtqBoE6z9J5V4K6OHnrOTcsrYklGopmvXTzGx5Vajw4PvIyBQ fYv/a5mCa+CWe/2vylWyzbFT7h9LYyddO2imj2+0DIeRStktS3khxfUBNbU9jPYUIO isqVxDG60O0i73syWLbt1RirE5Ha/D9iLbt60t1MoFG4QTn6fE/Syh0cVOkxmgPhB9 V+MeElqmVVFCw== X-Rspamd-Queue-Id: 9FD3C1819E76B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 2020-07-09 13:21, Matthew Wilcox (Oracle) wrote: > If we can't call page_mapping() to get the page mapping, handle the > anon/ksm/movable bits correctly. Hi Matthew, I see why you did this, as otherwise the new printing won't work. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > mm/debug.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/mm/debug.c b/mm/debug.c > index 4f376514744d..e5de63406b59 100644 > --- a/mm/debug.c > +++ b/mm/debug.c > @@ -70,7 +70,12 @@ void __dump_page(struct page *page, const char *reason) > > if (page < head || (page >= head + MAX_ORDER_NR_PAGES)) { > /* Corrupt page, cannot call page_mapping */ It's tricky to step lightly through the debris of corrupted page pointer here, but how about this updated comment, to replace the one-liner above: /* * Corrupt page, so we cannot call page_mapping. Instead, do a * safe subset of the steps that page_mapping() does. Caution: * this will be misleading for tail pages, PageSwapCache pages, * and potentially other situations. (See the page_mapping() * implementation for what's missing here.) */ > - mapping = page->mapping; > + unsigned long tmp = (unsigned long)page->mapping; > + > + if (tmp & PAGE_MAPPING_ANON) > + mapping = NULL; > + else > + mapping = (void *)(tmp & ~PAGE_MAPPING_FLAGS); > head = page; > compound = false; > } else { > thanks, -- John Hubbard NVIDIA