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); 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 } From patchwork Wed Nov 7 10:18:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10672119 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 EDA7413A4 for ; Wed, 7 Nov 2018 10:18:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCFDF2B1F2 for ; Wed, 7 Nov 2018 10:18:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0DD22B22B; Wed, 7 Nov 2018 10:18:54 +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 7C69C2B1F2 for ; Wed, 7 Nov 2018 10:18:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3044A6B04E3; Wed, 7 Nov 2018 05:18:49 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 268526B04E5; Wed, 7 Nov 2018 05:18:49 -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 F33D76B04E6; Wed, 7 Nov 2018 05:18:48 -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 979E76B04E3 for ; Wed, 7 Nov 2018 05:18:48 -0500 (EST) Received: by mail-wr1-f69.google.com with SMTP id v2-v6so15090593wrn.0 for ; Wed, 07 Nov 2018 02:18:48 -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=k4D3ilvRNbEdywbamB4FAtEIm3b4AWw0D1l/xvNW28A=; b=dbNlFXLMTwKfFKubuUmogC//9iJdLK5UFuTt+qhRY8Pkp46g+2s6ZQXinRfkGRjXS5 be+vBY+FpiOatX778uafb2gw/lgNGqUZUF4bT4oSvs2Hn12muFQLPzA5b1ufcRNJyb8o C0WrxWxv6s1+12V6WBqJuHiCXx39xgSaErLwfJiY/XD90dxu33eJcQYpMZc0R9EWtWnn yF2BdsDO0NpQYqyfOQlYGCPGn/bseF2fb5jS39IMv/Mrz2RJkxWOIZrBMocU6wUSLJ1Q eHnrDExDuS1tMaXC5g447F77A8guMMRIhCyJRoX/dRZiKaOrovfiSf5avP90MuymCMTO MWeA== 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: AGRZ1gJ55KRgwf1WzkL7FKlPWA6zAr7/ka+3JmXcdfpAkUcgYkiXO3A4 DUyU28zQ8nL9PXeRSUVdjzis4Ii1wklGr1ONcxKt2dYR62bvDIj8U3nfLUa5qVK5oyg3ZmfYG+e 7YlKninyBo/IXEasWx2LOhUtgBV2iFcsJm4Lru5tWRBytvahMyBzD+XCBEdPOTVvlhwC1/5MdSH UV1vbzXmPfevKuj96HLRxc/CcATMom+PoPnj3vIcGwessfcZDU/JZa80Jgfvdg0K4igeArxT5+O ZDd5OnVZXbph/0WmmS4M4vhF0gzfME4ZKDGNdq1eZWIcr+40o9udAYiYyYcMHDM4jnm4XinmEDU SpB2I+TJsIcWCQeqrbj5/XdNSKf5PRyfP4wfcc7oQ7ZVQ9bDEeeMDMlu3PPG7uVOcAH9eMvwqw= = X-Received: by 2002:adf:c608:: with SMTP id n8-v6mr1314573wrg.174.1541585928178; Wed, 07 Nov 2018 02:18:48 -0800 (PST) X-Received: by 2002:adf:c608:: with SMTP id n8-v6mr1314527wrg.174.1541585927441; Wed, 07 Nov 2018 02:18:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541585927; cv=none; d=google.com; s=arc-20160816; b=WkEYZa+AgDj1xy2bbRoOigJrd7dg33kiYiACVL7NNrbY28oD2ACz1QqIiuf0Xm0IZA Sglkn9CHK83Mo41Ec33WyMBdZkGEGvZnSxqS56Xn4uicQnmCJAJ/SadlFALHSIQhxajU rcOwNGuBQGhiAfcwyK8zv2lVuNCUgz0lp1Q017FjVPp91DzRPIGcRcx8/Z9GL61+3vJE pTNswIUJJ0cmeL3qdHAYV1nRbkT60zLCT00FG5yhyRM4Y/z9t6Odc2r/+Tok1KkfpgII buh/mvwHRotRqv7TPgq9XL1oC950Z5OUe5u9cTsyh9rQCZRfy9IoD81uD/nyySlPfX7E DLcw== 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=k4D3ilvRNbEdywbamB4FAtEIm3b4AWw0D1l/xvNW28A=; b=sjHoXlosMMnIrzKtrlqQ7qPFhbQkhxJnAW4Wu/Ca2JE56axC8aI2bZaHwrZ8701gkC BUgfpOrpMv9TtUYPRt2rSUypySeV6LDOv50wO20uOPiYZIadiKzznyY/tOJehtpD42JS ZTEs+j86TJHs9pX+M42s/5xpVyQLq406bsrLgI3ygduFARwohcxnPG0XudDdlVAjKf3Q lKumxYgB+6FIV2k8J9si0sKbCFGDND4zxaWMYRt9l7+qtmxU9Jhn+HK12LRhVN3hdv/D MA5hH3jr5TLD0xjPujB/uL+dxKT+h+HhXwdQyxektCV6TydJ+yrQlOenCvQGseYM2BnJ tezA== 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 y207-v6sor411667wmd.1.2018.11.07.02.18.47 for (Google Transport Security); Wed, 07 Nov 2018 02:18:47 -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: AJdET5e39Bf8HqnTYRY869Rb3DDpMinUmxIe1N5NVJO5e00HwQZeHZ45MgeP6ywWcDyD1cpln9a53g== X-Received: by 2002:a1c:4b12:: with SMTP id y18-v6mr1436028wma.122.1541585926771; Wed, 07 Nov 2018 02:18:46 -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.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 02:18:46 -0800 (PST) From: Michal Hocko To: Cc: Andrew Morton , Oscar Salvador , Baoquan He , LKML , Michal Hocko Subject: [RFC PATCH 3/5] mm, memory_hotplug: drop pointless block alignment checks from __offline_pages Date: Wed, 7 Nov 2018 11:18:28 +0100 Message-Id: <20181107101830.17405-4-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 This function is never called from a context which would provide misaligned pfn range so drop the pointless check. Signed-off-by: Michal Hocko --- mm/memory_hotplug.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 2b2b3ccbbfb5..a92b1b8f6218 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1554,12 +1554,6 @@ static int __ref __offline_pages(unsigned long start_pfn, struct zone *zone; struct memory_notify arg; - /* at least, alignment against pageblock is necessary */ - if (!IS_ALIGNED(start_pfn, pageblock_nr_pages)) - return -EINVAL; - if (!IS_ALIGNED(end_pfn, pageblock_nr_pages)) - return -EINVAL; - mem_hotplug_begin(); /* This makes hotplug much easier...and readable. From patchwork Wed Nov 7 10:18:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10672121 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 7819F15E9 for ; Wed, 7 Nov 2018 10:18:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 678F82B2D7 for ; Wed, 7 Nov 2018 10:18:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B5532B2FE; Wed, 7 Nov 2018 10:18:58 +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 DABFB2B2D7 for ; Wed, 7 Nov 2018 10:18:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B47CC6B04E5; Wed, 7 Nov 2018 05:18:50 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A7B196B04E7; Wed, 7 Nov 2018 05:18:50 -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 8A44B6B04E8; Wed, 7 Nov 2018 05:18:50 -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 228D66B04E5 for ; Wed, 7 Nov 2018 05:18:50 -0500 (EST) Received: by mail-wr1-f69.google.com with SMTP id o9-v6so14723871wrw.2 for ; Wed, 07 Nov 2018 02:18:50 -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=Sv3VICkYWNHJQH5t9PKiqFFrwl24VUUEG3pNBfSVfqc=; b=ZVl4zBr2B4hICzpDVNV0Vu8IlnbR4wm8wnXnOfZUqh6Pnox+u5zwgXkM/bvUXQpM6H HBLV1mIJqc+PHLyqI9fwWPkjpZEiQNYmS6CxO/+QiPI6wUKt3UPZ8KkAsYEnUWjdOYIV KpgjzEYvYBcyaX3eXD9K4dr8yBkdA75QUcGGnkxi8q/zFaAWDX+jfG2TJZwCO/RNj/vM k8YYId+pPJN86qCN9IIv2z19TE9CzWCDN3c73SidhE9JTetw1axsoavlFCJrrDFdn3fp 1G+ckuM2lNwJpIxT+tqx4NB+MDmK/+peYulAHBmDoI/TchgCsFrl63DwNSeDAaWN7xeI ySew== 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: AGRZ1gLd3TQPRk9ruYcyvQK8J4gREqZEjSJQXEQQvzUxRyInT6/p71XJ EDBbLfF2mzt7gW8Vyfnj7XwCsBf9qKhFG15T47Xm+buwfU1cFtAAMnB8/wz2wwFqcJt8qLYSoxp XWvm5eGI9A7242abV0tdN6lUpZTruKNjn/Ruw/hYeQAJshn4fxgpHoK9tQWbrQxjZl+2pdS1DVU 7l2EnraI5Z9ozK3vbIK3sBq3SKs5IPpxOx0B8Zb6ms7gk7Vzupu1Hm27nqbdVtk/f4WrOUNfWRM 9yZmzIAN2qOOWrDTXm/Wv5HtLKj4qsakk+qRcMwFs+wMw5V55y+M19QcoZ+o+0Sq0eXeqQ2Zn4G 9h3zrAdSSKuU/BWXgK0aBsiyULt7BjgL8QbJYps/gZaJjwJNjX3HEon2yuYrzhPXpfodtMMhKw= = X-Received: by 2002:a1c:c70e:: with SMTP id x14-v6mr1456295wmf.68.1541585929622; Wed, 07 Nov 2018 02:18:49 -0800 (PST) X-Received: by 2002:a1c:c70e:: with SMTP id x14-v6mr1456257wmf.68.1541585928730; Wed, 07 Nov 2018 02:18:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541585928; cv=none; d=google.com; s=arc-20160816; b=QNUFOLgubzz1FBlJSobXEyaSfaq8CG7oNB/6d9Ii8B7NlbGuovillFCgK00QmuGTbe 4wdCfFWwykgBS0XtMj7v96d9BnnkidiEn51Fxfoq8z71p7RkXMg3VPJCl9o8h8EYqkVw 0oAUboWum7PTXi+NzgttjjvF3dIJMuVLiUvx3vKhCMrzWEr92ANYDeeh7y5lLAhOCAsV kx6ysUEX7MiQm6aTkzAYxng4TC1YqJkMxUJrGX6gt4KIjmxgG2ynGupCpzbtyyZUREz9 mI6ndYUH506WEm+2v3LJM2rOkOd3Vd95cxqq1S9INHHaLCkTFJGDpbDpFE2AjRVHkxiB 8PGA== 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=Sv3VICkYWNHJQH5t9PKiqFFrwl24VUUEG3pNBfSVfqc=; b=jc/e1RgIsXxbaUhvxMZ7SeTQKvVRzw6IpAqQW2BfyKYhZPCNp7FXd/PWWVgpjh3cOJ dyYjpt/DEKNiJKVADGTJiLiPsRSEZu3KTCDevQr4BM6I8JQlaXoFztvKj1ualJGT0Tne ENEGmihrqsa+Ztdvu3tkMfuCoM4+FICGH1M/mRQInVLdM2kUvxMHNYdISRzhJsEOA3BD N0XEJOh94fpOk068gMM2e6ga1/cxOuAStacHoAkjgL42sQBVHEcak2cbWFHTQ+1VOLO7 0g7HfgmJGNjbtvLeDB4sQ4s0IJjwSzweLFl8JLZteh6yQ2I37jJZWcTO0Bo5FQo3b0OS w2Zg== 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 x71-v6sor389000wmf.4.2018.11.07.02.18.48 for (Google Transport Security); Wed, 07 Nov 2018 02:18:48 -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: AJdET5dKm4DMMZdgXpmyKhgPMwFbI3RIdspl0FyX88e49xONBxbKQ/WPj6h9FTwNXMVUFskcPEVvNA== X-Received: by 2002:a1c:8dcd:: with SMTP id p196-v6mr1465756wmd.49.1541585927961; Wed, 07 Nov 2018 02:18:47 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 02:18:47 -0800 (PST) From: Michal Hocko To: Cc: Andrew Morton , Oscar Salvador , Baoquan He , LKML , Michal Hocko Subject: [RFC PATCH 4/5] mm, memory_hotplug: print reason for the offlining failure Date: Wed, 7 Nov 2018 11:18:29 +0100 Message-Id: <20181107101830.17405-5-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 The memory offlining failure reporting is inconsistent and insufficient. Some error paths simply do not report the failure to the log at all. When we do report there are no details about the reason of the failure and there are several of them which makes memory offlining failures hard to debug. Make sure that the memory offlining [mem %#010llx-%#010llx] failed message is printed for all failures and also provide a short textual reason for the failure e.g. [ 1984.506184] rac1 kernel: memory offlining [mem 0x82600000000-0x8267fffffff] failed due to signal backoff this tells us that the offlining has failed because of a signal pending aka user intervention. Signed-off-by: Michal Hocko --- mm/memory_hotplug.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index a92b1b8f6218..1badac89c58e 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1553,6 +1553,7 @@ static int __ref __offline_pages(unsigned long start_pfn, unsigned long valid_start, valid_end; struct zone *zone; struct memory_notify arg; + char *reason; mem_hotplug_begin(); @@ -1561,7 +1562,9 @@ static int __ref __offline_pages(unsigned long start_pfn, if (!test_pages_in_a_zone(start_pfn, end_pfn, &valid_start, &valid_end)) { mem_hotplug_done(); - return -EINVAL; + ret = -EINVAL; + reason = "multizone range"; + goto failed_removal; } zone = page_zone(pfn_to_page(valid_start)); @@ -1573,7 +1576,8 @@ static int __ref __offline_pages(unsigned long start_pfn, MIGRATE_MOVABLE, true); if (ret) { mem_hotplug_done(); - return ret; + reason = "failed to isolate range"; + goto failed_removal } arg.start_pfn = start_pfn; @@ -1582,15 +1586,19 @@ static int __ref __offline_pages(unsigned long start_pfn, ret = memory_notify(MEM_GOING_OFFLINE, &arg); ret = notifier_to_errno(ret); - if (ret) - goto failed_removal; + if (ret) { + reason = "notifiers failure"; + goto failed_removal_isolated; + } pfn = start_pfn; repeat: /* start memory hot removal */ ret = -EINTR; - if (signal_pending(current)) - goto failed_removal; + if (signal_pending(current)) { + reason = "signal backoff"; + goto failed_removal_isolated; + } cond_resched(); lru_add_drain_all(); @@ -1607,8 +1615,10 @@ static int __ref __offline_pages(unsigned long start_pfn, * actually in order to make hugetlbfs's object counting consistent. */ ret = dissolve_free_huge_pages(start_pfn, end_pfn); - if (ret) - goto failed_removal; + if (ret) { + reason = "fails to disolve hugetlb pages"; + goto failed_removal_isolated; + } /* check again */ offlined_pages = check_pages_isolated(start_pfn, end_pfn); if (offlined_pages < 0) @@ -1648,13 +1658,15 @@ static int __ref __offline_pages(unsigned long start_pfn, mem_hotplug_done(); return 0; +failed_removal_isolated: + undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE); failed_removal: - pr_debug("memory offlining [mem %#010llx-%#010llx] failed\n", + pr_debug("memory offlining [mem %#010llx-%#010llx] failed due to %s\n", (unsigned long long) start_pfn << PAGE_SHIFT, - ((unsigned long long) end_pfn << PAGE_SHIFT) - 1); + ((unsigned long long) end_pfn << PAGE_SHIFT) - 1, + reason); memory_notify(MEM_CANCEL_OFFLINE, &arg); /* pushback to free area */ - undo_isolate_page_range(start_pfn, end_pfn, MIGRATE_MOVABLE); mem_hotplug_done(); return ret; } From patchwork Wed Nov 7 10:18:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10672123 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 095CE15E9 for ; Wed, 7 Nov 2018 10:19:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC5A62B2FE for ; Wed, 7 Nov 2018 10:19:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0BC72B379; Wed, 7 Nov 2018 10:19:01 +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 569F82B2FE for ; Wed, 7 Nov 2018 10:19:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0947E6B04E7; Wed, 7 Nov 2018 05:18:52 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F35F56B04E9; Wed, 7 Nov 2018 05:18:51 -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 D89C66B04EA; Wed, 7 Nov 2018 05:18:51 -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 75CD76B04E7 for ; Wed, 7 Nov 2018 05:18:51 -0500 (EST) Received: by mail-wm1-f69.google.com with SMTP id r200-v6so13880347wmg.1 for ; Wed, 07 Nov 2018 02:18:51 -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=V5/bX0/SWP8L0SIclkIvq/xCjg7Ure75U3oy5+jt8kI=; b=fVCD0YmEEbGCnPcJMyvMu0JeVK9Ju9C1wT5TGi5GkFJLQmLKwfHMXmcnvSYfXabLzT B51TxHKD/WYahc6btAdkBMmKP/01ccxjKQDQpR5kVFi/BppKdvwIzj7yOLddG5KF6fpQ yNRTFFzWvCGO8Yg6Er20n29DnFvLA5UZakkcFdO9X1yPUbruLs6JCYV2FAGHOUM66c17 x+NsqXZNhTpnOBzl5PagS5YHxl19XMDOpHX1wrZDWD3JRkfqeCrXscmi6BryckhCQQ5x ON84T//6CBy/VV2uaHUcQJE7wydT2VQsNo+ieDBO3mnBW9JS1Fpcs6aNz3kJ91jJFZ0f p95Q== 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: AGRZ1gKWBs1IBY80hQSBrJRKRyhTRCsCbSkwbTNeMQ2MrkKeMj+7a/RE wapq4WHaYxQn9o6S08HyK/eKSZyyXA4+1b5u+aOKUlkoN9w/AfxLw0xbxKupQFIBsJbjWQTQwkN Hcofm3xFyP/VTVPZRZqoSHscbjqRR5MSffvQ3KQDllD6P1zUbGnR8JejlnXJwjtEChElZA0aN0S CHV7/ch7/tYlQmphWwFWSjoHqTSBzEl3uJWq2RchjQPS6pjXv+NWKxw/U3YtO6CZt42xJvkUElL 3GKCwiP+MpVO0M+K95D+TedNWOhj3zy7De8Bd0KogXPN1CoLph7j0dEkN3QiWf6b3mF3jx/xe9/ cBhoN0H6eVR+THSCHB+pdOCfoxX7vtngz8VhlEg9afTtk3Zh3PW8TZMHVqXow4cOX7W/GpSKnA= = X-Received: by 2002:a1c:8c8c:: with SMTP id o134-v6mr1425671wmd.35.1541585931009; Wed, 07 Nov 2018 02:18:51 -0800 (PST) X-Received: by 2002:a1c:8c8c:: with SMTP id o134-v6mr1425629wmd.35.1541585930096; Wed, 07 Nov 2018 02:18:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541585930; cv=none; d=google.com; s=arc-20160816; b=YfKXNQu6ituo1J2FckM5ZkJPGxm95/5jwpwhJWwODC1AjbfnAMEa8Uvu+GLZnDBYYm gaRvY7Bi936P9ppWrOeNYQo6CnNtc2wxnS8KKng/vAOjqttXpEKn1mqgtLdlIQ5ghE6X D5zOdR8DicYaaBgSo6Vke5SrhXj6aco74J9tRRCmVbHQLPBpgJEWSHdA28ZDoHTIv8y9 Q4XwpNapGn9eJ5BDej7sO7GvhyPLwwWCkVi3dvHoog3rzHrQoDhGQcub70iitf4sKcGw L3RnUSrD3ljlXLUBnEFaEre8oYk54FhI+ksqBinm/4bIPd0vDj640HW60ynvBaNsxa7+ CuTw== 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=V5/bX0/SWP8L0SIclkIvq/xCjg7Ure75U3oy5+jt8kI=; b=XOVqm5qq+IIfRXP+pyla3i8v062BQlIgBr6a8UufcuKPhTWPzZW9mvljuJ8ueJsNGw LSPh18IlJLeoS+Do3nQnKFJ+SsEfBr7HM6fX8R9FMtziKDhvkwVSxGYHgs9AHJ46bJLk uviHJhNCSoOoSoyE3XnNN84y+oI28bMRndfCHuRL9PWIcuRIVsZuHKOTlPkesF9qrXix RkZrDND+3Yda0XhkG7ROZAX0tKCg+nIfs31kWXf5jkCqLmAynsElV5D4NUNL3+VKfsKz 1Yqkj+sbrS9yNppvXRgYI9ZNExAhshvm1W5YkrEL59Bd9UBPtqCC0kTpLBxf82OGItYK iVlA== 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 e13-v6sor163387wrj.23.2018.11.07.02.18.49 for (Google Transport Security); Wed, 07 Nov 2018 02:18:50 -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: AJdET5eHo2JX1vYp8BkfX/qztqCKji8admMiIOvP+AoZ2YzWgs+cVV3KFo5eEzErRWcJHfx1pjbacg== X-Received: by 2002:a5d:660c:: with SMTP id n12-v6mr1393687wru.19.1541585929283; Wed, 07 Nov 2018 02:18:49 -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.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 02:18:48 -0800 (PST) From: Michal Hocko To: Cc: Andrew Morton , Oscar Salvador , Baoquan He , LKML , Michal Hocko Subject: [RFC PATCH 5/5] mm, memory_hotplug: be more verbose for memory offline failures Date: Wed, 7 Nov 2018 11:18:30 +0100 Message-Id: <20181107101830.17405-6-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 There is only very limited information printed when the memory offlining fails: [ 1984.506184] rac1 kernel: memory offlining [mem 0x82600000000-0x8267fffffff] failed due to signal backoff This tells us that the failure is triggered by the userspace intervention but it doesn't tell us much more about the underlying reason. It might be that the page migration failes repeatedly and the userspace timeout expires and send a signal or it might be some of the earlier steps (isolation, memory notifier) takes too long. If the migration failes then it would be really helpful to see which page that and its state. The same applies to the isolation phase. If we fail to isolate a page from the allocator then knowing the state of the page would be helpful as well. Dump the page state that fails to get isolated or migrated. This will tell us more about the failure and what to focus on during debugging. Signed-off-by: Michal Hocko --- mm/memory_hotplug.c | 12 ++++++++---- mm/page_alloc.c | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 1badac89c58e..bf214beccda3 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1388,10 +1388,8 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) page_is_file_cache(page)); } else { -#ifdef CONFIG_DEBUG_VM - pr_alert("failed to isolate pfn %lx\n", pfn); + pr_warn("failed to isolate pfn %lx\n", pfn); dump_page(page, "isolation failed"); -#endif put_page(page); /* Because we don't have big zone->lock. we should check this again here. */ @@ -1411,8 +1409,14 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) /* Allocate a new page from the nearest neighbor node */ ret = migrate_pages(&source, new_node_page, NULL, 0, MIGRATE_SYNC, MR_MEMORY_HOTPLUG); - if (ret) + if (ret) { + list_for_each_entry(page, &source, lru) { + pr_warn("migrating pfn %lx failed ", + page_to_pfn(page), ret); + dump_page(page, NULL); + } putback_movable_pages(&source); + } } out: return ret; diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a919ba5cb3c8..23267767bf98 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7845,6 +7845,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, return false; unmovable: WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE); + dump_page(pfn_to_page(pfn+iter), "has_unmovable_pages"); return true; }