From patchwork Fri Nov 16 08:30:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10685705 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 8EB4517DE for ; Fri, 16 Nov 2018 08:30:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DFBC2D681 for ; Fri, 16 Nov 2018 08:30:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 728532D690; Fri, 16 Nov 2018 08:30:38 +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 0C3522D681 for ; Fri, 16 Nov 2018 08:30:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD6196B087F; Fri, 16 Nov 2018 03:30:36 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C5F5D6B0880; Fri, 16 Nov 2018 03:30:36 -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 B00EB6B0881; Fri, 16 Nov 2018 03:30:36 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id 56C6E6B087F for ; Fri, 16 Nov 2018 03:30:36 -0500 (EST) Received: by mail-ed1-f72.google.com with SMTP id c53so2675216edc.9 for ; Fri, 16 Nov 2018 00:30:36 -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=uXaF0LU2hxKv1DV59TWidP/GBLSV25m9rHc2XnjwpNh/5ObKQTZ1dL4CTiHjq3moEb OdNNX9IYTL8FvMoVONxopae3S6gry3ztQ5xs5+G0e8G+eFLkZZI++qAChY3PYFdMqxi5 tht0GkSLG+QnT2szh68fHy/0MwyHdkcbNIfpbUWoZWwrrgdhuL0eYjsM3TzQPkMXMrw5 2e1lCPkqcrfcgsYwFyMLuW7AUgPDvghai2f09PAg0QecUNmNq+8ov2jidlOp5TO7s2Mu bcrG+DN/PzTnpjmuXCbkB2uXid4wBwGabxxRFDr0//U+oJ2oKAclBj91tisG6IZbIuc7 0tSQ== 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: AGRZ1gIJA3e7co3s+xWamMqs2OG3TV2xj2eU3aE+tYMyuKamwFoAXbpS zeCk+OdiwZQ3D5GGf5BEgfZLJT/9IdJtUVDLvcZy1GNRvTo3Q+wcBeIdBPMq7MlQj4eQXgjZFlN BM9Eq9Gse8AZA5t6u9x3meJVcIJlOFgUg+oQqOYh+Vpn3rsJ6HCmKDc+DnHa4uOKaZYmtksPVIZ MmmS5o9Q9ukvjR9uI8tgHssf+/wsBUFa+LRR6RDcq4tnK20X52GUrOEvTh2iQs11H8aP/9tO9nk c2Q0GkClqcbupA1A4Q2xzSwgB59w2XNsrPyuP+UXRoVpdjJEcBxWANj3oNb0vHeQgQXw73WDf7I ePFj+YRlzBJM5cK4X61LtiwvlhTr1wT+gj9epFQW6gRhiTo+jXCYWSn4h+bWcx1fOpo8bab2Ew= = X-Received: by 2002:a50:98c4:: with SMTP id j62-v6mr8294451edb.106.1542357035852; Fri, 16 Nov 2018 00:30:35 -0800 (PST) X-Received: by 2002:a50:98c4:: with SMTP id j62-v6mr8294409edb.106.1542357034975; Fri, 16 Nov 2018 00:30:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542357034; cv=none; d=google.com; s=arc-20160816; b=vYyeecCRpgX8qylfZWLS3nG529nnkmJAdhaEZy5+Ue221zrfwjheVVk8PlPYM/j8/T E4Ex6uy0BnKBcwO1Fnf9/6o4I8H23wvxczVCm2paJfu84Isj2gx8TVCfXTYeBMtUm5qJ cdMuY7t9i1//jkUXr2ZkIWfz2rLK/hQEGD32lv1WRuJT+x5IFVRsdGCUkTyUYuZErzHn MlEpMa20ujlBp7/R+KAbtAkNTnCrsKR2t4rbk3/hO2NOACo7GICUmXQBU8/HRNgG9SWQ ppKtwUk9FuR7YSf3yT9kWdmqBbqm9OJji2ydK8xNolGRslmfeogiRmD5A5mcxxGw6itq h15A== 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=ub3pTPEJc68dJEr4l2KXCRp0QmJ2LugNHoczhPrh2uZR9MzxsPITH2tZM1htjJMZV4 EIaoDh+HCx9SDfUAtlPRikQApzVykUJmNDbF73x2Uum0fHCJ8A9vFs0kgE94S+OeokU2 MGh/YL4Z5vDL+m0C0PkHzkluEeE+NTWv/FlE7OoWjn04FwshCVBCCQjCr73EjUT7RZWR VgF4GQw4rWvaQqm1C4bzkBsRkjlCdkbEsAiUGZly07/7O0Z4MV0IbgKJ0grmx/Vdxr9B Ygi1F8tRTKpRTSnuHPyO2zW3eBQ08QUSpL49RhNEDGFIsak/l23NVgquWGYcwtR4Xu+0 1i1w== 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 m4-v6sor7102259eja.14.2018.11.16.00.30.34 for (Google Transport Security); Fri, 16 Nov 2018 00:30:34 -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: AJdET5cHmrA/9d8gt2m9s3jppc+ITDsH27WkS168KT/9iVSh/xLvu2q+OrytpijuwyxwGdBr3BNLOA== X-Received: by 2002:a17:906:1f09:: with SMTP id w9-v6mr8039762ejj.22.1542357034515; Fri, 16 Nov 2018 00:30:34 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 00:30:33 -0800 (PST) From: Michal Hocko To: Andrew Morton Cc: Oscar Salvador , Baoquan He , Anshuman Khandual , , LKML , Michal Hocko Subject: [PATCH 1/5] mm: print more information about mapping in __dump_page Date: Fri, 16 Nov 2018 09:30:16 +0100 Message-Id: <20181116083020.20260-2-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 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 Reviewed-by: Anshuman Khandual Reviewed-by: William Kucharski --- 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 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 } From patchwork Fri Nov 16 08:30:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10685709 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 2685614E2 for ; Fri, 16 Nov 2018 08:30:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 172842D674 for ; Fri, 16 Nov 2018 08:30:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09F342D6A1; Fri, 16 Nov 2018 08:30:43 +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 A000A2D681 for ; Fri, 16 Nov 2018 08:30:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AFFAD6B0881; Fri, 16 Nov 2018 03:30:38 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A87146B0882; Fri, 16 Nov 2018 03:30:38 -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 9527E6B0883; Fri, 16 Nov 2018 03:30:38 -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 38D9D6B0881 for ; Fri, 16 Nov 2018 03:30:38 -0500 (EST) Received: by mail-ed1-f71.google.com with SMTP id c53so2675268edc.9 for ; Fri, 16 Nov 2018 00:30:38 -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=M3e4rnKhZF6b9Rlirn8GUYNHfXANocdVXHDH0uKtV51Zlmg5c3Iwy4f5+y59MH2EWA Ykdp9E7SX+Twh5igY1GYx3zP2rrgquYkCMWJfM/KlRx5WveFDLaAKEkS/PAiXIm8c7il b7YmgZx70dGiz3sCmsoucVzzDlaJzBscIMnBG7pkUu0G9fmMfpYXKijFFp1qg9wrvnth 7QnTdrQjzBTx7uzA4p4Eo5tc7PucyxPrSDGO/0pSdGGecEpG7+UchL6ErBGlm8vbbptV Ayr79vJyxuJDOU+n0qeGWzNtd0A9CHUa8mSv6nKdrWTxaLcYW28UnIoGHHKsKJ6IYV/F FRTA== 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: AGRZ1gK+8RGeqtlvvuURmVP0UYpO/5BQjErMB2V2nGRSaZDikeRlyfIy yeSbx2yZ3TuN4sqzZnGPrZTPkYoUE+sMuykPEOglNA+BR9amUlpeyzR9b+3PWybmb2qJfFsXYjS s2k/xuPmwF+oGlZ9xL22c6r3NT/2OJVERU8LQD+YYeRimtH7VlsDmMh+YB8bW+mCM7P/uofWL9r 92kc7fsYYwciOPwP1qoN4VMa20enIFXgJ/a42cYDSzA4r1RbsiFmK20muKwkqEbOGWxKLArXok6 riyA08QDfDRfXbrzoKCaBKtvl7BZEWNW0NuuT3AwjXFF/gKW0YlXHB8KbfZ6DsXXQ5+PxisBGEU OHw9/HXzz8w/3h3ayvZd7YX4ORktJocOXuUl+a4NaNEblLV2dHU8pfewjPCw3dcOVZxa2YH61Q= = X-Received: by 2002:a50:d48a:: with SMTP id s10-v6mr8663360edi.127.1542357037748; Fri, 16 Nov 2018 00:30:37 -0800 (PST) X-Received: by 2002:a50:d48a:: with SMTP id s10-v6mr8663326edi.127.1542357036965; Fri, 16 Nov 2018 00:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542357036; cv=none; d=google.com; s=arc-20160816; b=Bm9I6jsPIAmNIMA3Li3xIbT9Xoh8P5unze3PT+86ijrVpdOKn+LM+2LnfV/3qEIVLD zCCgDZr+BeTkviA5RvI74xY7LJepv9udmOKHvzAgFnf8Nv3TFFubDIrXVQ4xpykQ1X0z ct6PM+AE2Xe6iwjxIgY7w6APYaWK/GpNNIFKubCiyz5TqrxiFojsHLfbKL14NX4lWI3N pBjd1b2mNlTFvbOFNnwzLNSll2COQcSA+utJS8uH56e/aTPZRJJUaXkbD+5mwvf8r7Bc x5+vPaDvVJLgTUi8kqJV6iR/7WDxdSHcH81L3a/yQ+HuDU25kRApfQ8D9qYb5287+dxI DpgA== 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=IpZdjb/jdjib8ngw1AYQ+uzRI8Bw6NsaW23HJnX38I9I2M/t5J8K+2xoDrejLcus1a BD1V4VxVXbyQCFTLpmGBkcH0Moddid3kvuQqbZF0lbVS6GLYep8zkR7K9MgxUKjkR/yr 3Mgqw0eUG+JyhODoXYPLUAkaaVk6SP2tTg95E2Nl64XTWrviWeXWyHkmbFFQvBoGPugK pBDiAe/LVWuPja6NFFHoPXiCMQtDuVNspOiFrCnsi47HgSWheHjg+xa4+0nQi/lHpkuW YB86+reoJXfSxCWc1MBtTdIdH2TrHPegB5QsckwXmcCAy1dXvyS4OaUblk45FUSsTfyt 2zog== 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 g20-v6sor4747298ejt.1.2018.11.16.00.30.36 for (Google Transport Security); Fri, 16 Nov 2018 00:30:36 -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: AJdET5ce8thTuMJ1q0vegNyv6CKr019FdypPkBANPR2wA8fynBbK/HMeJFfdMuj/HhmEqB5Y+sYBvg== X-Received: by 2002:a17:906:f6cb:: with SMTP id jo11-v6mr1444856ejb.80.1542357036521; Fri, 16 Nov 2018 00:30:36 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 00:30:35 -0800 (PST) From: Michal Hocko To: Andrew Morton Cc: Oscar Salvador , Baoquan He , Anshuman Khandual , , LKML , Michal Hocko Subject: [PATCH 3/5] mm, memory_hotplug: drop pointless block alignment checks from __offline_pages Date: Fri, 16 Nov 2018 09:30:18 +0100 Message-Id: <20181116083020.20260-4-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 This function is never called from a context which would provide misaligned pfn range so drop the pointless check. Signed-off-by: Michal Hocko Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual --- 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 Fri Nov 16 08:30:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10685711 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 77DE314E2 for ; Fri, 16 Nov 2018 08:30:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68BFF2D67C for ; Fri, 16 Nov 2018 08:30:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D1F02D690; Fri, 16 Nov 2018 08:30:45 +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 C9B792D67C for ; Fri, 16 Nov 2018 08:30:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07C126B0882; Fri, 16 Nov 2018 03:30:40 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E5AF96B0883; Fri, 16 Nov 2018 03:30:39 -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 CFDB36B0884; Fri, 16 Nov 2018 03:30:39 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 75C4D6B0882 for ; Fri, 16 Nov 2018 03:30:39 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id c8-v6so11064847edt.23 for ; Fri, 16 Nov 2018 00:30:39 -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=wSKUKWTu/JnWNKe9NUPf6eNFtrvxLeBHWSYH+NlRpmU=; b=ShqvA9Cz2XeiVBfkYG7Qu222PT2n89Xe/B5z+Zakb2QL14y5+F1q8yboyKSQYbuUxV 9RYpgQYbvQTHWPecMzArh85SP6BSBnMrtFc6PNCkX4nLc9ZzWTXm1GqTCzy0OmQEYnEK m38U9rIp9zSTbQgimpkybsy4XvlC6q0vxz3PKTpT4ndIHzOBMwRCY5j/5Rbd71E2gCQs +fXa870RwIQBpU/Bls2+fg5w/U1F1KxFNksDdqpxA6kg/7uzkuUPLyN/kg2fpgIFbuUb 9wLLh4jhf3er7bOCqCYBCnCQ9XRkMFz/7Ejujb6bclSC7/rDsUzb7bJ07HNUdRT3zrBi l05Q== 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: AGRZ1gIg1CAqZuCov5GZWV3WUpfvSeF43/tQd9Y9uHG5d8/SDIwgS/JU AT323MKyeYIiUXpgB3lTwvanR0nNXjilE7O77xhf6KGrp3cQi+EStuJtvWB5ns85o1JgDVQwvki FjQOYunpMx8YUWOU11Z9Sfjfw+Lr/AIolUf8j6Dvdy7DhuziBTFlOIiwvemORL83HSkupjlBPMy bWRzcuEIZ1J2IGIYvSR0YNetQwHNKbMsGFhOeaJKj4Sgc9Nj00b7YQJYyUEwrghDT83qZxtac0/ mWGiRmRsd0L4xTpxjjPPWcqntzRv09larBWpKNT8RnHDwE/C31QzNbY9qPF6ngt9oYJk0lrja+z d4ABpZ3a5JfrGaNmngsSZdAu3Dj8G44jVihRFRP7AXkK8YP6t1KOHJ2HFmx+A4i5a0noutaDFA= = X-Received: by 2002:a17:906:e211:: with SMTP id gf17-v6mr7835326ejb.46.1542357038956; Fri, 16 Nov 2018 00:30:38 -0800 (PST) X-Received: by 2002:a17:906:e211:: with SMTP id gf17-v6mr7835291ejb.46.1542357037902; Fri, 16 Nov 2018 00:30:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542357037; cv=none; d=google.com; s=arc-20160816; b=uwYQ5E6YBb5ISs1K8QFlfAlOP6hUfdEKC/6uoWnzNwH/vLDMbTvFlSF6DQdDYxI1LV 6jYZt/vsH2xHqSlTflRm35wM3DCuABC5NFgog0DajUI3Bc4N+D+pDeNgGC7GX9U2bW/f VKVMtrnXoWmlRH/Kj4RQJ79dhybX+qgoktp18DXdcXQOrvHBQiEkJh7/EFpBKq8lv3Ts wtVKWxX0suR+r86lB587gSdhE6IFtHtq/iO1x7TiCJjB0UdGpcMsUWIowTHgOK647+TV ecW9UzTOwg1fYx5CMHoQrRpw1o1XylrRHw4b9PUqcrFYxknlIEdXOnK0p+o2aQUXKt7N +m5g== 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=wSKUKWTu/JnWNKe9NUPf6eNFtrvxLeBHWSYH+NlRpmU=; b=C/uG+5jVIV8sc1jgjKt2fgHx14cR0kn4bEgCG98R3F0Ml0pXLRd3y6yUX0zbBCttMv GKVrQB8mxI4TDxDSE+XrlN3OS7x+195WbMIElvxXg9HoQgv+FrzgA8B5c/8vFcANsSFH xUvQ11FVNrUNC6XnTMAluv5cdT0VuLNsom5DN4qogL4b6Rpg+mLGMaXYQO2xWNrJF/A6 jWn/XcYitV1SXVt/g2K9PoVx4mfcWzxE8uiwlmL4UTOCpbh7vu0NzKKaIu6qA+Gs7dDb ZHliZmkuQPRwzYAnKksVUntV2ixz7DXULN1gW67PBb0l1dPVVpJiIPUPF8K9tfzRcMoZ GwLg== 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 n7-v6sor3126134edq.26.2018.11.16.00.30.37 for (Google Transport Security); Fri, 16 Nov 2018 00:30:37 -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: AJdET5c3+G/+V7gFn4TE0EzjkRjzL9V/6jTihahs2hAbkoHDen2rn55TLhiQuPA/cvNpYSXM2K25pg== X-Received: by 2002:a50:8d46:: with SMTP id t6mr8854960edt.269.1542357037478; Fri, 16 Nov 2018 00:30:37 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 00:30:36 -0800 (PST) From: Michal Hocko To: Andrew Morton Cc: Oscar Salvador , Baoquan He , Anshuman Khandual , , LKML , Michal Hocko Subject: [PATCH 4/5] mm, memory_hotplug: print reason for the offlining failure Date: Fri, 16 Nov 2018 09:30:19 +0100 Message-Id: <20181116083020.20260-5-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 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. [akpm: tweak messages a bit] Signed-off-by: Michal Hocko Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual --- 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..88d50e74e3fe 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 = "failure 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 = "notifier 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 = "failure to dissolve huge 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 Fri Nov 16 08:30:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10685713 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 3687A17DE for ; Fri, 16 Nov 2018 08:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25E3D28B22 for ; Fri, 16 Nov 2018 08:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A2692D681; Fri, 16 Nov 2018 08:30:48 +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 9D1B228B22 for ; Fri, 16 Nov 2018 08:30:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB29E6B0883; Fri, 16 Nov 2018 03:30:40 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BE8286B0884; Fri, 16 Nov 2018 03:30:40 -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 9F0BE6B0885; Fri, 16 Nov 2018 03:30:40 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 403666B0883 for ; Fri, 16 Nov 2018 03:30:40 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id c53so2675309edc.9 for ; Fri, 16 Nov 2018 00:30:40 -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=LzlccDXf/yxTKP+pRsq4A6fnjdUbs9H45qb89MeJwgk=; b=YtiQEqBKUKNag2IF75DseVxO41JEcbjQpdouzQxWFdTg82tsGkBN9FGYCr+FHaGCdt f2W4xgvE/KH8SfeWVMpyHfz+4kROiGb5WGDL+YdiGKo/upRqjT44tXqJiltjuC0u8/L/ CBXdEbOtvBlxsWcEllWKSvUwqRU2+IaabI7iDlKhMBZYrc3uGqyBse27dGr/qekTJuVJ Y2d/UmdF8BbbVVAN0zF6Jr5xOomKGXj73LOOnAwEWGtUYS7XJ6BLOip39x0wuxD3692S Y//vBXy4WegVFlLmmUCvIucH3iSLu51GaFpt8PEcHCrxXu82jsr0Qpt8+PK0K5apfKSY QX0g== 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: AGRZ1gLv33+yeRIL+38wSzv5zKV1bU2YiVVJUbdRqWLjcloOsLqokUpW 9rd7OuyObBKl5pf1yLQqaPTQuaFl7MQ9YhrO6onjdt3Ws32wNPu0AwAxz+qHeSY0jeb35GrAOuA TTd69Y4kGsGniI8fQIT1LUqHldJBWyhUBjKqu2Utbh8UAFr47U5WXMIm0vnuH4nj4ggRf0UlPaL t4Oxjq1C/4MoD1dL1xtmrTt+Ud8lNMcsJ8hZW0oVLgJ0ctfWI8knvUlxfVitJD06vM1yKL8KXdd jaAFeYeFXK5JzLFmDiUdmRBzQLwCZ6/tPwL43UIhC0nc90XzoqFtPPqUiL9ZQjAIcCbagCJsvuU XRS6qnwbNRBaHpaESDPasRyXQ7VuNeA48f4V5IYml5fzM5B7fVvDPUeXXiQhcpamhT2vKEk7zQ= = X-Received: by 2002:a50:ae8f:: with SMTP id e15mr8928948edd.250.1542357039839; Fri, 16 Nov 2018 00:30:39 -0800 (PST) X-Received: by 2002:a50:ae8f:: with SMTP id e15mr8928905edd.250.1542357038980; Fri, 16 Nov 2018 00:30:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542357038; cv=none; d=google.com; s=arc-20160816; b=sNBWymA8Ai1wk8vFPtIK7cXttRnap+gJYRz+F5WWLegv1lRVfKYIRKfIRKpfBQxgd8 2VHy5eO/Jm7dKUfPDKkXz3W1KeyEetYftDxvr4YewrquI++cEuJx4ySMaR51TCGkRmMo xY7/IQGaBrUh8vY1hgctAdhQHYGf74a7Gaxc0bofEOXrxfy+AkzYzJQXOL1o1+wPGjF3 vXsXm84oqQ7UCLn9PWvFcmEVveZNgrKv1w1UE4YIi6yzAv8o7EY9MogCH3++LNlhObGd 2K78ePiDV98bO4YlRBt5M2B7GKgOAYNc+wXDxuBvO22NJ3d14A7j6NXLWMhu63WNW4Ma JmIg== 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=LzlccDXf/yxTKP+pRsq4A6fnjdUbs9H45qb89MeJwgk=; b=cvwve4ijoUCKQb9/vYf1nPm89NQ24R6yE4R8AdkLnXGEbdqRiHakrxBl0v8povcFXW PCI/Ol1/2ETF8drH86rhKFGQkgp9htxxE2IX3Eq6PV1RQN1yireasWJM++BX2OLCBLUX oaMduxCIVlvHll/6zr52NCFWHUeEpDcKgqO3NqYEYR+yO5YitBmgOLhb3hvTO5ozbfRx zSa0LDvEKk2cu2B/HHb+A+4ACkLHUnjXAWAHMXfbWPih2i+5sguA2MclQ2k40N7W5XHg bLWlw+rf0yLOOtbNlKCYhYMZUpCQOYu3vYzQcuJHmn5TANWTpKcq0qE4Ez04r73JRiS2 agOA== 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 c13-v6sor15937661edi.3.2018.11.16.00.30.38 for (Google Transport Security); Fri, 16 Nov 2018 00:30:38 -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: AJdET5c8sPRA1OLjYdnOBPxOalFmoaWho8oqy17NWq64FbRugxfrghIX3x/y2iTbh6OilXOnPHZV5w== X-Received: by 2002:a50:be4c:: with SMTP id b12-v6mr8743984edi.46.1542357038628; Fri, 16 Nov 2018 00:30:38 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 00:30:37 -0800 (PST) From: Michal Hocko To: Andrew Morton Cc: Oscar Salvador , Baoquan He , Anshuman Khandual , , LKML , Michal Hocko Subject: [PATCH 5/5] mm, memory_hotplug: be more verbose for memory offline failures Date: Fri, 16 Nov 2018 09:30:20 +0100 Message-Id: <20181116083020.20260-6-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 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 Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual --- 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 88d50e74e3fe..c82193db4be6 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 ret:%d ", + page_to_pfn(page), ret); + dump_page(page, "migration failure"); + } putback_movable_pages(&source); + } } out: return ret; diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a919ba5cb3c8..ec2c7916dc2d 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), "unmovable page"); return true; }