From patchwork Fri Jul 6 06:17:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10510811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CEC47600CA for ; Fri, 6 Jul 2018 06:17:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC77E2821F for ; Fri, 6 Jul 2018 06:17:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0C1A2836F; Fri, 6 Jul 2018 06:17:56 +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 24D582821F for ; Fri, 6 Jul 2018 06:17:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6DF96B0005; Fri, 6 Jul 2018 02:17:54 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E1D3C6B0006; Fri, 6 Jul 2018 02:17:54 -0400 (EDT) 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 D0DC06B0007; Fri, 6 Jul 2018 02:17:54 -0400 (EDT) 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 721746B0005 for ; Fri, 6 Jul 2018 02:17:54 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id r9-v6so472966edh.14 for ; Thu, 05 Jul 2018 23:17:54 -0700 (PDT) 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:date:from:to :cc:subject:message-id:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Y5IPmMskCGbBl4JRcAII9dR1PVvy9RDDcs/1467+/FQ=; b=QDgWHP8oTIo5KmNs5QpKSPRWd6UlJQ3k16O5uyGuODBM7uBviDMydktxp9vKkF1oYj KgcUTEBj0lpwedDq4FBupR8vfdXCsxkMOO447z+hleO/m6tTgDM3uD6GMeKqqqkgwSr1 wDpbu5MMZ6yceyz1Kh2e3hh6BTCiC2uVKE1Yk8vOXfQsRvSavRN94Am15QZ6CvrOIaxf Jj5Yz2SE9HpIaNI5MHHVGM109lyI10NuxWHQNIpkUbZIp+o/6FDgEOn/YkVGzecO562x WD7fUDtcVX2OI5kv57RSYiikdl4EGgTgXhVOuCI+w+HtTySEDOK36qXf7Tw50ifCiXnX f2YA== X-Original-Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: APt69E0Z5VPO0N54cxBOGZiVYjoJxV4POz+QBCwveVmXgVcgVo08tCMt lsWUsU+R+NRHNcSTArNMfYrXUdKGcTLmXuCswuaW5kjOay2siXAKOKhy8YkGjceYQyZ05tLtohq arQnENOINEaSd6hb/T8vXBdD63PKintjoEEgUThkJpA5xuCpsakjckN0YlWSaBN4= X-Received: by 2002:aa7:d2cd:: with SMTP id k13-v6mr9285213edr.311.1530857874012; Thu, 05 Jul 2018 23:17:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdjfq8zOLH4PDwt0A8M45tZj7T5iFBpQLnaw03L5iX7G6Ot8G+XiX4fCKBUNX6zaOmqvhVn X-Received: by 2002:aa7:d2cd:: with SMTP id k13-v6mr9285167edr.311.1530857873285; Thu, 05 Jul 2018 23:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530857873; cv=none; d=google.com; s=arc-20160816; b=jb8/caSPl6mTzqqEFyiElnr5bRrba9tUA032ntmrBVl7J04xWp8LIjlXig8OBj6u/P S1O6J8951o7BcfOLhYjjSqoUM16gBorXIxi2ySibQUlhzR11iAngTiaFTUTjHbIXvlIP eiYsbQQm4M51SlIXUYug/bBjz6cXQE0PrQMtjgtCbZaBWJAfRkpa96nCMsQYhrcYPqKP BsRbHoYSYQX19FMNlAGwBSI1fJ56HDCMLsQneLXwFiZuEBTNF+bpwVMPEQQuYQ/BoymW FzWjU8uBh2yyDCCdTOgTXjbHyiHQJ8Vc/seVrJU5ri7mmh177aEJhIPXghI9doHjD5Qg OKZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=Y5IPmMskCGbBl4JRcAII9dR1PVvy9RDDcs/1467+/FQ=; b=KzMIhlan8QCGkYRk76iqgaC7Ui7/xV+WUeffFVx+HSCyX+dzIWOxNztzfXnnN6+/C4 dgnd0ph4VRLvKxzXD6M23yaccnh+YAJVfsR9vj9t9luN1PvAnEKmQs5DEWio6+zPaAY1 OOPxoued/wnURg66XLzeuHRNYTU4hbXoESuSD0eiVfq4PdvGb4LvMwFM3BRTgoJ4chRT uFZ36u1ZXzMwVTRcNmKSOZ1o6/CzW8iB9su4QqeR41L2MM38u2OcCrUJRC1NqO63n4QK kl+9/LPfh41S4yD/oiGKieaBieQmlnshpTQEVp+aGy2KNorkZzIqtFw2LP4/AIylLaB9 eJxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id m2-v6si2108278eds.184.2018.07.05.23.17.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 23:17:53 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) client-ip=195.135.220.15; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning mhocko@kernel.org does not designate 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 706CAAF62; Fri, 6 Jul 2018 06:17:52 +0000 (UTC) Date: Fri, 6 Jul 2018 08:17:50 +0200 From: Michal Hocko To: Andrew Morton Cc: Vlastimil Babka , Geert Uytterhoeven , Mike Rapoport , Greg Ungerer , Sam Creasey , linux-m68k , Linux MM , Linux Kernel Mailing List Subject: Re: [PATCH v2 3/3] m68k: switch to MEMBLOCK + NO_BOOTMEM Message-ID: <20180706061750.GH32658@dhcp22.suse.cz> References: <1530685696-14672-1-git-send-email-rppt@linux.vnet.ibm.com> <1530685696-14672-4-git-send-email-rppt@linux.vnet.ibm.com> <20180704075410.GF22503@dhcp22.suse.cz> <89f48f7a-6cbf-ac9a-cacc-cd3ca79f8c66@suse.cz> <20180704123627.GM22503@dhcp22.suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180704123627.GM22503@dhcp22.suse.cz> User-Agent: Mutt/1.10.0 (2018-05-17) 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 On Wed 04-07-18 14:36:27, Michal Hocko wrote: > [CC Andrew - email thread starts > http://lkml.kernel.org/r/1530685696-14672-1-git-send-email-rppt@linux.vnet.ibm.com] And updated version with typos fixed From 63077ac611ff3f95afadf534902a8ab2984d5404 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Wed, 4 Jul 2018 14:31:46 +0200 Subject: [PATCH] memblock: do not complain about top-down allocations for !MEMORY_HOTREMOVE Mike Rapoport is converting architectures from bootmem to nobootmem allocator. While doing so for m68k Geert has noticed that he gets a scary looking warning WARNING: CPU: 0 PID: 0 at mm/memblock.c:230 memblock_find_in_range_node+0x11c/0x1be memblock: bottom-up allocation failed, memory hotunplug may be affected Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 4.18.0-rc3-atari-01343-gf2fb5f2e09a97a3c-dirty #7 Stack from 003c3e20: 003c3e20 0039cf44 00023800 00433000 ffffffff 00001000 00240000 000238aa 00378734 000000e6 004285ac 00000009 00000000 003c3e58 003787c0 003c3e74 003c3ea4 004285ac 00378734 000000e6 003787c0 00000000 00000000 00000001 00000000 00000010 00000000 00428490 003e3856 ffffffff ffffffff 003c3ed0 00044620 003c3ee0 00417a10 00240000 00000010 00000000 00000000 00000001 00000000 00000001 00240000 00000000 00000000 00000000 00001000 003e3856 Call Trace: [<00023800>] __warn+0xa8/0xc2 [<00001000>] kernel_pg_dir+0x0/0x1000 [<00240000>] netdev_lower_get_next+0x2/0x22 [<000238aa>] warn_slowpath_fmt+0x2e/0x36 [<004285ac>] memblock_find_in_range_node+0x11c/0x1be [<004285ac>] memblock_find_in_range_node+0x11c/0x1be [<00428490>] memblock_find_in_range_node+0x0/0x1be [<00044620>] vprintk_func+0x66/0x6e [<00417a10>] memblock_virt_alloc_internal+0xd0/0x156 [<00240000>] netdev_lower_get_next+0x2/0x22 [<00240000>] netdev_lower_get_next+0x2/0x22 [<00001000>] kernel_pg_dir+0x0/0x1000 [<00417b8c>] memblock_virt_alloc_try_nid_nopanic+0x58/0x7a [<00240000>] netdev_lower_get_next+0x2/0x22 [<00001000>] kernel_pg_dir+0x0/0x1000 [<00001000>] kernel_pg_dir+0x0/0x1000 [<00010000>] EXPTBL+0x234/0x400 [<00010000>] EXPTBL+0x234/0x400 [<002f3644>] alloc_node_mem_map+0x4a/0x66 [<00240000>] netdev_lower_get_next+0x2/0x22 [<004155ca>] free_area_init_node+0xe2/0x29e [<00010000>] EXPTBL+0x234/0x400 [<00411392>] paging_init+0x430/0x462 [<00001000>] kernel_pg_dir+0x0/0x1000 [<000427cc>] printk+0x0/0x1a [<00010000>] EXPTBL+0x234/0x400 [<0041084c>] setup_arch+0x1b8/0x22c [<0040e020>] start_kernel+0x4a/0x40a [<0040d344>] _sinittext+0x344/0x9e8 The warning is basically saying that a top-down allocation can break memory hotremove because memblock allocation is not movable. But m68k doesn't even support MEMORY_HOTREMOVE so there is no point to warn about it. Make the warning conditional only to configurations that care. Reported-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Michal Hocko --- mm/memblock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/memblock.c b/mm/memblock.c index 03d48d8835ba..2acec4033389 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -227,7 +227,8 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size, * so we use WARN_ONCE() here to see the stack trace if * fail happens. */ - WARN_ONCE(1, "memblock: bottom-up allocation failed, memory hotunplug may be affected\n"); + WARN_ONCE(IS_ENABLED(CONFIG_MEMORY_HOTREMOVE), + "memblock: bottom-up allocation failed, memory hotremove may be affected\n"); } return __memblock_find_range_top_down(start, end, size, align, nid,