Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1247211imm; Fri, 29 Jun 2018 14:17:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKPQdy9qjYiu0I09SlW0F1sNzmwR1Yqwut+rh3C+VjtJpzIfIXNbE7412+KalveeJZnl78o X-Received: by 2002:a63:be05:: with SMTP id l5-v6mr13892862pgf.330.1530307070029; Fri, 29 Jun 2018 14:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530307069; cv=none; d=google.com; s=arc-20160816; b=s/3hhGH+H8SAB+nlohsqv46lHV+5oJXYWnsC5hz5C/E5r4ERjZqH5HYADcTfNb/T9G jy0v/Wn6T3Bfv6Jhe5gWSuDduNVdTDfEIHsEdgQWV4p8mGOuplKHroZRRbrJAMxBv9ru t8+y+yMt0HY92OLfv1ziFyRPCRcL5nSBxBLHK+cWRRaAl9RTXMjW/x/Ri4bCpqNoLxQ5 FI6gCR72Neopp+3bqrdw03yiwfU7ugpo5vpmOfILxNxYe4Q6OZbEGdfg1wP2Dh04VuEH u/y2W33XJRR16RHz3fABu83G09sIkegZI1YtNPu21p/zv+0zvzraNuj+cGBhR7O7RDF+ jLnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=6TROBHjoHp/xp7tUTbYToCo3/Cbs9Sl4CiFMVylqIMU=; b=e2bFfFMptUMmg0Q0HRULuvQQia/U+sNkJK0ZU+8uMVd6Wwvy8zu/cDwRTYjKaSDtJR n+94YgRPNUssPNYRBhAaRgnaMp1G5M3qJ/ria5/U7iZV0HVSc+UD3OeogZH+z/QFpdye KHMy9RIjTg2QqhjYuHd8wY/QbDnd4XQ1ijPMJTrsHr6qupg5yCzAgli5iKltf2OHspZy Ksoy1agL+wCIKzaJi48YmXD0A50AKLuUg/tE0cR/0H9KZoeGPaZpWLUE6oQgJqObW9PA rgGRDIs52TEbeykVdR7kBdVyfmK4ru2zmCJsstdyhSlp4NYhOuY9HDgwliawGhUKPzFf UDdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OddJ7dYt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6-v6si8691596pgy.224.2018.06.29.14.17.35; Fri, 29 Jun 2018 14:17:49 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OddJ7dYt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936236AbeF2UYd (ORCPT + 99 others); Fri, 29 Jun 2018 16:24:33 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55736 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932375AbeF2UYc (ORCPT ); Fri, 29 Jun 2018 16:24:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6TROBHjoHp/xp7tUTbYToCo3/Cbs9Sl4CiFMVylqIMU=; b=OddJ7dYtFprPNe7hN36o7/TYZ am2nMCX9QGg9Z00VxHjBPwjEUvNm8n5fvMoo0jKJ+NTyh3Hy/4pCcN4Uf325oEwBCekYDcbP3pKs8 LfX6k2B+5uOKrxFXrvJyOVWckA1TZ8YFtAGoCfhsVqjFjHdyz3ysYxZ+PPZ7tGi+PSu7oaKxh4M9D 41xrU9WW+NZ1r/Y0tjglnWb8VlXZJX89BOmX3paBGtqedF4xMyFiD9vfIKSzqMJtAU7rg062uuCaF /WzjQqGCQvemFKCXYKGHFIUXorzVS1VS+nZwRRtzXcyEevMBRHfnypl40AkAdUC1kLF26zr5pXQ/J 1SCH70meg==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYzwU-0001DC-Sr; Fri, 29 Jun 2018 20:24:30 +0000 Subject: Re: [PATCH] mm: make DEFERRED_STRUCT_PAGE_INIT explicitly depend on SPARSEMEM To: Mike Rapoport , Andrew Morton Cc: Michal Hocko , linux-mm , lkml References: <1530279308-24988-1-git-send-email-rppt@linux.vnet.ibm.com> From: Randy Dunlap Message-ID: Date: Fri, 29 Jun 2018 13:24:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1530279308-24988-1-git-send-email-rppt@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/29/2018 06:35 AM, Mike Rapoport wrote: > The deferred memory initialization relies on section definitions, e.g > PAGES_PER_SECTION, that are only available when CONFIG_SPARSEMEM=y on most > architectures. > > Initially DEFERRED_STRUCT_PAGE_INIT depended on explicit > ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT configuration option, but since the > commit 2e3ca40f03bb13709df4 ("mm: relax deferred struct page requirements") > this requirement was relaxed and now it is possible to enable > DEFERRED_STRUCT_PAGE_INIT on architectures that support DISCONTINGMEM and > NO_BOOTMEM which causes build failures. > > For instance, setting SMP=y and DEFERRED_STRUCT_PAGE_INIT=y on arc causes > the following build failure: > > CC mm/page_alloc.o > mm/page_alloc.c: In function 'update_defer_init': > mm/page_alloc.c:321:14: error: 'PAGES_PER_SECTION' > undeclared (first use in this function); did you mean 'USEC_PER_SEC'? > (pfn & (PAGES_PER_SECTION - 1)) == 0) { > ^~~~~~~~~~~~~~~~~ > USEC_PER_SEC > mm/page_alloc.c:321:14: note: each undeclared > identifier is reported only once for each function it appears in > In file included from include/linux/cache.h:5:0, > from include/linux/printk.h:9, > from include/linux/kernel.h:14, > from > include/asm-generic/bug.h:18, > from > arch/arc/include/asm/bug.h:32, > from include/linux/bug.h:5, > from include/linux/mmdebug.h:5, > from include/linux/mm.h:9, > from mm/page_alloc.c:18: > mm/page_alloc.c: In function 'deferred_grow_zone': > mm/page_alloc.c:1624:52: error: > 'PAGES_PER_SECTION' undeclared (first use in this function); did you mean > 'USEC_PER_SEC'? > unsigned long nr_pages_needed = ALIGN(1 << order, PAGES_PER_SECTION); > ^ > include/uapi/linux/kernel.h:11:47: note: in > definition of macro '__ALIGN_KERNEL_MASK' > #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) > ^~~~ > include/linux/kernel.h:58:22: note: in expansion > of macro '__ALIGN_KERNEL' > #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) > ^~~~~~~~~~~~~~ > mm/page_alloc.c:1624:34: note: in expansion of > macro 'ALIGN' > unsigned long nr_pages_needed = ALIGN(1 << order, PAGES_PER_SECTION); > ^~~~~ > In file included from > include/asm-generic/bug.h:18:0, > from > arch/arc/include/asm/bug.h:32, > from include/linux/bug.h:5, > from include/linux/mmdebug.h:5, > from include/linux/mm.h:9, > from mm/page_alloc.c:18: > mm/page_alloc.c: In function > 'free_area_init_node': > mm/page_alloc.c:6379:50: error: > 'PAGES_PER_SECTION' undeclared (first use in this function); did you mean > 'USEC_PER_SEC'? > pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, > ^ > include/linux/kernel.h:812:22: note: in definition > of macro '__typecheck' > (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) > ^ > include/linux/kernel.h:836:24: note: in expansion > of macro '__safe_cmp' > __builtin_choose_expr(__safe_cmp(x, y), \ > ^~~~~~~~~~ > include/linux/kernel.h:904:27: note: in expansion > of macro '__careful_cmp' > #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) > ^~~~~~~~~~~~~ > mm/page_alloc.c:6379:29: note: in expansion of > macro 'min_t' > pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, > ^~~~~ > include/linux/kernel.h:836:2: error: first > argument to '__builtin_choose_expr' not a constant > __builtin_choose_expr(__safe_cmp(x, y), \ > ^ > include/linux/kernel.h:904:27: note: in expansion > of macro '__careful_cmp' > #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) > ^~~~~~~~~~~~~ > mm/page_alloc.c:6379:29: note: in expansion of > macro 'min_t' > pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, > ^~~~~ > scripts/Makefile.build:317: recipe for target > 'mm/page_alloc.o' failed > > Let's make the DEFERRED_STRUCT_PAGE_INIT explicitly depend on SPARSEMEM as > the systems that support DISCONTIGMEM do not seem to have that huge > amounts of memory that would make DEFERRED_STRUCT_PAGE_INIT relevant. > > Signed-off-by: Mike Rapoport Thanks, I was running into that problem also. Tested-by: Randy Dunlap > --- > mm/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/Kconfig b/mm/Kconfig > index ce95491..94af022 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -635,7 +635,7 @@ config DEFERRED_STRUCT_PAGE_INIT > bool "Defer initialisation of struct pages to kthreads" > default n > depends on NO_BOOTMEM > - depends on !FLATMEM > + depends on SPARSEMEM > depends on !NEED_PER_CPU_KM > help > Ordinarily all struct pages are initialised during early boot in a > -- ~Randy