Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2935080pxb; Thu, 10 Feb 2022 08:38:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoOUwGzbbmbBtJwy13TJwmKOjrVwKYqrOBWZNF3nINNbcgg5bVYlHWLHVVBPZquNE7ahq+ X-Received: by 2002:a05:6402:5290:: with SMTP id en16mr9107782edb.236.1644511126679; Thu, 10 Feb 2022 08:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644511126; cv=none; d=google.com; s=arc-20160816; b=Gy3c2p8AFgHtX6ULWAWlaWzeLzX3g6yEAU4p3UMxsYLjEuF12giorTaj6ME1x8NKmc f3VFSQK1voRdMVH5gtszz3K4FjekRKixvxoZLDt/ybhZQkFKBTdv0Bi6SazWL1iafLQh I22bKBVI98v3lnNIJ/Bxyb4ShtMfMBEG3XVJYSOl00Ib4iyp3VYJDWkXmoyYP2Nu0Hj6 Bd0NmhE1LpqWdVw3I1LQ2Ro7xQxjR7gye9QMOAkmDEzAmGZGkqd8xfNqqc9d6wtJD7ia kXpmqPWQrxWkG4b2Yc+yvITEqYsl0IjthIxxnazENL9B7sfVNmzmoB1acMXUaoMf+e10 uDDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=07cBonba1DbDiUBmK2dO6ItNWq9O714rRPMKjF5tL9Q=; b=aDPeb73APAc6LweSnCB7umi0z0GEerp+xQdkLQvDJvXBE+JzdzPW5Gw2QPMMJJ+iSF N04QnUChQU2SCoudxKu9/tJEMmGboI9w/EgDYQYOR9y2Ix6n9uS68LKRs+qxcpJBElCu P0THQBeuETX+jvfmYg99UxL9GS5SdxvOsCWtWwpctFgz/VW8L/bxiNA71WlohngONH9B BfTqRR5BlHj9slSUqWMwZodSh5m0n8EhjeyA1dvxwmwU9tWm6BQGOazU9f9HVNZcvt0B GXYaWes1S3U6mvGd+KEPmDAkeChwWVJP1hECESiMONQyFcloeLMwxd6JuziwKThsO14S j1Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=o4o0vDtZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7si15045563edd.159.2022.02.10.08.38.22; Thu, 10 Feb 2022 08:38:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=o4o0vDtZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242098AbiBJNSb (ORCPT + 99 others); Thu, 10 Feb 2022 08:18:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242089AbiBJNSa (ORCPT ); Thu, 10 Feb 2022 08:18:30 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432F81BB for ; Thu, 10 Feb 2022 05:18:31 -0800 (PST) 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=07cBonba1DbDiUBmK2dO6ItNWq9O714rRPMKjF5tL9Q=; b=o4o0vDtZV6FxU8CZGgzhaGJWwr bTeuRXjT7it0pixyf6hKUpANq1wEjPl/ZnZc/cra8RkSuFNu74KAfCUHf+EiMwUfd2QVf0KWYzTnk 6Hk6hBsEc6vHbY3x0IEj9ex4TCVjwbPn7kmfTULGPhQvIQIGCMwMCDd/efdm9Q8J6EGq3elPKZ7C1 iHM++X6fXUC4Nb+sqFIVml+OOgrcUHa5B8Rk++WXQRGX3P/tnNCnp0RjlfHlEU7g0WvCSCItCEcUL ONBwHn82hpsY9Fg4PyrNW1qfcqvI0sgfIULEc3CtyYbMuthoJSHg4BA53HQOHaOQxgF/r9UzumNtG vaNLLp2A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nI9Kz-009SYN-UO; Thu, 10 Feb 2022 13:18:17 +0000 Date: Thu, 10 Feb 2022 13:18:17 +0000 From: Matthew Wilcox To: Huangzhaoyang Cc: Andrew Morton , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] mm: record context on page->mapping Message-ID: References: <1644483715-7981-1-git-send-email-huangzhaoyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1644483715-7981-1-git-send-email-huangzhaoyang@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 10, 2022 at 05:01:55PM +0800, Huangzhaoyang wrote: > From: Zhaoyang Huang > > Since page->mapping is vacant in the pages which used by kernel(drivers etc) > Have it record current context to help tracking the page's owner in system > memory dump. > > Signed-off-by: Zhaoyang Huang > --- > mm/page_alloc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index c595274..2757d10 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2430,6 +2430,8 @@ static void prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags > set_page_pfmemalloc(page); > else > clear_page_pfmemalloc(page); > + > + page->mapping = (struct address_space *)current; > } You didn't actually try this patch, did you? See page_expected_state(). Or, I don't know, just boot it.