Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2691562pxb; Thu, 10 Feb 2022 03:30:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCEDZE5DJU/r3HLX7xtvPwLFTm5Bt044zP7/Kla2A+n1VnNci9yczUZz78eKQFqZEwUBVT X-Received: by 2002:a17:907:7fa0:: with SMTP id qk32mr1208896ejc.724.1644492626367; Thu, 10 Feb 2022 03:30:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644492626; cv=none; d=google.com; s=arc-20160816; b=tCPeM1bnTBjjXidm7RMlNkkEl68Jgo9DzjhsTmD8E1k6mlx3aLNagbD4vgo8oHj1hU L7m4FH+2HQqUYWLk1fdAmJ9vl0QGeZxDDlE2jGy0rEhGCYlEi9Gk0HGoHkulJAZrlIFf X78y8nCNBfH/lBBz7BRVRYmIIHB0TnoE+9Jcozni5ztTVW3HB80NIVZh2ZazeVJq/6pj WfEbSwypuzqiNrQvVaucFtawN1DcxXqRaDZmK5aBIVGOWKv812HRIB1Vx9xmr8w3MC5n bqq9mRWyO8kWfRMalbTGb+81HESDPxi3+p1CmcjtxAbcq3EkFzA1AIEmDKC3AQj1hBnV uKqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=x84sC9uSV7SvE6YCsXqiRE2h863nfks8o8GtAi2bk20=; b=fXeQQKHU0/p1G4h9ZyD8FIwTspbCJ8KqX0nrqlAe4XsAmt7cMkhyWzavZJev1aVw+x pLJTTHVh1OLcvWt2ZYRWDYxu1h8/jmPY0K3USxXR/oRKl/vx63XSfUG+4OohAJb3tO0g 93N0zSS1JHPQIriHoMnSkGzF/Cfxlh3hAVtkF/sJ7mqtsQk0Qia9XedY++e2gxnjOVdh Y7QZUgzeLnxdppg887ybKSH4Z1XfD3uRduhSQJFTjDQi8zKYSnvH6XlzpUQo68zq1n8g hHcHo4CeHXUWSCQSNWf0sy0ljxRp1r5TZ6oebAi9tpzrTbrPPN8opQjoybrWYtMSAhhV JNZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iZ95zCDF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg33si9836665ejc.704.2022.02.10.03.30.00; Thu, 10 Feb 2022 03:30:26 -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=@gmail.com header.s=20210112 header.b=iZ95zCDF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239280AbiBJKBb (ORCPT + 99 others); Thu, 10 Feb 2022 05:01:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234215AbiBJKB0 (ORCPT ); Thu, 10 Feb 2022 05:01:26 -0500 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF8F4C02 for ; Thu, 10 Feb 2022 02:01:27 -0800 (PST) Received: by mail-qv1-xf2d.google.com with SMTP id c14so4379506qvl.12 for ; Thu, 10 Feb 2022 02:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=x84sC9uSV7SvE6YCsXqiRE2h863nfks8o8GtAi2bk20=; b=iZ95zCDFX/WrlBSoL3NGgb6SJPZJDSzV0q00eFQecTYJbneeyTgfbWE7B8Sy2GqgYp mrTaZmEq/TZ1om9cDFhwnKkesoUVbZxQvVb9hL1FRo2ca2EnsL9vQ0G82qMtg4gpf+g1 AZIVyV04hL91/HhiuKH5iydVP+eV2fgEI1bLU7+PInm1zr23WwVJQ57kZpUWoS6LejF/ d44wWy/XBkqccS+4jcKqYBc9PcNuPcC/Ay786PPMO6O/8qnLD5pSjCl7zPmxjqLEOgU+ wFpRZo+/DdzMBR4XfVB1kgq6ulDh8RZIqN9Tl94gJxjqT7dfv5LO6S9dUH2UNEGVtb1M ldOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=x84sC9uSV7SvE6YCsXqiRE2h863nfks8o8GtAi2bk20=; b=JAZEi6P3U7RNSQKjLBZlTWowTNtXnDNPk/pq21MFHOxC2gYVCsGerx0gpKTQrCt/yt oFYtjQDL5pdwTmlHWQUDmfGEqziqeUj8pBZKR0kiRLJWVgvsy9JOzjt3nVdGrbPMHq2D kGv56uJERAjfL0HafVgwEf5Zv59zTaBeeCj94gmtt9XFrWJUZf71dukRwHtvG59a2UxN 99ZUIVvspuImUNAuFPA58BJzAudIm7y0jI9WMx9mj8ecu0k+XKSjvByPcdgSes+a0s4q O9yL2CzPHF9t18a3ZG8q84rehIVPT22PG5V09bpyylwg3U+PGfaIdTVWu9LEv2LrKnkf bAKw== X-Gm-Message-State: AOAM532aEYiM/67leH5rmH4kDuDBP4tVgQuGmaBZtk62ppgRUOozaMQE hy47OawHqvERb41AjF99N4V9AdqeiuS3PlSvr44= X-Received: by 2002:a05:6214:c89:: with SMTP id r9mr4410097qvr.77.1644487287100; Thu, 10 Feb 2022 02:01:27 -0800 (PST) MIME-Version: 1.0 References: <1644483715-7981-1-git-send-email-huangzhaoyang@gmail.com> In-Reply-To: <1644483715-7981-1-git-send-email-huangzhaoyang@gmail.com> From: Zhaoyang Huang Date: Thu, 10 Feb 2022 18:00:59 +0800 Message-ID: Subject: Re: [RFC PATCH] mm: record context on page->mapping To: Andrew Morton , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 There are some places to modify as 'free_pages_check' for the formal version, just RFC here to see if it is doable? On Thu, Feb 10, 2022 at 5:02 PM 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; > } > > /* > -- > 1.9.1 >