Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1477142imm; Fri, 29 Jun 2018 20:14:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdBMkkLHuWma8TW1lH0nKiv/6fCJg8LDXav9SZOsE0wEtwIzHNJO3lZ/YH7SWw3Lz9PNDiB X-Received: by 2002:a62:9c17:: with SMTP id f23-v6mr7089386pfe.209.1530328479478; Fri, 29 Jun 2018 20:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530328479; cv=none; d=google.com; s=arc-20160816; b=bKRIps/00g/FDnqAVlD519XChvxALSwpe2A3rwTzDrHGgTNuhwEsOvJkSk09TBJl/e BcwHYzqnXlZ6zpbPJ3yX8rfDaCdBKEqZQsADtgchfU4Im1+YpBUTyUUieeAlxa05a70g JuaYQADvVwUDmyhRbBXH8tNg0VQneYLG8pSZ1YrHZNniUPxp+dcjwZf2AVb7F4Nc+R7M 6WtFrJR210as1pNM5V5fx8dHHH8nbm73Cn7GQLv5C7C1ouUno4T3Cj6SG5lZ5Kd1n8p6 5W9t1E/UTPaxJeOO5CsM0r2WJz6r/v8nzDyQNPFjefAhQR5uW8CrAsW8lIBqUMcm7pyr MSVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=enl21a6cSef3u6SMrHH8UYUZ7K0TQ9x9/lq7jwNHeds=; b=OR5eAEgEWBVdCtlzW1YcjYACv3vpEYymXJMXK/3s55Uq+M3M6+1KRrnUdl2+WmBaxk qmMiUHbRe9PM/Wyfyp9ZMLjS+x8FUVokCmsH3h3jwPT/ibKThmXpI+NxGqCJbLXXYqd1 VE/D1wQ9ruQeAXOD+ITqXOPbgaBDlznxqQ8KiRPkJbe9P82ev+hs1RNmrTqV1sjZWa9e 0KM0QNa6BzHwsggjwhsabo+/VCb8EYNRoitwJJn1bOP/i9CyQ1BcyzoxZWPauj46Po0P D0WxGVZTf/6P4qOwGEMzNWXVX2RSKOAoICqocalzyVvx5F92yLeyrCm59MKcuqVqkSWO KTYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Wo30ILA6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si10358177plx.351.2018.06.29.20.14.25; Fri, 29 Jun 2018 20:14:39 -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=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Wo30ILA6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755283AbeF3DKY (ORCPT + 99 others); Fri, 29 Jun 2018 23:10:24 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:60966 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755141AbeF3DKW (ORCPT ); Fri, 29 Jun 2018 23:10:22 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5U39F5x056000; Sat, 30 Jun 2018 03:09:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id; s=corp-2017-10-26; bh=enl21a6cSef3u6SMrHH8UYUZ7K0TQ9x9/lq7jwNHeds=; b=Wo30ILA6kjcemDuBkGlihLbES+7aODRj7iddlpXYQ9agtLLeVqUXsjMs2CqY8c1h8sLR ublrX/z7k1+SpJUMptQ+su79RUNecxs3V1xLkEfQujK7kn5QI/KYBhL5UbV5IjgWSb0u +LLkwQFXIcJgXqZgDmBv9BunKmHsO5s4msnkUDLptznWr1rKJrQZhZ7HTMwp6NPW8hWh 8E5kA7Un3LYzC8Bef1Spo40I67k1s6cx+1DOxfVQTx4wQ23hOkq3Rp0BnmV/779blYJ8 rND0sm5jZvQlxdE3gkX1w6vv/HFm5ZjCTOafXjZogt6/JjGu5OHSgKHNASdErx4pl5P0 UQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2jwyccg475-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 30 Jun 2018 03:09:53 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5U39qBt023970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 30 Jun 2018 03:09:52 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5U39o06010427; Sat, 30 Jun 2018 03:09:50 GMT Received: from localhost.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 29 Jun 2018 20:09:50 -0700 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, mhocko@suse.com, linux-mm@kvack.org, dan.j.williams@intel.com, jack@suse.cz, jglisse@redhat.com, jrdr.linux@gmail.com, bhe@redhat.com, gregkh@linuxfoundation.org, vbabka@suse.cz, richard.weiyang@gmail.com, dave.hansen@intel.com, rientjes@google.com, mingo@kernel.org, osalvador@techadventures.net, pasha.tatashin@oracle.com Subject: [PATCH v2 0/2] sparse_init rewrite Date: Fri, 29 Jun 2018 23:09:42 -0400 Message-Id: <20180630030944.9335-1-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8939 signatures=668703 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=548 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806300033 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changelog: v1 - v2 - Addressed comments from Oscar Salvador In sparse_init() we allocate two large buffers to temporary hold usemap and memmap for the whole machine. However, we can avoid doing that if we changed sparse_init() to operated on per-node bases instead of doing it on the whole machine beforehand. As shown by Baoquan http://lkml.kernel.org/r/20180628062857.29658-1-bhe@redhat.com The buffers are large enough to cause machine stop to boot on small memory systems. These patches should be applied on top of Baoquan's work, as CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER is removed in that work. For the ease of review, I split this work so the first patch only adds new interfaces, the second patch enables them, and removes the old ones. Pavel Tatashin (2): mm/sparse: add sparse_init_nid() mm/sparse: start using sparse_init_nid(), and remove old code include/linux/mm.h | 9 +- mm/sparse-vmemmap.c | 44 ++++--- mm/sparse.c | 282 +++++++++++++++----------------------------- 3 files changed, 125 insertions(+), 210 deletions(-) -- 2.18.0