From patchwork Wed Nov 7 10:18:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10672117 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 64F4413A4 for ; Wed, 7 Nov 2018 10:18:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5480D2B1F2 for ; Wed, 7 Nov 2018 10:18:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 489802B22B; Wed, 7 Nov 2018 10:18:52 +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 C46532B1F2 for ; Wed, 7 Nov 2018 10:18:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C6F66B04E1; Wed, 7 Nov 2018 05:18:48 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 304296B04E3; Wed, 7 Nov 2018 05:18:48 -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 0BF3D6B04E4; Wed, 7 Nov 2018 05:18:47 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by kanga.kvack.org (Postfix) with ESMTP id 9A0426B04E1 for ; Wed, 7 Nov 2018 05:18:47 -0500 (EST) Received: by mail-wr1-f69.google.com with SMTP id 37-v6so15147355wrb.15 for ; Wed, 07 Nov 2018 02:18:47 -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=DQ5+y/vbCLeSsx2dguaRonOV5qx6uO/PKoknxPKlQMWEBXDaGC1737pay0qPhBEAah Xj80DdUG96q1kYtZWgZFmNjGQw4Ll9LZqcuFb64n1LgWHR8KVBxr18pQya/DLxOL+nUt 09OLvDYt7BjTYAKK47a3HJNKK/BfVuaY5TkYHjL44Wwk0u7w11UkF8YSJexw5Pgv9jZW 0+inddpXD7w3qqiH6ryTfRqzM1pu8ifj2t5bVOH180R5sXqag6lpDR/I2w9v6jqfLcbK SWxuuffH94SH8ugAnC/EnK2iYGI62uag5O1S44Ciz1FujF4Xy0yBqp5SC2vggw7YmUt1 15nQ== 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: AGRZ1gLUCVS/ALQ6bsB+CzxqRMbe2Ngkk3PkekfaMOkJL8GERXs2fXVS 1ZQQgR7Zi7vgfwQ8Ccz+1fIf8HAAiVs61H++wGYiin+ZluVsyIXvTcS/PWvWqSOkL97VyhmzhIS NUPXhSsZ4HwYgDY92/GI0pwV0xf9+2HXIt6vU2fIn4CXjbx532LogCIK58Fx0RRrU1glPWTyoL9 vSn8saHM2KliTE5Axcoj9/UAR4f5Q2isbDN/4eHzRqe3Ye5fsS8s43Ukly663SyRXcHpNWDtJvD n+L7c3SFiS241RJvN10NHo0FEHFLCkARXhaJsDxm9y26Iu2oIJuM95k1wx00BW36a4nUrCx3pKg zmucuS03pUfVAO11BkbA1uFSOnn+jh5bWhKLS5Al7b2gPcAeLWmM1bpVrj0Cmbm+bJHT2uxVpg= = X-Received: by 2002:adf:e4c2:: with SMTP id v2-v6mr1174315wrm.227.1541585927161; Wed, 07 Nov 2018 02:18:47 -0800 (PST) X-Received: by 2002:adf:e4c2:: with SMTP id v2-v6mr1174267wrm.227.1541585926292; Wed, 07 Nov 2018 02:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541585926; cv=none; d=google.com; s=arc-20160816; b=ELe2FU3ePF2fbp/euDMI56h7Z3j1+7hkN5GThKfeFnLSrTco0Pbzof0x7wzMintjtd svBCRjjdSMKcn+Sa+G9DinF/uc5KNjH6ApeNzRlC3Air7FIauwqMlyAfCcDURK0tWzm6 lnmFzCs/gEre8mdzpVev3h2Diy/fHWeLhlu5RUy5rAfTTl21K+6xEXweIV6Y8LmZShIR ++AB/kDcyWx04Cd+WqFz3wBkqVWaboMWc1/CW3RLhA/MwIUJnr2e7PpbRrCrbASlMVxg Udb4BUldsWqDDyPNSqfqUTYBEj0kE2xOuV5j/s0+Sj4bMu3VaMJZPTJtfzjx0BVMFtze eYBg== 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=bBi6HSVa8aTkX2jholQs1B+83txBsUo/vaCuRwU3mPmKMPvlAeVPLioCBBUc/PP0Yk z5zn9oOVI1T1J5zA5Pdp4iwoBD7yvaOAwGQZ1DpOx+q+jswQZ/S+Vy1ef+4MUeGzXjIg /zTa9n6JA+Go9t+LlO0HYhz8yeYXKOpGGG1PWKxVP/pdRIHgnBRgHqWJPBJLQG50NV1T agSuGZBaJG4m6pyHYVGjlRFtgqImyj1JeFoqTwN/B7nxeAWn+3ft1mcIEA2/rB5jaSFI aTeg3q1N/yLo2L0YlVjtuS8tYx6bKEiA3ASN/w3zbK7ELxAjcScn8+L5a4svMYNMGndL lMAg== 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 190-v6sor386195wmy.29.2018.11.07.02.18.46 for (Google Transport Security); Wed, 07 Nov 2018 02:18:46 -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: AJdET5ftOCLUF0p7pCTONzVRA2a93zicaYe8TRYk7EdfmtuA67inY1nAtTO8DzPppCgJ+mqArmv3PQ== X-Received: by 2002:a1c:2846:: with SMTP id o67-v6mr1430070wmo.102.1541585925499; Wed, 07 Nov 2018 02:18:45 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 02:18:44 -0800 (PST) From: Michal Hocko To: Cc: Andrew Morton , Oscar Salvador , Baoquan He , LKML , Michal Hocko Subject: [RFC PATCH 2/5] mm: lower the printk loglevel for __dump_page messages Date: Wed, 7 Nov 2018 11:18:27 +0100 Message-Id: <20181107101830.17405-3-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 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 --- 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 }