Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp806729imm; Wed, 23 May 2018 05:58:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpTZQVf1JRh0IQkqC8DuyzFk+B91EVl5WUJoHTJ6OArCUIrLaP3hrv4qrdUOEIn7F5tH4h6 X-Received: by 2002:a17:902:1744:: with SMTP id i62-v6mr2882876pli.267.1527080332257; Wed, 23 May 2018 05:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527080332; cv=none; d=google.com; s=arc-20160816; b=Kva3LGR0ohp09BroB7ylx0wO8Qgm70DHljtLhhOuBZDyfqjB1Xi7EqLMDcx+YeXmug 4iwa78n7t03RQ6ZtfNsU+aIUweMTm66f/yUttkXYzXQC+fD+X+4XK4EipU3+vwDe/Mnr 9PcNlGlFcrPueLZfX7MJAVgcORMDsWBPxoUlaySJSVnk7m5T4UuQXfIEnTehk0WQ5GI3 lRrYF6CuYoQHJSCsPzGqzk3BZmu0BwhpxOxPCL518hEGlMlNpN/xqidxhLEbtTrDzUUz M3XuK3scQdFSqK+Skk5A5E8d10+5Q98MdCB3xo7ZgJsy927UZnf4dE4ZOKKFPjPFh18s 43wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=GFOFsEyjYQPfkTx5NvDQwSlCXCH4zFnlrRlTsiILKEc=; b=G5YF+kxK3sB/nF4Yy6vpOcpMa7Yfm61wtYRIZUHYxAEsAYk8fz/CaPDisvP6LsWMO4 L0YHBNDzltWbggrlY2pXoJ4/PrFjSPzAIZT8sCJx0u8XK3eJAVtPU445jzq+7Bq/Wh/i mKYFG0/iTAr28Cdcjo5kjnplemhitNlRGGKBrz/tn5O/buXDZhp7586S6MKGPobcb2W6 29gU9lrQKoGmlimTzDpa6uC7GxJpZDEZnvENvjyrV5/HG5Pae0ccQABAdYeWJ9Be6xZ3 LfJVZyhBaLU5RD0YfNNWX2CngSFDb1PP8vwg+7f+Zo2lvKwHLf4uVgS/v6j8jJCPa8Mt z1ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7-v6si2805205pgn.595.2018.05.23.05.58.36; Wed, 23 May 2018 05:58:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932977AbeEWM4d (ORCPT + 99 others); Wed, 23 May 2018 08:56:33 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:46218 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932980AbeEWM4I (ORCPT ); Wed, 23 May 2018 08:56:08 -0400 Received: by mail-wr0-f196.google.com with SMTP id x9-v6so23459541wrl.13 for ; Wed, 23 May 2018 05:56:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GFOFsEyjYQPfkTx5NvDQwSlCXCH4zFnlrRlTsiILKEc=; b=ThE8xLrsNg8QUpOAeN6ithTP1gLhO2rpeVXkijk8mTk4srP5iJZVIyRW68jFheLvOI ZpxY4pXl6AijEBu9KyfNWko+txgIIho9GnyC1M1yEVGQYZIXZFE/zAS8TfFpxfXnX3rV NWRQavBA5gONVgopK5AKBcNK8LtbKHu0uaWtjOOltU7I4FI3hp9EW0jN3+etPdkek6qh eAxp/08qV1e/Ki8piNtb04grMhIACsseer4zoEKL3iopL8bfwPWL7pLnIqjEpKYNpFe5 nJzBSNGvNVcItxu+89P+4yj6nm673XynKYzihM/u7dGJnGipKBLqdHyv9CVXZa5gJ34l Y5VQ== X-Gm-Message-State: ALKqPwcYFXXFPTdkaeBbx+qo8qiRqvXH0jo0Wz1zBrwbemgb417m05c6 7PsrCykK5V+zPqs5aLZPKJQ= X-Received: by 2002:adf:bb4c:: with SMTP id x12-v6mr2222175wrg.244.1527080167348; Wed, 23 May 2018 05:56:07 -0700 (PDT) Received: from tiehlicka.suse.cz (ip-37-188-135-200.eurotel.cz. [37.188.135.200]) by smtp.gmail.com with ESMTPSA id u89-v6sm2643543wma.4.2018.05.23.05.56.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 05:56:06 -0700 (PDT) From: Michal Hocko To: Andrew Morton Cc: Oscar Salvador , Vlastimil Babka , Pavel Tatashin , Reza Arbab , Igor Mammedov , Vitaly Kuznetsov , LKML , , Michal Hocko Subject: [PATCH 2/2] mm: do not warn on offline nodes unless the specific node is explicitly requested Date: Wed, 23 May 2018 14:55:55 +0200 Message-Id: <20180523125555.30039-3-mhocko@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523125555.30039-1-mhocko@kernel.org> References: <20180523125555.30039-1-mhocko@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Hocko Oscar has noticed that we splat linux kernel: WARNING: CPU: 0 PID: 64 at ./include/linux/gfp.h:467 vmemmap_alloc_block+0x4e/0xc9 [...] linux kernel: CPU: 0 PID: 64 Comm: kworker/u4:1 Tainted: G W E 4.17.0-rc5-next-20180517-1-default+ #66 linux kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014 linux kernel: Workqueue: kacpi_hotplug acpi_hotplug_work_fn linux kernel: RIP: 0010:vmemmap_alloc_block+0x4e/0xc9 linux kernel: Code: fb ff 8d 69 01 75 07 65 8b 1d 9d cb 93 7e 81 fb ff 03 00 00 76 02 0f 0b 48 63 c3 48 0f a3 05 c8 b1 b4 00 0f 92 c0 84 c0 75 02 <0f> 0b 31 c9 89 da 89 ee bf c0 06 40 01 e8 0f d1 ad ff 48 85 c0 74 linux kernel: RSP: 0018:ffffc90000d03bf0 EFLAGS: 00010246 linux kernel: RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000008 linux kernel: RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00000000000001ff linux kernel: RBP: 0000000000000009 R08: 0000000000000001 R09: ffffc90000d03ae8 linux kernel: R10: 0000000000000001 R11: 0000000000000000 R12: ffffea0006000000 linux kernel: R13: ffffea0005e00000 R14: ffffea0006000000 R15: 0000000000000001 linux kernel: FS: 0000000000000000(0000) GS:ffff88013fc00000(0000) knlGS:0000000000000000 linux kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 linux kernel: CR2: 00007fa92a698018 CR3: 00000001184ce000 CR4: 00000000000006f0 linux kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 linux kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 linux kernel: Call Trace: linux kernel: vmemmap_populate+0xf2/0x2ae linux kernel: sparse_mem_map_populate+0x28/0x35 linux kernel: sparse_add_one_section+0x4c/0x187 linux kernel: __add_pages+0xe7/0x1a0 linux kernel: add_pages+0x16/0x70 linux kernel: add_memory_resource+0xa3/0x1d0 linux kernel: add_memory+0xe4/0x110 linux kernel: acpi_memory_device_add+0x134/0x2e0 linux kernel: acpi_bus_attach+0xd9/0x190 linux kernel: acpi_bus_scan+0x37/0x70 linux kernel: acpi_device_hotplug+0x389/0x4e0 linux kernel: acpi_hotplug_work_fn+0x1a/0x30 linux kernel: process_one_work+0x146/0x340 linux kernel: worker_thread+0x47/0x3e0 linux kernel: kthread+0xf5/0x130 linux kernel: ? max_active_store+0x60/0x60 linux kernel: ? kthread_bind+0x10/0x10 linux kernel: ret_from_fork+0x35/0x40 linux kernel: ---[ end trace 2e2241f4e2f2f018 ]--- ==== when adding memory to a node that is currently offline. The VM_WARN_ON is just too loud without a good reason. In this particular case we are doing alloc_pages_node(node, GFP_KERNEL|__GFP_RETRY_MAYFAIL|__GFP_NOWARN, order) so we do not insist on allocating from the given node (it is more a hint) so we can fall back to any other populated node and moreover we explicitly ask to not warn for the allocation failure. Soften the warning only to cases when somebody asks for the given node explicitly by __GFP_THISNODE. Reported-by: Oscar Salvador Tested-by: Oscar Salvador Signed-off-by: Michal Hocko --- include/linux/gfp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 036846fc00a6..7f860ea29ec6 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -464,7 +464,7 @@ static inline struct page * __alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order) { VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES); - VM_WARN_ON(!node_online(nid)); + VM_WARN_ON((gfp_mask & __GFP_THISNODE) && !node_online(nid)); return __alloc_pages(gfp_mask, order, nid); } -- 2.17.0