Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp889968ybv; Wed, 5 Feb 2020 16:42:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxKyAslmn3S6K0Z2iZ8nWL/wxKiiSVyY7DA584njNhwnH+pMXoa2mCrHujn2GnfRPkt009l X-Received: by 2002:a9d:7559:: with SMTP id b25mr27325264otl.189.1580949725829; Wed, 05 Feb 2020 16:42:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580949725; cv=none; d=google.com; s=arc-20160816; b=eKu4mktjgTEOQ2wVQTFMTLX/BW9zz/dCEgzyhZE2yuRrU5AORv5j4ZneKn/9gcnYjX ytrVY1UJYj4C8qCnETSy4fv/EjAJwd9gyDwzNoAG2GIxxhHIl5lbq2mNSyOTj7+54Fk3 HV4PhmoUMsor99/q8QOBFOQYNriGrkzvua0Nxi6FAOGHwUlCboBM2xAg/frV97f7pCvR 4PfZKFIjiw3X09ld3B/NF1BIzx58wggyIx/QTvMS+93kBgV2NOV7c7ih+MNAIv8JIfS4 tjqXOSpb+FglmRRSbyIUCMszLE1+TcROzxqNDoAD7kGvaJmrEk48jMkfjVBoT9qAaKRl xI+w== 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:dkim-signature; bh=8Z6nE63gkylXxznMu19+y8UaaSgJhxKrGIJf/yXmjUY=; b=XuHShCRdV1Bvowzsu8KzmhkNBNWRLz4Val+nMIbT47zkxGPaN1ABTGZDQ0RA8AuDG9 Cdt24itj5ZGA5OVH6/ggdkoA8Qqd6+9RLCxqL/8nRHgkMfoDOiSbgJaFkNaYkhFZ+fKw wlzxZBHq4IrIg8wlESXSxfFYa46pefVR+Ood/AS0rdrM9/qpLRgxcPeDh3TFx57h91wr 7XWZBEz72i93ZvEQNWmx1aPs9l3PtLrWXBslleZlVM0AnqviRQG2gMwFmT5FGbN4E9Hf VcALNmOBgGhFtx7Sjb7ee0WHNUaW1M/qSmzCQxqdlvGDplv4EwDanBWA5Z9ysD8vC/9G IXTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BDmKe+3q; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si849959otp.147.2020.02.05.16.41.51; Wed, 05 Feb 2020 16:42:05 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=BDmKe+3q; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727491AbgBFAht (ORCPT + 99 others); Wed, 5 Feb 2020 19:37:49 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:34297 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727306AbgBFAhs (ORCPT ); Wed, 5 Feb 2020 19:37:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580949468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8Z6nE63gkylXxznMu19+y8UaaSgJhxKrGIJf/yXmjUY=; b=BDmKe+3qGBwa3hnRvSSeVlTDycXwKtIadDuZWOpimaQzKvndThSp6H5pHKqDuoR24CjlqU JitoUmFJRd3+M4Vc6P0DTGAv95ipDOWLFjU3ZsAOcIk3H/90PUhFT2v531xOhdiBYovhUA ZpQJRhbJ44zeBkSJNSRoVcrkWiK00eU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-fQOd-l-lNTSkXVrIatLn2g-1; Wed, 05 Feb 2020 19:37:44 -0500 X-MC-Unique: fQOd-l-lNTSkXVrIatLn2g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 935B11005513; Thu, 6 Feb 2020 00:37:42 +0000 (UTC) Received: from localhost (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77E9D60BF7; Thu, 6 Feb 2020 00:37:39 +0000 (UTC) Date: Thu, 6 Feb 2020 08:37:36 +0800 From: Baoquan He To: Wei Yang Cc: David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Segher Boessenkool , Andrew Morton , Michal Hocko , Oscar Salvador Subject: Re: [PATCH v1] mm/memory_hotplug: Easier calculation to get pages to next section boundary Message-ID: <20200206003736.GI8965@MiWiFi-R3L-srv> References: <20200205135251.37488-1-david@redhat.com> <20200205231945.GB28446@richard> <20200205235007.GA28870@richard> <20200206001317.GH8965@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200206001317.GH8965@MiWiFi-R3L-srv> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/06/20 at 08:13am, Baoquan He wrote: > On 02/06/20 at 07:50am, Wei Yang wrote: > > On Thu, Feb 06, 2020 at 07:19:45AM +0800, Wei Yang wrote: > > >On Wed, Feb 05, 2020 at 02:52:51PM +0100, David Hildenbrand wrote: > > >>Let's use a calculation that's easier to understand and calculates the > > >>same result. Reusing existing macros makes this look nicer. > > >> > > >>We always want to have the number of pages (> 0) to the next section > > >>boundary, starting from the current pfn. > > >> > > >>Suggested-by: Segher Boessenkool > > >>Cc: Andrew Morton > > >>Cc: Michal Hocko > > >>Cc: Oscar Salvador > > >>Cc: Baoquan He > > >>Cc: Wei Yang > > >>Signed-off-by: David Hildenbrand > > > > > >Reviewed-by: Wei Yang > > > > > >BTW, I got one question about hotplug size requirement. > > > > > >I thought the hotplug range should be section size aligned, while taking a > > >look into current code function check_hotplug_memory_range() guard the range. > > A good question. The current code should be block size aligned. I > remember in some places we assume each block comprise all the sections. > Can't imagine one or some of them are half section filled. I could be wrong, half filled block may not cause problem. > > It truly has a risk that system ram is very huge to make the block > size is 2G, someone try to insert a 1G memory board. However, it should > only exist in experiment environment, e.g build a guest with enough ram, > then hot add 1G DIMM. In reality, we don't need to worry about it, at > least what I saw is 512G order of magnitude. > > > > > > >This function says the range should be block_size aligned. And if I am > > >correct, block size on x86 should be in the range > > > > > > [MIN_MEMORY_BLOCK_SIZE, MEM_SIZE_FOR_LARGE_BLOCK] > > > > > >And MIN_MEMORY_BLOCK_SIZE is section size. > > No, if I got it right, the range on x86 is > [MIN_MEMORY_BLOCK_SIZE, MAX_BLOCK_SIZE]. > > MEM_SIZE_FOR_LARGE_BLOCK is the starting point from which block size can > be adjusted. Otherwise it's MIN_MEMORY_BLOCK_SIZE. > > /* Amount of ram needed to start using large blocks */ > #define MEM_SIZE_FOR_LARGE_BLOCK (64UL << 30) > > > > > > >Seems currently we support subsection hotplug? Then how a subsection range got > > >hotplug? Or this patch is a pre-requisite? > > The sub-section hotplug feature was added by your colleague Dan > Williams. It intends to fix a nvdimms issue that nvdimms device could be > mapped into a non section size aligned starting address. And nvdimms > makes use of the existing memory hotplug mechanism to manage pages. > Not sure if we are saying the same thing. > > > > > > > > One more question is we support hot-add subsection memory but not support > > hot-online subsection memory. > > > > Is my understanding correct? > > > > -- > > Wei Yang > > Help you, Help me > >