Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8416830ybi; Thu, 6 Jun 2019 11:59:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuSDxx+BhqjiKex3C7U2xRJX3itDyS1lmhT9T5Nc+W8b16Sy3LgoWFuOmYOxmI5/MoAiOa X-Received: by 2002:a63:2ace:: with SMTP id q197mr49525pgq.102.1559847554196; Thu, 06 Jun 2019 11:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559847554; cv=none; d=google.com; s=arc-20160816; b=RQE2W3At72qstKIU1odu12+sOs30pYnBWabJbEhAmJJXfNnBxCdxPtvAaZK8e0UeBZ +h4cuX0izkx26BsDMaG74ppGQaQZr9XSLzKXX5NEP/AoJjYFLVGMqm1GwTCMT8wOQdFP CEN00nk+O6rfdJ7Qio1s1ruJdf+7MJe0s2/1sAJA6jx1kKfxa1/u5yqKnSGeMVnbI+ks uhjr0F/3hxUnEBvUWbwMrMIIqr4RR9fn69ZZWyH40b23Rxo66g+zrnG2/+AWYCFYZ0S8 OMCR940XFU2+issI6K9fOKngEuX/AGGRQVhZY+i6KFJk6moIoqgjG732Rg8H28WEOxVq zH+Q== 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; bh=cTbjYsgfPkBw+OSP89oA34euB64GQm4IFp6zD1ZV1KE=; b=dD6WjM7zdemQsHp0xpI4i4XKy2X+gaucrh5tOsV22A23E318zUxHv3rLZefA7k41P3 VXhXUtzIJ5CohIyc2atXZwjHjAzTpB95arlbEmH6sXu3tVvkgv8pAk6MKq8WWaaXTdNz 3obgE2cTOxMQ/GzT/Z9PMs/vmEQIMaP3B9vJ3nmMrfB39jO9RTI8oaCt/5WX5Q4oiiM+ 9zmz3iItC9uvYj/qISY4m8oLALFLh4Oja1AmAuFr2MKLIphIqLXsHQXAx9Pta78TJ3Q3 wG/LTyimWuD1V6HxsCRsdNd72dpRRR4MC8TwTXw/oaclwT+DMqx/BxTdrLmMU/vunsq8 MdYA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si2497344pgp.568.2019.06.06.11.58.57; Thu, 06 Jun 2019 11:59:14 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730158AbfFFReZ (ORCPT + 99 others); Thu, 6 Jun 2019 13:34:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:33886 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726924AbfFFReZ (ORCPT ); Thu, 6 Jun 2019 13:34:25 -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 5384EAE4D; Thu, 6 Jun 2019 17:34:24 +0000 (UTC) Date: Thu, 6 Jun 2019 19:34:21 +0200 From: Oscar Salvador To: Dan Williams Cc: akpm@linux-foundation.org, Michal Hocko , Vlastimil Babka , Logan Gunthorpe , Pavel Tatashin , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 01/12] mm/sparsemem: Introduce struct mem_section_usage Message-ID: <20190606173421.GD31194@linux> References: <155977186863.2443951.9036044808311959913.stgit@dwillia2-desk3.amr.corp.intel.com> <155977187407.2443951.16503493275720588454.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <155977187407.2443951.16503493275720588454.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 05, 2019 at 02:57:54PM -0700, Dan Williams wrote: > Towards enabling memory hotplug to track partial population of a > section, introduce 'struct mem_section_usage'. > > A pointer to a 'struct mem_section_usage' instance replaces the existing > pointer to a 'pageblock_flags' bitmap. Effectively it adds one more > 'unsigned long' beyond the 'pageblock_flags' (usemap) allocation to > house a new 'subsection_map' bitmap. The new bitmap enables the memory > hot{plug,remove} implementation to act on incremental sub-divisions of a > section. > > The default SUBSECTION_SHIFT is chosen to keep the 'subsection_map' no > larger than a single 'unsigned long' on the major architectures. > Alternatively an architecture can define ARCH_SUBSECTION_SHIFT to > override the default PMD_SHIFT. Note that PowerPC needs to use > ARCH_SUBSECTION_SHIFT to workaround PMD_SHIFT being a non-constant > expression on PowerPC. > > The primary motivation for this functionality is to support platforms > that mix "System RAM" and "Persistent Memory" within a single section, > or multiple PMEM ranges with different mapping lifetimes within a single > section. The section restriction for hotplug has caused an ongoing saga > of hacks and bugs for devm_memremap_pages() users. > > Beyond the fixups to teach existing paths how to retrieve the 'usemap' > from a section, and updates to usemap allocation path, there are no > expected behavior changes. > > Cc: Michal Hocko > Cc: Vlastimil Babka > Cc: Logan Gunthorpe > Cc: Oscar Salvador > Cc: Pavel Tatashin > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Signed-off-by: Dan Williams Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE L3