From patchwork Wed Nov 7 10:18:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10672115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DA1E15E9 for ; Wed, 7 Nov 2018 10:18:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C0412B1F2 for ; Wed, 7 Nov 2018 10:18:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 400392B221; Wed, 7 Nov 2018 10:18:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D38852B1F2 for ; Wed, 7 Nov 2018 10:18:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDA156B04DF; Wed, 7 Nov 2018 05:18:46 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D384C6B04E1; Wed, 7 Nov 2018 05:18:46 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3E836B04E2; Wed, 7 Nov 2018 05:18:46 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by kanga.kvack.org (Postfix) with ESMTP id 549C06B04DF for ; Wed, 7 Nov 2018 05:18:46 -0500 (EST) Received: by mail-wm1-f69.google.com with SMTP id t17-v6so12769713wmh.2 for ; Wed, 07 Nov 2018 02:18:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=kntFfEclka7mr+wFcmXDsLg76irP2LElxuloHHO2sP0=; b=L+A4Obmcs/yTkg6vc0WFAHih6Z7agRbbUsTFVf1sz0D/9peHLIfoHbcyfttvvot+nz GRui6EZvJ94ONmC/4sgFfLVI6wUJwQcsA0YY00AAd6lBUzAGAVD/mijdapf0ZIDWMARQ q0kKp3n3spLoLX6J3Qs94H9XpGZUlQW5ASMq5fQNzdKR7CvhvYOplGK1CX9WDtionnVn YcMaYWXyMDK54xhbrGZJpn1g+JBfcuZ680AEPGAH43hzZQxKrz+/Aw7DWQ1+H1xug39K z+NG7xnx6RZpMLGwrP3akMknLCGGadwLCu7MEZougy48L/M/LnN/Zbx3ENYYrYIboHhT mVyQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: AGRZ1gKps5WkFc6t7+r/OSFWysBhzYUGPoM5gsrx8Syf0697/qdmNjG7 h4qdx4ORL80yxAoy+IG4qhIeLBM/TJrG33YQ7Vo738rW8Z+1NcCmsGYlwS06QQhnRzPuyXhowsJ SkoUObBCT1S90VGgU20sr1R8HdZy6tn3uf8XnoeF/RA7dwMmpGLmou/uVu77ZqTu4NdpVlMkcPS 5uifxQpd6LRklIbQ+OexJyy1KQPWuDvVwQKPfK9k0SkveGhWFfiaIZiWqDsGYOpHTFGrnEXoSs7 LQvaYLRJJvgkuYmB3f1Kc60KpYmOGUzNR/vOSUrDyd2pWG+9IWfoGnurCaOYXvaUrYuJpR+ISOa A0UrNBS9TikZ0mkuMVToQbgXmqjraGWsmT4HFb/aUebVNWPArZdJ5Tqva0gC00GtsAh9h2xMGg= = X-Received: by 2002:adf:db0f:: with SMTP id s15-v6mr1230699wri.129.1541585925875; Wed, 07 Nov 2018 02:18:45 -0800 (PST) X-Received: by 2002:adf:db0f:: with SMTP id s15-v6mr1230652wri.129.1541585925008; Wed, 07 Nov 2018 02:18:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541585924; cv=none; d=google.com; s=arc-20160816; b=WAfwTNpVgNeE93ndTByhor5kiBdyv7fF0z0Oanm9rfN2Yw4YvG/fg/8A9tob23QZog yj0vZgxT2Vy5We4wkd12pidqg6Qkis7jtiKRbQ1j5WdKXxRpXcL1iFNC6uOe7k/JCBSc +29GfoBIl7LVhfSE/XN6ejPzj+S5JWWBua6Tsqzxlfh5g8JeKTGkSmk3hpgVUjsYlZIn YYBty+MtRgsU+CzcU1Q8iiWqlAwXVGcBvn02kiOMNR2LjyO0Ooh/zqekR1ExBRKRK6Yg QH0WOQog+p7WhQ6wQJNqMY7zz+I+2CdsA+wkL3j/v8Xjxo0kCfIv+1lzr3UxVnYJsJ+0 9kaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=kntFfEclka7mr+wFcmXDsLg76irP2LElxuloHHO2sP0=; b=fKBwujxS6gEqx7WfhBSLa/ybFDiKwdft7+gY1FV89oBhzO00ybOl9fGis8g+EJWUHK WbGYRvN+YdZ83ESPvktYcRtTxgJ8CwVpbi86Aci7F7kMMjQczpT3ZpXfeah9VpW/uJbq mAeLxiG/xitwthu8/h/NQEs6AuilSlcRLqC/Cpb03TMjoL+NJtgdLLrAUw+mS5Uozd9I MtWjH48eiQUx6XvV7AN/ERACGh75z0503Eb8wJrWja7DmBQu4Fr8giawlaw66YLoK+9r IhyGHpgeixK7ZRKsVe7tnTmzajDXru6W+3ytii4Pd+LNQ1ci8P3X442gdDrqsA3+pzk8 VCYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b77-v6sor399933wme.9.2018.11.07.02.18.44 for (Google Transport Security); Wed, 07 Nov 2018 02:18:44 -0800 (PST) Received-SPF: pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Google-Smtp-Source: AJdET5dR6WUz/KIbvc4O5dgbexkLTMFjMGHXCSeQv1Bflzz/RwXz/1Eu9NQEUmyJmMP30SHDzyMfsA== X-Received: by 2002:a1c:992:: with SMTP id 140-v6mr1448126wmj.136.1541585924255; Wed, 07 Nov 2018 02:18:44 -0800 (PST) Received: from tiehlicka.suse.cz (ip-37-188-140-85.eurotel.cz. [37.188.140.85]) by smtp.gmail.com with ESMTPSA id w18-v6sm217527wrn.66.2018.11.07.02.18.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 02:18:43 -0800 (PST) From: Michal Hocko To: Cc: Andrew Morton , Oscar Salvador , Baoquan He , LKML , Michal Hocko Subject: [RFC PATCH 1/5] mm: print more information about mapping in __dump_page Date: Wed, 7 Nov 2018 11:18:26 +0100 Message-Id: <20181107101830.17405-2-mhocko@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181107101830.17405-1-mhocko@kernel.org> References: <20181107101830.17405-1-mhocko@kernel.org> MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP From: Michal Hocko __dump_page prints the mapping pointer but that is quite unhelpful for many reports because the pointer itself only helps to distinguish anon/ksm mappings from other ones (because of lowest bits set). Sometimes it would be much more helpful to know what kind of mapping that is actually and if we know this is a file mapping then also try to resolve the dentry name. Signed-off-by: Michal Hocko --- mm/debug.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mm/debug.c b/mm/debug.c index cdacba12e09a..a33177bfc856 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -44,6 +44,7 @@ const struct trace_print_flags vmaflag_names[] = { void __dump_page(struct page *page, const char *reason) { + struct address_space *mapping = page_mapping(page); bool page_poisoned = PagePoisoned(page); int mapcount; @@ -70,6 +71,18 @@ void __dump_page(struct page *page, const char *reason) if (PageCompound(page)) pr_cont(" compound_mapcount: %d", compound_mapcount(page)); pr_cont("\n"); + if (PageAnon(page)) + pr_emerg("anon "); + else if (PageKsm(page)) + pr_emerg("ksm "); + else if (mapping) { + pr_emerg("%ps ", mapping->a_ops); + if (mapping->host->i_dentry.first) { + struct dentry *dentry; + dentry = container_of(mapping->host->i_dentry.first, struct dentry, d_u.d_alias); + pr_emerg("name:\"%*s\" ", dentry->d_name.len, dentry->d_name.name); + } + } BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); pr_emerg("flags: %#lx(%pGp)\n", page->flags, &page->flags);