Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp803131imm; Mon, 9 Jul 2018 10:54:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc/NGmf3jr34U2Rw1sLUdq/P9a+ZWIuCwq/WvP7c/RHR0K+HYpNAWrr1Szej5f/CFo6oECz X-Received: by 2002:a65:6397:: with SMTP id h23-v6mr19688995pgv.380.1531158895546; Mon, 09 Jul 2018 10:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531158895; cv=none; d=google.com; s=arc-20160816; b=SsCN8yHO/fpPzftbMnmyleOy+hbkvtDOkBm4AIMuijEbCRd8mIZNo40UpDMa3KzaCt Tz5i3Jdebv+NRkhfxfRZUWtwC7ACfPPJzmaRRC26J3+34GS1f4WGylqCde6H3arYiYLF +a2QN9jtIayGU7Q+9EzbfeC6rXy/0MyEvFjiV3hANz3Kb01Tjn5Ox1mEv94PP0c9H/Un y1QGi32J6aOWI20+FJDK/4CmmQrE0pe830aKMv/f5YYaIsHgcN8NonHFgQY6SNQnVig9 QiHWK9MmIOCgy7x8+uB2WOpdFD6a4Z6lCm3keQbkmpEwUZ0/w1K+vRzqGoLwQXgLU8GN ARLg== 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=rkF/W5l1f2hdV/PoCWSS0R+d/IojjDnfRdW+MLhPT/M=; b=wFJsTjayfXZ1P/1uY93SejLMOGd+/giF8lyLAaZ5hVonfcZW3zgBqxvJT+ozvRWsFL 7eklasNv7zE+aj/X57aHnMsMqmMbTIYqYiKcaFWCxRnJNdA2MfzfT18SCsUkfHDWxn1e j6qfFfmxSSUCBxaLO55Cv3ztgLoU7LO+sxKg7aMe7QIyAwkd7rdPSTUn8GGcQcJ0oMOc H9Y1DfAPartXxPSPAV1BplVmMcn3bgg1KmDd4P/4RoIRujWIpKfzvHpnQ4m6dYVYe3fD Tkgte6mf1lPKPRhpcH90UVcAkzjkYklmZLYu6Z78JNgZaRUIFXQId9lK7PqR7aFTEvB4 UxSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=A9TrHeyt; 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 c21-v6si3693960pls.407.2018.07.09.10.54.41; Mon, 09 Jul 2018 10:54:55 -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-2018-07-02 header.b=A9TrHeyt; 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 S934101AbeGIRx6 (ORCPT + 99 others); Mon, 9 Jul 2018 13:53:58 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:57078 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933744AbeGIRxw (ORCPT ); Mon, 9 Jul 2018 13:53:52 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w69Hn1IM062605; Mon, 9 Jul 2018 17:53:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id; s=corp-2018-07-02; bh=rkF/W5l1f2hdV/PoCWSS0R+d/IojjDnfRdW+MLhPT/M=; b=A9TrHeytp0fNX+UWGVJkTOn4+d7u0OhxSDDBfVL67T+0UrelgMfv1//j8O4Y8sKJuvTJ NZLxJG1rHIuM1XxzTvktgMjbbn9dLFG64uxN537JOP5Z/9jIRlLERe5w0pslJhexsxEZ 24sxO0cLQk+ZZDVctMWCkoZod1M+H+9kmkaThektwH1OTm7DqpH1gaToxcr2hcKir1pt 2QQVRl8OMBAdDJAF1sYdWbNOkXyBsQo+dZLgxwuKwu8hwpEoaeZj7Ny0ONhZM2naPZPs sFcmRVj3VZkNzCePa744wHfbTKL3WyIIYWb1WxwEM8FMa20TMaoKAz9peyV+oTKkfvvX ng== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2k2p75wa3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Jul 2018 17:53:23 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w69HrMG3006202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Jul 2018 17:53:22 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w69HrK5a001968; Mon, 9 Jul 2018 17:53:20 GMT Received: from xakep.us.oracle.com (/10.154.140.248) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Jul 2018 10:53:19 -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 v4 0/3] sparse_init rewrite Date: Mon, 9 Jul 2018 13:53:09 -0400 Message-Id: <20180709175312.11155-1-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8949 signatures=668705 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=515 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807090202 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changelog: v4 - v3 - Addressed comments from Dave Hansen v3 - v1 - Fixed two issues found by Baoquan He 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 (3): mm/sparse: add sparse_init_nid() mm/sparse: start using sparse_init_nid(), and remove old code mm/sparse: refactor sparse vmemmap buffer allocations include/linux/mm.h | 13 +- mm/sparse-vmemmap.c | 111 ++++++++++------- mm/sparse.c | 281 +++++++++++++++----------------------------- 3 files changed, 170 insertions(+), 235 deletions(-) -- 2.18.0