From patchwork Fri Jun 29 13:35:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10496581 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 6FF5360325 for ; Fri, 29 Jun 2018 13:35:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DFCC28F59 for ; Fri, 29 Jun 2018 13:35:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 510D829065; Fri, 29 Jun 2018 13:35:25 +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 B30BF28F59 for ; Fri, 29 Jun 2018 13:35:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9454B6B0007; Fri, 29 Jun 2018 09:35:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8F2286B0008; Fri, 29 Jun 2018 09:35:23 -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 7BC2C6B0010; Fri, 29 Jun 2018 09:35:23 -0400 (EDT) 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 1B1466B0007 for ; Fri, 29 Jun 2018 09:35:23 -0400 (EDT) Received: by mail-ed1-f72.google.com with SMTP id l17-v6so2224487edq.11 for ; Fri, 29 Jun 2018 06:35:23 -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:from:to:cc :subject:date:message-id; bh=Dza+0xvNAnsae98WqH8VWJ3OoUeuSCpu+gijhH1nOKc=; b=dfHE4XgsyI81tUarXgE22iuA6XxUQoZ9TmQNuUrox2/7LjMsK/lLQIq9ksgynmdIA0 JYuzm3fLo5ocJRox6QPLbTGY7h5cU+7wczBKDt16oCXUxicdBKsds7mjP3TaJNW+u4JM k7TeYKOhG9lJUKu8gndoKNqoD8+tKX1jupL2QEKt0l819c60D168dW30lW6ysWnZvZfY lIARnc0SoQZGxmepej7t6UU3uT+15ATY2myLNfZRprh+SgX2VlJCy6az8hGCqInRWiRG rVWLHf6Ne5RXzknY0zv8UEjtIn6kFDknOd279OE5ezw4EVYV7C4mJ3p7WFIf+/wlACqZ HnsA== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: APt69E34dk9ZqTstlo7ELSHEp95kMnzWBqqBRKKbIdqMtMoKnuojMiA2 U/Fmk+cGQeL0+IZQhKTdowWcGoJYvUMcnOZAWs+RxlPjlqcKNZJPeRPz5G9+rN1K5JdJ6DRUNu2 uawwoCoVW+t40oY+Dl8VRKXS88MBAVSlTUJm9/aboJd/Lw1jZedsPKheLTQTVqh0= X-Received: by 2002:a50:8f86:: with SMTP id y6-v6mr13055112edy.290.1530279322594; Fri, 29 Jun 2018 06:35:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeRmLfa2gnSJ1eXmdw+uWg11I9hF3IA3u5Fyp2UM/3AGZnXzylgKniFFbWE90qV1eYst9Zi X-Received: by 2002:a50:8f86:: with SMTP id y6-v6mr13055065edy.290.1530279321795; Fri, 29 Jun 2018 06:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530279321; cv=none; d=google.com; s=arc-20160816; b=TU91UaPGc8dCG3hMhBgI13DdR9jvoN/N4Rq/l5moTKc98QBN9RQrHgZ4p/uev94His Lg8oJzU2syudEKyJ24VNimCkG/LzrJQX3E9ecfSPgVhVhxpMBMDEVfi6quviWUVghuvq zY3X4rbtt3kHwBIABM2vlBfJ2LOzdzTmcknL0hNZW+g/oTEzPWRc+4kyP2WaLoBqmqBo bxWWN+AuMxo51cOau5CK6FAw36xqCC4/M0O5bJTO+Cj238rYrnJOjHZua2r4meG/a7Di yzUY4U3gv0Bij20fyzGdWyCMOFD/RZ4dqDjp+IpKRUSynsi5POYi6DldUbOFBum4B2hp cfug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=Dza+0xvNAnsae98WqH8VWJ3OoUeuSCpu+gijhH1nOKc=; b=rFlP3/wQ6MXjAOK6OP/4X7Vz41WW+dr8GpJ92Y7sOsA96qut1zGvc8mr3bBeLJSFMR r7Wa888rqxTPTo6e4DCZmuwpR+9M7XuIQYCgc3Y/mfKN2XBvrpmR3QYF4nrFAGuEFHQD +FyOoG5ySZfW2K5B4jE39WJG2jRysIVjnJoSnbvAzelUgynn8APA4ohdpLVL8SyKEs25 PkTHvvmBqiMeeNjiCZc/ZXEs8cLEEAq8gShh8SDezMoYFL7l+w3RHqB/Jw6VJbpz/40q Ov4DQsdnos2qs+PpNwqWYRaIV3Z2TonrEw2mrKNKCabsOH5uwhpPe4B+xNZZRacwsfJ9 lSmA== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id u18-v6si3518821edm.16.2018.06.29.06.35.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 06:35:21 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5TDXxFV010802 for ; Fri, 29 Jun 2018 09:35:19 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jwmymt84h-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 29 Jun 2018 09:35:19 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Jun 2018 14:35:17 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 29 Jun 2018 14:35:14 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5TDZDFE29163696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 29 Jun 2018 13:35:13 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78B3011C058; Fri, 29 Jun 2018 14:35:01 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EB64611C04A; Fri, 29 Jun 2018 14:34:59 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.207.81]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 29 Jun 2018 14:34:59 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 29 Jun 2018 16:35:10 +0300 From: Mike Rapoport To: Andrew Morton Cc: Michal Hocko , linux-mm , lkml , Mike Rapoport Subject: [PATCH] mm: make DEFERRED_STRUCT_PAGE_INIT explicitly depend on SPARSEMEM Date: Fri, 29 Jun 2018 16:35:08 +0300 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18062913-0016-0000-0000-000001E19467 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062913-0017-0000-0000-00003235DFB4 Message-Id: <1530279308-24988-1-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-29_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806290146 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 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 Acked-by: Michal Hocko Reviewed-by: Pavel Tatashin 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