Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp845927ybv; Wed, 5 Feb 2020 15:51:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxtMr+XYTQOmwWnL4QUztSyLN87XiBTmPHLTHHTXLsctcoKC9DsJsstYI9Y78RedA34RI+e X-Received: by 2002:a05:6830:12d5:: with SMTP id a21mr28795070otq.296.1580946683550; Wed, 05 Feb 2020 15:51:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580946683; cv=none; d=google.com; s=arc-20160816; b=mCfJ0pyapv+SgcXxg8I1ZSWQLUh7KLt4hhP89wbAFsOsDfwyjVlpNqJGKvSVTFfmHV NX6EP2hjVEIyIoMRV5nTOqmuaLwzyn9HNUkuUB46x51EtqMuOI47pzrOrs4GFqRVi+fD rKEXYU1J9aKk0YQhbvP6gkIHDMgcp5z9kdLBZGED/v9AqSgg+unSDNHF0BbyxgMRPxO2 6dlcxmzdAfCrPvgIErDwuVlyecf0Jue3eVizgRMYqmyNYBmt7QlKKgwQq1l9QgVlKvFm aQTZE0tTqkMcva1Fkxu47lnYTkNM42J2gTBxTtRpE7hfU9NmybWKNWW4xuF2h3EBTt7Q WQXw== 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:reply-to:message-id :subject:cc:to:from:date; bh=W3WkmR9uxwJqLGOPQUbNTPU3D3kui3rmfA3WS1zHUt4=; b=jfGNF+5FCmieLwX3nDCkWwgOLQE2Z4hNUhqNt5Nr9kDFUyw5C4849tsP9gB+/UOVsx KbHT/CvykVLbJ0Wsff00PqE4kq8TmnX5hiZspice/qc9hG3vgcWBUk0XxxJxcv83DjyW iCsFVaReYMqlBY3+IQ+sjJQ/siS5jV4shFbPp4/lwjhHJScT7zhmLMcrUb80bQj7PsEp PWGF7N6aNSWamuDuc/qWuHQxU7kd8kRkD/3vBBvcb++saNfc4f1543FgbaCLu/wIZuCr w+napSlgKxr/6M9xnpDipShedZIogHDrSp9nz3D38HjbmMMepAbnGVFfkJr6dHxdF7hy 4AdQ== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b25si719635otp.212.2020.02.05.15.51.10; Wed, 05 Feb 2020 15:51:23 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727455AbgBEXty (ORCPT + 99 others); Wed, 5 Feb 2020 18:49:54 -0500 Received: from mga12.intel.com ([192.55.52.136]:5794 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727170AbgBEXty (ORCPT ); Wed, 5 Feb 2020 18:49:54 -0500 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 fmsmga106.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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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