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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 1AEFAC04EB5 for ; Sat, 8 Feb 2020 04:48:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CFBBF2082E for ; Sat, 8 Feb 2020 04:48:14 +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="FeANCCw8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFBBF2082E 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 5A7086B0007; Fri, 7 Feb 2020 23:48:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 556866B0008; Fri, 7 Feb 2020 23:48:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46C956B000A; Fri, 7 Feb 2020 23:48:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 2BCBC6B0007 for ; Fri, 7 Feb 2020 23:48:14 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C1970181AC9CC for ; Sat, 8 Feb 2020 04:48:13 +0000 (UTC) X-FDA: 76465728066.20.cub22_2ab0f80c5e528 X-HE-Tag: cub22_2ab0f80c5e528 X-Filterd-Recvd-Size: 3286 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Sat, 8 Feb 2020 04:48:13 +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=CUvZJ3IRHIsMPjufe2d1b0T3yfdVj9Ie5w3CX/XF2sU=; b=FeANCCw82DzoF9b3OtFgcPoJcN HjpjQgoALr3HEQ4xA4E5WcAsVKHzLCCzH2HkIeyXhdfftvtGCyAhHpNePOS93qz9i7x8xABZ7zNss Ao1GScGxH6Zy5vK1zQsat7RIuLI+dak7g+pKDXgxuffgC65opkXV1olqE61/onWj9j84StTW1/85b m8QBfYBb/0N6gqAewRDfYH1vD9RHL4LPllB3G0lnqEV3wuKirfz3dlfyt0abzbhcJh6iRUfBReR+b BQqhzAb7Wx1EIsj9wOnMPnAkbDxH3hKzlMcZ4y6HnuDnrjOhrx8QNoKS5V/cEymqSgcHLkjKGflLs WZT1/I/w==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j0I2K-0000mF-OG; Sat, 08 Feb 2020 04:48:08 +0000 Date: Fri, 7 Feb 2020 20:48:08 -0800 From: Matthew Wilcox To: linux-mm@kvack.org Cc: "Kirill A . Shutemov" , John Hubbard Subject: Re: [PATCH] mm: Improve dump_page() for compound pages Message-ID: <20200208044808.GJ8731@bombadil.infradead.org> References: <20200208044415.30012-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200208044415.30012-1-willy@infradead.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Feb 07, 2020 at 08:44:15PM -0800, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > There was no protection against a corrupted struct page having an > implausible compound_head(). Sanity check that a compound page has > a head within reach of the maximum allocatable page (this will need > to be adjusted if one of the plans to allocate 1GB pages comes to > fruition). In addition, > > - Print the mapping pointer using %p insted of %px. The actual value of > the pointer can be read out of the raw page dump and using %p gives a > chance to correlate it with an earlier printk of the mapping pointer > - Print the mapping pointer from the head page, not the tail page > (the tail ->mapping pointer may be in use for other purposes, eg part > of a list_head) > - Print the order of the page for compound pages > - Dump the raw head page as well as the raw page > - Print the refcount from the head page, not the tail page > > Suggested-by: Kirill A. Shutemov > Co-developed-by: John Hubbard > Signed-off-by: Matthew Wilcox (Oracle) John, in comparison to the patch I sent earlier today, this version changes: - Reorder the things printed in the compound case so that all the information which is printed for non-compound pages is printed first - Removed inconsistent space between "compound_mapcount:" and the value - Print the refcount of the head page instead of the tail (which was the point of your patch!) - Print the mapping of the head instead of the tail - Don't dump the raw head if the page passed in was the head page