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=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 3B912C352A2 for ; Wed, 5 Feb 2020 23:49:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D295320730 for ; Wed, 5 Feb 2020 23:49:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D295320730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 46F356B0003; Wed, 5 Feb 2020 18:49:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F88B6B0005; Wed, 5 Feb 2020 18:49:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C1B56B0006; Wed, 5 Feb 2020 18:49:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id 1051B6B0003 for ; Wed, 5 Feb 2020 18:49:56 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C3BC7180AD804 for ; Wed, 5 Feb 2020 23:49:55 +0000 (UTC) X-FDA: 76457718750.29.waves08_56a02e783d957 X-HE-Tag: waves08_56a02e783d957 X-Filterd-Recvd-Size: 3101 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 5 Feb 2020 23:49:55 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2020 15:49:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,407,1574150400"; d="scan'208";a="225981808" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga008.fm.intel.com with ESMTP; 05 Feb 2020 15:49:51 -0800 Date: Thu, 6 Feb 2020 07:50:08 +0800 From: Wei Yang To: Wei Yang Cc: David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Segher Boessenkool , Andrew Morton , Michal Hocko , Oscar Salvador , Baoquan He Subject: Re: [PATCH v1] mm/memory_hotplug: Easier calculation to get pages to next section boundary Message-ID: <20200205235007.GA28870@richard> Reply-To: Wei Yang References: <20200205135251.37488-1-david@redhat.com> <20200205231945.GB28446@richard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205231945.GB28446@richard> User-Agent: Mutt/1.9.4 (2018-02-28) 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 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. > >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. > >Seems currently we support subsection hotplug? Then how a subsection range got >hotplug? Or this patch is a pre-requisite? > 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