Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp960996ybf; Sat, 29 Feb 2020 21:00:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxqG5j7CaDx0ZDFNsUOiT+iRAwxFfPvo4ALNuSi2H3YBn3qL03iHBdexZBEqx9Lu+4nbbpp X-Received: by 2002:a9d:6c8e:: with SMTP id c14mr7935216otr.331.1583038849403; Sat, 29 Feb 2020 21:00:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583038849; cv=none; d=google.com; s=arc-20160816; b=keJC7q0Vq20Z5sBEY9ts/mvoyq0r4fnXCEyyLm1dwAUvvsAeQCNClkXMyCkbnqKlSq 0XbVHmfF+FgpEwWBTO0wLXKAhkF6fCvT668hfF8RuqLm9wrM1BH9rlAJQge9jfu3fm3n I8xEmIq94T/oVeHqImZ9Hq4C44NVbpUE1nSQjUkKKFvUCPDHrsMrJS/xvGsF3/6pjNoo RzRNI+SgfUrgHDdtulmtmCDfdCLivYfnZGzsTi7jM7AAuNsyiQmq7WAN1iaFvoM5BQle Xfv+XWKN06YA/v/RBrA5PZS1LAGSMWRdLBXb0hGz+tK6oXlEuTOyZb1JwjqS5RXemPjv BbiA== 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=MNM5EcwU6Xrosu2wB4Ut6M3JY1JS6NHiTrWyRpXHF/Y=; b=BAD+hgUJhSiPHBHBROdNT/wo0bKJYnoqfTqD4cqG1IYVa6YMDfNcelm00gpi5V1urz 8zHPWzHevNnbPx81nyDjsSQaiENpXjBfIFf+CbkYkhPmxDYcvPp4bMdY8M6eFbPLy854 grbgtxP+F2xu7bgAxswp6yl7qs0bAWfCn8PHj3z01Fffk/eDzTbpvZ52clmcUWAXpeAj qNREADABPSe6no9OEi4njK8nUFIM/ZkWOgPsjA5wfnBL6w0p30CppcA2HEUpgfggH6Q1 pcRBPpGbLHxFEz5rgakgt0HKaRE2mW4k70N9pbwf5lf+tJOKhzpgl0JCBI07Emw2+DfX 1Ddw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MeMZZ4er; 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 t11si4445744otm.47.2020.02.29.21.00.24; Sat, 29 Feb 2020 21:00:49 -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=MeMZZ4er; 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 S1726688AbgCAE70 (ORCPT + 99 others); Sat, 29 Feb 2020 23:59:26 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:25878 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726151AbgCAE70 (ORCPT ); Sat, 29 Feb 2020 23:59:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583038763; 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=MNM5EcwU6Xrosu2wB4Ut6M3JY1JS6NHiTrWyRpXHF/Y=; b=MeMZZ4erTdyk3kjprPk7gM9h4ozqdSDmSBJHWPdJup8eNLbAWkNYpZPKYENCZq0ggR+WKc eUg3vn1X9Lvb/IM0+ugjQF3pqWoDEvbyZzYx9MvrTIqU3XHiWNXEAMbOP7O48q9Uw3I6UX GSXs+BoUP5pHwl9THBxw+zSyJZMl6T4= 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-430-7bgMQm36PpqNaK0uKc1c6Q-1; Sat, 29 Feb 2020 23:59:19 -0500 X-MC-Unique: 7bgMQm36PpqNaK0uKc1c6Q-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 8902A107ACC9; Sun, 1 Mar 2020 04:59:17 +0000 (UTC) Received: from localhost (ovpn-12-59.pek2.redhat.com [10.72.12.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77C0760BF3; Sun, 1 Mar 2020 04:59:13 +0000 (UTC) Date: Sun, 1 Mar 2020 12:59:11 +0800 From: Baoquan He To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, richardw.yang@linux.intel.com, osalvador@suse.de, dan.j.williams@intel.com, mhocko@suse.com, rppt@linux.ibm.com, robin.murphy@arm.com Subject: Re: [PATCH v2 2/7] mm/sparse.c: introduce new function fill_subsection_map() Message-ID: <20200301045911.GM24216@MiWiFi-R3L-srv> References: <20200220043316.19668-1-bhe@redhat.com> <20200220043316.19668-3-bhe@redhat.com> <81082609-bac8-5071-c090-3b96f7b07b91@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <81082609-bac8-5071-c090-3b96f7b07b91@redhat.com> 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/28/20 at 03:27pm, David Hildenbrand wrote: > On 20.02.20 05:33, Baoquan He wrote: > > Wrap the codes filling subsection map from section_activate() into > > "Factor out the code that fills the subsection" ... Fine to me, I will replace it with this. Thanks. > > > fill_subsection_map(), this makes section_activate() cleaner and > > easier to follow. > > > > Signed-off-by: Baoquan He > > --- > > mm/sparse.c | 45 ++++++++++++++++++++++++++++++++++----------- > > 1 file changed, 34 insertions(+), 11 deletions(-) > > > > diff --git a/mm/sparse.c b/mm/sparse.c > > index b8e52c8fed7f..977b47acd38d 100644 > > --- a/mm/sparse.c > > +++ b/mm/sparse.c > > @@ -790,24 +790,28 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages, > > ms->section_mem_map = (unsigned long)NULL; > > } > > > > -static struct page * __meminit section_activate(int nid, unsigned long pfn, > > - unsigned long nr_pages, struct vmem_altmap *altmap) > > +/** > > + * fill_subsection_map - fill subsection map of a memory region > > + * @pfn - start pfn of the memory range > > + * @nr_pages - number of pfns to add in the region > > + * > > + * This fills the related subsection map inside one section, and only > > + * intended for hotplug. > > + * > > + * Return: > > + * * 0 - On success. > > + * * -EINVAL - Invalid memory region. > > + * * -EEXIST - Subsection map has been set. > > + */ > > Without this comment (or a massively reduced one :) ) Yeah, as we discussed, I will remove it. > > Reviewed-by: David Hildenbrand > > -- > Thanks, > > David / dhildenb