Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8765821ybl; Wed, 25 Dec 2019 05:55:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxqPfmxCY2+GBX+umM/ilEZU3X/cWR3H0dZyPVctxoKUC0EHzhnktd4Cmb2qUq9uS9jcCFa X-Received: by 2002:a9d:754a:: with SMTP id b10mr45571237otl.273.1577282157104; Wed, 25 Dec 2019 05:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577282157; cv=none; d=google.com; s=arc-20160816; b=jTRTAWQLK4FOoTZhmIe8M/H3vYpc3PQNhQWF9GSrr0QbA8E15FkwBrRTnkacpWgdw5 SjHGHYgrje87Jr8BfaMXNC+nuC2mZrrV7Y3+VVkDoqeH5SFY4BwyarCEz2jkw/IPt4AA e6Res24E7n0tO6qI1Pe8PU7S8R3ICSh7i0+Gs0wSKOxVNR5nQjenKiPx41vspNSRst3O mYg/eyACUTUL8XikBlMbJxCSmpqh1kq6SNRv1ZcsJEXTmBsDx/gMfVcq2C7GdhUJMB1a buSTkoqUw1sTXEU0UlAvb6LP2Dls/FpobnNlCq4dSKsmKnXW5THriEVvHwKtmGns4TZ2 qdWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=KUrCa6xAYjppP+kYyaFb1kK7z66EPpyNc7GyOaqtVdk=; b=OOSROu1g+qjOEIeyOQAELe10v0JpwqLaLcrtrN5tz5YtmQCaCmA8ARu74aQS7XcwkL jPYmALFJMZEnCdrMLrtsuCCUJzTApsaE5Oegw2KEoQH04nu27p2TEyrW1qHD9yv0PtPJ cIphRLWQXfB1fAv2bD9W9BOv7Aq1EhUOO9id72GJdIM3LG311FH4LK6GIZFXgk9oWJ1h dkzJpADCpipHQnJkAZgai2KdYe4HIOeDw47e1hvqn2bbE2YNVZ5+poKd8jbusidOKTjT eZraRPzjYxjgoro0uTNhtN+VPRZ/oR8ghs1cHsv+d9I/5gJ9c0fZtjlsx6haF0/AaiYg 56tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=mZit9suz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p28si13941282oth.296.2019.12.25.05.55.19; Wed, 25 Dec 2019 05:55:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=mZit9suz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbfLYNxP (ORCPT + 99 others); Wed, 25 Dec 2019 08:53:15 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:37959 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfLYNxO (ORCPT ); Wed, 25 Dec 2019 08:53:14 -0500 Received: by mail-qt1-f193.google.com with SMTP id n15so20329817qtp.5 for ; Wed, 25 Dec 2019 05:53:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=KUrCa6xAYjppP+kYyaFb1kK7z66EPpyNc7GyOaqtVdk=; b=mZit9suzmem/cS/gpTcNGVlvF3wGKIXuNs61u7kNov92m4+hdxWzR7feJ21VbWW7Cw UjcRkz5+CqAocHebwCuhi9iMarvn2JU1/its/7R0LLOdi7KiXXKlPNcI1EFsbsi3VnyO WOtUWv/y3a5h1qkyugjDmpvkvUXu6BVzL8ZmZ0EEZzMyGxDC0LfOYQt3DQ63p9Mw3be+ 7vGssLfKj8RXnuajMHWSN77Pm50+9DgrqtfxqpAe+JSUMfDyWNzFI8fR1IpGqa+Xg1h4 1TIbCplYVDsctABJqD/m/ELpHGAg7ufzgpu5c8dzgdb+sp2HSZVSqxU0x6CKI2boQlBP UOzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=KUrCa6xAYjppP+kYyaFb1kK7z66EPpyNc7GyOaqtVdk=; b=EQYE4ri0y2PPVfeUcjsQzWX2/VZQ5He1kMrCo/R8klCal6Io+eF2IRaSU1WljjtPN5 gR0e1uKTjbGXfrpvQZ6aQZR8frftzRcCP2zg+1PtXACcgG+Z96aePnUt1UeM2EWHcwNP cZt6pOxiWS1WbYKF7bpWKd2CYmk5DWNwgVKzpHJ1omkUxuJOj57ROUOvwMZ2zJ6tBGXo AO9qglHztEmeed1Z2jkYW0lnm2xm3zcXnpMsAPFSgHFnY/C/mZz6g0gLXv4mGxih/3jh O+DhyZ2ft3dsiirNZBw0ogWZ8UyQk81G1bpnByxVhMwlonNkmvDvtjERI71frUMlk5ae LVlQ== X-Gm-Message-State: APjAAAV2+BrPQPywKcUUxDV9XE6G6oXHmwhNxUhVYmNgSN4IWBYQcvxS YibR778F3QVfTh8kqeEA42Iu4w== X-Received: by 2002:ac8:5313:: with SMTP id t19mr31565483qtn.375.1577281993999; Wed, 25 Dec 2019 05:53:13 -0800 (PST) Received: from [192.168.1.183] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id e3sm7057253qtj.30.2019.12.25.05.53.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Dec 2019 05:53:13 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] mm/page_owner: print largest memory consumer when OOM panic occurs Date: Wed, 25 Dec 2019 08:53:12 -0500 Message-Id: <1806FE86-9508-43BC-8E2F-3620CD243B14@lca.pw> References: <1577266145.31907.4.camel@mtkswgap22> Cc: Andrew Morton , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com In-Reply-To: <1577266145.31907.4.camel@mtkswgap22> To: Miles Chen X-Mailer: iPhone Mail (17C54) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Dec 25, 2019, at 4:29 AM, Miles Chen wrote: >=20 > For example, we're implementing our iommu driver and there are many > alloc_pages() in drivers/iommu. > This approach helps us located some memory leakages in our > implementation. Not sure if you have code that can share but I can=E2=80=99t imagine there a= re many places that would have a single call site in the driver doing alloc_= pages() over and over again. For example, there is only two alloc_pages() in= intel-iommu.c with one is only in the cold path, so even if alloc_pgtable_p= age() one do leaking, it is still up to there air if your patch will catch i= t because it may not a single call site and it needs to leak significant amo= unt of memory to be the greatest consumer where it is just not so realistic.= For debugging point of view, IMO it is better to annotate this one alloc_pa= ges() call when in doubt, so that kmemleak would catch it instead.=