From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3E0DC35DF5 for ; Tue, 25 Feb 2020 10:03:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9017D21744 for ; Tue, 25 Feb 2020 10:03:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9017D21744 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 222F86B0003; Tue, 25 Feb 2020 05:03:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FA526B0005; Tue, 25 Feb 2020 05:03:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 111DE6B0006; Tue, 25 Feb 2020 05:03:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id EEBBB6B0003 for ; Tue, 25 Feb 2020 05:03:54 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BD05437F1 for ; Tue, 25 Feb 2020 10:03:54 +0000 (UTC) X-FDA: 76528213188.03.alley82_4fd9902c8f58 X-HE-Tag: alley82_4fd9902c8f58 X-Filterd-Recvd-Size: 4463 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Feb 2020 10:03:54 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id u6so13991964wrt.0 for ; Tue, 25 Feb 2020 02:03:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=J5sz8+yP/6v8aTbTC8x2kZvJpVVQE6WGcOOQCZp7IGA=; b=ldi6uZLjdW9hTct7YeNG1rvzPhVbVIbPiYGZN6cHiu7PNIR5qNGs24P15vmcsGH2Z2 Sz7BIifBPizDubLtiGOfGUqZIr961HFfGFsGmZ49CmR+WATPoVZTnP9Ud7CwS0M1I+wF hfRbjCAdCXvQP5O+vbvmargwIt1JD8leQnO4A27WDxzhNOR+P0Rq3soRQ2gC59O1If/Z Y3NrRP6iyAZ03zDb8YkY4UoinUlAt2dwwat0mhqhsuqvwbRD/tN7PA0xcZq0g4KDOFGT gJ9H3D+cb6dpeSXj09PQTSDn3nl9YTHvB7pJNy47BgPlun8sbUvXEhZbM+Zs48J28nY0 glVw== X-Gm-Message-State: APjAAAW4NJwud0asd+mXNF3qL9Ix+pSD0ZVKwRFAsEoMII60QdAy0oVk Ww85Rp/4bfNN+RlhrHZJTPU= X-Google-Smtp-Source: APXvYqyFr5546l3wp5CiUlxS7XTkzokuV9gkuAos6nPjQfHymkckcp313EWNWoGbu0G328zdI7DHdA== X-Received: by 2002:adf:cd03:: with SMTP id w3mr73494632wrm.191.1582625033174; Tue, 25 Feb 2020 02:03:53 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id n13sm3612685wmd.21.2020.02.25.02.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 02:03:52 -0800 (PST) Date: Tue, 25 Feb 2020 11:03:52 +0100 From: Michal Hocko To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, richardw.yang@linux.intel.com, david@redhat.com, osalvador@suse.de, dan.j.williams@intel.com, rppt@linux.ibm.com, robin.murphy@arm.com Subject: Re: [PATCH v2 0/7] mm/hotplug: Only use subsection map in VMEMMAP case Message-ID: <20200225100352.GN22443@dhcp22.suse.cz> References: <20200220043316.19668-1-bhe@redhat.com> <20200220103849.GG20509@dhcp22.suse.cz> <20200221142847.GG4937@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200221142847.GG4937@MiWiFi-R3L-srv> 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: On Fri 21-02-20 22:28:47, Baoquan He wrote: > On 02/20/20 at 11:38am, Michal Hocko wrote: > > On Thu 20-02-20 12:33:09, Baoquan He wrote: > > > Memory sub-section hotplug was added to fix the issue that nvdimm could > > > be mapped at non-section aligned starting address. A subsection map is > > > added into struct mem_section_usage to implement it. However, sub-section > > > is only supported in VMEMMAP case. > > > > Why? Is there any fundamental reason or just a lack of implementation? > > VMEMMAP should be really only an implementation detail unless I am > > missing something subtle. > > Thanks for checking. > > VMEMMAP is one of two ways to convert a PFN to the corresponding > 'struct page' in SPARSE model. I mentioned them as VMEMMAP case, or > !VMEMMAP case because we called them like this previously when reviewed > patches, hope it won't cause confusion. > > Currently, config ZONE_DEVICE depends on SPARSEMEM_VMEMMAP. The > subsection_map is added to struct mem_section_usage to track which sub > section is present, VMEMMAP fills those bits which corresponding > sub-sections are present, while !VMEMMAP, namely classic SPARSE, fills > the whole map always. > > As we know, VMEMMAP builds page table to map a cluster of 'struct page' > into the corresponding area of 'vmemmap'. Subsection hotplug can be > supported naturally, w/o any change, just map needed region related to > sub-sections on demand. For !VMEMMAP, it allocates memmap with > alloc_pages() or vmalloc, thing is a little complicated, e.g the mixed > section, boot memory occupies the starting area, later pmem hot added to > the rear part. > > About !VMEMMAP which doesn't support sub-section hotplog, Dan said > it's more because the effort and maintenance burden outweighs the > benefit. And the current 64 bit ARCHes all enable > SPARSEMEM_VMEMMAP_ENABLE by default. OK, if this is the primary argument then make sure to document it in the changelog (cover letter). -- Michal Hocko SUSE Labs