From patchwork Fri Nov 16 08:30:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10685707 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 EDAF214E2 for ; Fri, 16 Nov 2018 08:30:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E00C22D6A2 for ; Fri, 16 Nov 2018 08:30:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBA6C2D681; Fri, 16 Nov 2018 08:30:40 +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 4D70C2D681 for ; Fri, 16 Nov 2018 08:30:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F24AE6B0880; Fri, 16 Nov 2018 03:30:37 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EA5F26B0881; Fri, 16 Nov 2018 03:30:37 -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 D23916B0882; Fri, 16 Nov 2018 03:30:37 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 775E36B0880 for ; Fri, 16 Nov 2018 03:30:37 -0500 (EST) Received: by mail-ed1-f71.google.com with SMTP id n32-v6so11288091edc.17 for ; Fri, 16 Nov 2018 00:30:37 -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=INIH8VEj3IknA0dWKCgx1UP4Knj40rfToyv6XxWgDjI=; b=nWsJgJyagKA7YWxC4MpuoHDdH+s1naFjaQ/PO0nBJNhQiO5mm1mN03rWzdRL1jwTc/ qZfVzJxS4MyHJ8y4MdU/kmVv2+vhO4+Ys41QceTK+a+iworXDN16Z/MTGb+yQle86kDN h+Yvu6kihcl4bzidE3FL5zDF0LJSW3flu6Yo7bq93lvW/4v7iXrr7w8DADbnDdV23kzV JsgzUIKtAQd37pvlanKETDWN9jVc60UzuHDtjnYicDL6CbPuaolZBEEzL7Te1ot5+fGA XMWMIwY4kbic9hrvGzvcmDnSQAGV1QHctvIVRRECP7HDh/OutM8E8I3vDmSqIk2/dTlA ygLA== 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: AGRZ1gK6it4QEjV8TtWhmUIKJVZNu0bLIcumMjTHJbBqnMJJ6eaNrc0S U/VQk5jqJU7UJrbJiXtXnRh8qObYiseL4E/X+VdGl7n/WzJxlhmll6yI7OPJIdjM/jJrGDSJChS 5tfx/l2jWnyKtjWcrYxIIocpuwS1H/Bbl9+fz6UKK6QnD6LfOH+hR3N7VcaFIOBLYPOHLn/j50d wMPR7NU+GD4m/2lej08Jqitc0pI2dDyZOvT0k/uiDfEz8iV8Wv9K2dXxGiyTp8bGCp/LrDKeMuh sYjs9n0zMHDjJkrphkyAErDdvLoMeTJIIAAPSGYY/teZnSazwWBcFLSRPj3Yq9crLmWycKxZ4vL xLGKxCKJ1zwbOzy1b8xxAOh8uB4dO/LxMj5J2WvOvtQwGVYm7U/+6P7xHsT8+nipA1dDE+ekhg= = X-Received: by 2002:a17:906:6011:: with SMTP id o17-v6mr7996112ejj.237.1542357036978; Fri, 16 Nov 2018 00:30:36 -0800 (PST) X-Received: by 2002:a17:906:6011:: with SMTP id o17-v6mr7996070ejj.237.1542357035980; Fri, 16 Nov 2018 00:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542357035; cv=none; d=google.com; s=arc-20160816; b=DILtq/NCOw4bha3obFk2vQyA4X5bLATgEsi2ZJx8YE2kGjJ4Fp9+7S83LSBPIQdvfO SsGK45lSu4UgS1aHrSEqRjYuKnleUH0MhD/fh/kM3VxAA80L4PfS9nyfia5dK/mEr3Ed AIkRWsi/G4mpDoj/MglzbDUss1ZAtPjrUnULmIPBAhl47aNFvYUOS+gnTQTKZLGyXqtR GHUGxenPmGkijEI2YWZsxBUApKXhVyTPj4TQAN5jxgwAXFVWO4Y+cobIe1eot/V78/33 zdPmAdSMQXdPoPdUHUl6tK1zbhVzOLYYlMBJpx1aja3Mi0BkPllH/8Cb0OPark583hLx H/KA== 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=INIH8VEj3IknA0dWKCgx1UP4Knj40rfToyv6XxWgDjI=; b=kJw7aIUSPlyf/Wp6FQnVymd40U4SkWnKsjVCbBiNvesXW6IFD3R6jqvMwVc9bkDBPB 1wDYixSsx96OAevjhcyYSZYKscUiptBXizzAqo1hop+QSPQCGJSoYSd30R2XChfs19s7 VRN2C0jz4SaIG9wBw04xoO+1b2Ekw6DAucczEA/bvVS0WNC7BNtlG9G82nijBVeKE8p/ Vzbb+86S/QeQYWA7UyQUbt81xHkANfHu6SD6Q8uWxPByc6nL0MJ3JnCBx4IngWgnREuf YsomK1/QEZ9sEmIdR+NFeq0HibqXyq8igGBDSiIGFihLPALF9jZ3YLQ4cp8ULZBfTIc2 p/Nw== 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 r10-v6sor15273680edd.23.2018.11.16.00.30.35 for (Google Transport Security); Fri, 16 Nov 2018 00:30:35 -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: AJdET5fE+tFR5EygNC3X9gz685mVgSc4MkoLDrALRwgTFEy36WoP9qpHVhs7em8FCk08JnlnIRN+jA== X-Received: by 2002:a50:a399:: with SMTP id s25mr9101149edb.1.1542357035568; Fri, 16 Nov 2018 00:30:35 -0800 (PST) Received: from tiehlicka.suse.cz (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id m13sm5305393edd.2.2018.11.16.00.30.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 00:30:34 -0800 (PST) From: Michal Hocko To: Andrew Morton Cc: Oscar Salvador , Baoquan He , Anshuman Khandual , , LKML , Michal Hocko Subject: [PATCH 2/5] mm: lower the printk loglevel for __dump_page messages Date: Fri, 16 Nov 2018 09:30:17 +0100 Message-Id: <20181116083020.20260-3-mhocko@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181116083020.20260-1-mhocko@kernel.org> References: <20181116083020.20260-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 messages use KERN_EMERG resp. KERN_ALERT loglevel (this is the case since 2004). Most callers of this function are really detecting a critical page state and BUG right after. On the other hand the function is called also from contexts which just want to inform about the page state and those would rather not disrupt logs that much (e.g. some systems route these messages to the normal console). Reduce the loglevel to KERN_WARNING to make dump_page easier to reuse for other contexts while those messages will still make it to the kernel log in most setups. Even if the loglevel setup filters warnings away those paths that are really critical already print the more targeted error or panic and that should make it to the kernel log. Signed-off-by: Michal Hocko Reviewed-by: Anshuman Khandual --- mm/debug.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/debug.c b/mm/debug.c index a33177bfc856..d18c5cea3320 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -54,7 +54,7 @@ void __dump_page(struct page *page, const char *reason) * dump_page() when detected. */ if (page_poisoned) { - pr_emerg("page:%px is uninitialized and poisoned", page); + pr_warn("page:%px is uninitialized and poisoned", page); goto hex_only; } @@ -65,27 +65,27 @@ void __dump_page(struct page *page, const char *reason) */ mapcount = PageSlab(page) ? 0 : page_mapcount(page); - pr_emerg("page:%px count:%d mapcount:%d mapping:%px index:%#lx", + pr_warn("page:%px count:%d mapcount:%d mapping:%px index:%#lx", page, page_ref_count(page), mapcount, page->mapping, page_to_pgoff(page)); if (PageCompound(page)) pr_cont(" compound_mapcount: %d", compound_mapcount(page)); pr_cont("\n"); if (PageAnon(page)) - pr_emerg("anon "); + pr_warn("anon "); else if (PageKsm(page)) - pr_emerg("ksm "); + pr_warn("ksm "); else if (mapping) { - pr_emerg("%ps ", mapping->a_ops); + pr_warn("%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); + pr_warn("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); + pr_warn("flags: %#lx(%pGp)\n", page->flags, &page->flags); hex_only: print_hex_dump(KERN_ALERT, "raw: ", DUMP_PREFIX_NONE, 32, @@ -93,11 +93,11 @@ void __dump_page(struct page *page, const char *reason) sizeof(struct page), false); if (reason) - pr_alert("page dumped because: %s\n", reason); + pr_warn("page dumped because: %s\n", reason); #ifdef CONFIG_MEMCG if (!page_poisoned && page->mem_cgroup) - pr_alert("page->mem_cgroup:%px\n", page->mem_cgroup); + pr_warn("page->mem_cgroup:%px\n", page->mem_cgroup); #endif }