Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1194224ybi; Sat, 15 Jun 2019 23:08:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9QZfe0uFBC7+w5vgepdw88RxmEjUGliUPD4qBDr1cv4QB93RKJzQ3Rg8cXY2Q6TIWZso+ X-Received: by 2002:a17:90a:2561:: with SMTP id j88mr19750725pje.121.1560665316269; Sat, 15 Jun 2019 23:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560665316; cv=none; d=google.com; s=arc-20160816; b=JHFPNzqvoiIax1KYm4EGRx1tReBLuPCKFLfofIoD9jLuhPzfvGFM221MdBSaoOaocO zys79AqPNphqQp24J0BqkQAPsYTV29dIxB79KiQD7qylzdVmMY2P7SGo3xu6X1oDf6ci DY3e+fg1WQbWXHcJZKaGmTIXRVPCmo31s0w6G294bpz6mSXHA9ltBdAIDQtGXXPbpjRK BBJpjJP4SLuZlX3GchzbKL33kJDGM/N34hNawi+CdTSBN+eatjrmCADWnl5wMOY8Es/6 XizAHRVE48AkQOJPIKY1mb3S7zpUhrpAbhGfyiloSWy4WLlJDnnGHOoI5Z/N1e9mXHYx MeHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from; bh=dGjhz4aQzyD59eRLNizOYahJSu+PAkI6ueO7uaOQLME=; b=bugqN5+RvE52zk/1VQOgU/GD9l9W+RPMMyp14gGhiZcGfi+qNbKtgnjtFohy3JMCbF 2MtOQR0mGT9a4baToEUm8F4zrLsSY3/vSXD9BvY+JDwLzkpTVfncJs6hsTgmWl0kmWcM xbJEVjAEDcMvjfjWwklCTjeHsGhM3SJ6H/d/RnDQAMC63gDJnsH5OufR8rjN3yfot2ob BPt9Fg4lzA8sjQlsrCB/sHvyGoQ6bq++RJX4+yqMMwcVUODXf/oeuyVdZMjF+MVDcZhU EwsK3hpB3b11modI6RxRxioY2mm3LTk6An86inqtG4+1KwEXGQBteoKKUf3O3zu4AtPX Tvgw== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si6621828pls.52.2019.06.15.23.07.50; Sat, 15 Jun 2019 23:08:36 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725914AbfFPGHA (ORCPT + 99 others); Sun, 16 Jun 2019 02:07:00 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51812 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbfFPGHA (ORCPT ); Sun, 16 Jun 2019 02:07:00 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5G66beU058610 for ; Sun, 16 Jun 2019 02:06:58 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t5drtkncy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 16 Jun 2019 02:06:58 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 16 Jun 2019 07:06:56 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 16 Jun 2019 07:06:53 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5G66qk146596116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Jun 2019 06:06:52 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6DDACAE04D; Sun, 16 Jun 2019 06:06:52 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 12D30AE045; Sun, 16 Jun 2019 06:06:50 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.85.86.48]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sun, 16 Jun 2019 06:06:49 +0000 (GMT) X-Mailer: emacs 26.2 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: Dan Williams , akpm@linux-foundation.org Cc: Michal Hocko , David Hildenbrand , Logan Gunthorpe , Oscar Salvador , Pavel Tatashin , linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, osalvador@suse.de, mhocko@suse.com Subject: Re: [PATCH v9 04/12] mm/sparsemem: Convert kmalloc_section_memmap() to populate_section_memmap() In-Reply-To: <155977189139.2443951.460884430946346998.stgit@dwillia2-desk3.amr.corp.intel.com> References: <155977186863.2443951.9036044808311959913.stgit@dwillia2-desk3.amr.corp.intel.com> <155977189139.2443951.460884430946346998.stgit@dwillia2-desk3.amr.corp.intel.com> Date: Sun, 16 Jun 2019 11:36:47 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 19061606-0008-0000-0000-000002F42096 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061606-0009-0000-0000-000022612EA1 Message-Id: <8736kahxmw.fsf@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-16_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1810050000 definitions=main-1906160060 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Williams writes: > Allow sub-section sized ranges to be added to the memmap. > populate_section_memmap() takes an explict pfn range rather than > assuming a full section, and those parameters are plumbed all the way > through to vmmemap_populate(). There should be no sub-section usage in > current deployments. New warnings are added to clarify which memmap > allocation paths are sub-section capable. > > Cc: Michal Hocko > Cc: David Hildenbrand > Cc: Logan Gunthorpe > Cc: Oscar Salvador > Reviewed-by: Pavel Tatashin > Signed-off-by: Dan Williams > --- > arch/x86/mm/init_64.c | 4 ++- > include/linux/mm.h | 4 ++- > mm/sparse-vmemmap.c | 21 +++++++++++------ > mm/sparse.c | 61 +++++++++++++++++++++++++++++++------------------ > 4 files changed, 57 insertions(+), 33 deletions(-) > > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > index 8335ac6e1112..688fb0687e55 100644 > --- a/arch/x86/mm/init_64.c > +++ b/arch/x86/mm/init_64.c > @@ -1520,7 +1520,9 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, > { > int err; > > - if (boot_cpu_has(X86_FEATURE_PSE)) > + if (end - start < PAGES_PER_SECTION * sizeof(struct page)) > + err = vmemmap_populate_basepages(start, end, node); > + else if (boot_cpu_has(X86_FEATURE_PSE)) > err = vmemmap_populate_hugepages(start, end, node, altmap); > else if (altmap) { > pr_err_once("%s: no cpu support for altmap allocations\n", Can we move this to another patch? I am wondering what the x86 behaviour here is? If the range is less that PAGES_PER_SECTION we don't allow to use pmem as the map device? We sliently use memory range? -aneesh