Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp857701imm; Fri, 29 Jun 2018 07:31:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIyDx7FkErgy/NvDAQEZp1FunoAsfvbgiV+IRFaM7ed81SPOoquhXnjCUYYYouvrYS+JWOk X-Received: by 2002:a65:6455:: with SMTP id s21-v6mr12446742pgv.394.1530282718985; Fri, 29 Jun 2018 07:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530282718; cv=none; d=google.com; s=arc-20160816; b=SKPhzKZ/m3/1g/vPjypUUO0swQzGjGFIY4fFEhLE1NNqWfoabZVXcx4L2vmM1fR30l PrwmKgkXzdiNlrRFAQkJRW0+poMb95eDoGfuL6Z4umdDjDodtA11za7eH6LBMT58+bnc TJ8zCnVabrKmFmilZdCMCkwHgLVdkFsd06WlrzUVy4hgUC9ZPV1luaPrR1TgeCuzm7eq CmrHgAUNShW2H5z2ggP8J6JA/ZyFUwLdMZMio/DauHW0GrHTlmyaPmTkO9m03ncdD7e2 Lm/3rRYvGJ8phP/V7PdK2KQA7JR0ypLKwcmIW/Q3yXJcuUy7goivCZ8sB+IYBwSsWN/J Wlxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=P4K09YLYeOb44ELcNhnjUbcdWQSaQr/BV7G/nBgNcdo=; b=G3NOcFJy4kh+0WGp2c3nZKqBuXm/OZXhZqqt5Nf9pnebK5nBej2d/kdjvqsnX6Ss5a omTUkqkkr9QivR4CQ7Ic6qcVDO1HRjl1PCKyWQd6NNh+HSMY75Bv5Ra3NC6QVYqCz6KU TPfq5fQsUz6Yi8r/+8L+AwYXpfwS27mU9L15RGkklKaOjrO8xWvjKlPufAStHnCilrFg tQ82pdql6PQOiMpyYHj1yv0Dpf1k+Cpy5BnwHnaASqodleUNfXBXYdQGp1lvPJK7KRrA +5gGohJtgDgwXhklojqnVLyJ+6uEjCsSGcLrEZhmXeBXqfSuqpt0njfOAzibW5tehyfA cbvA== 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 e95-v6si9354913plb.239.2018.06.29.07.31.44; Fri, 29 Jun 2018 07:31:58 -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 S966076AbeF2NsJ (ORCPT + 99 others); Fri, 29 Jun 2018 09:48:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:56082 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965397AbeF2NsI (ORCPT ); Fri, 29 Jun 2018 09:48:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D8FE2AFE8; Fri, 29 Jun 2018 13:48:06 +0000 (UTC) Date: Fri, 29 Jun 2018 15:48:06 +0200 From: Michal Hocko To: Mike Rapoport Cc: Andrew Morton , linux-mm , lkml Subject: Re: [PATCH] mm: make DEFERRED_STRUCT_PAGE_INIT explicitly depend on SPARSEMEM Message-ID: <20180629134806.GE5963@dhcp22.suse.cz> References: <1530279308-24988-1-git-send-email-rppt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530279308-24988-1-git-send-email-rppt@linux.vnet.ibm.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 29-06-18 16:35:08, 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. OK, I do not see any reasonable large machine would use DISCONTIGMEM. So this makes sense to me. > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > 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 > -- > 2.7.4 > -- Michal Hocko SUSE Labs