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=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 5C42BC3F2CE for ; Sun, 1 Mar 2020 04:59:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EF498214DB for ; Sun, 1 Mar 2020 04:59:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MeMZZ4er" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF498214DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 654B86B0007; Sat, 29 Feb 2020 23:59:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DF056B0008; Sat, 29 Feb 2020 23:59:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A60B6B000A; Sat, 29 Feb 2020 23:59:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id 2F26E6B0007 for ; Sat, 29 Feb 2020 23:59:25 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D9745181AEF1D for ; Sun, 1 Mar 2020 04:59:24 +0000 (UTC) X-FDA: 76545589848.12.part89_6f42b027fee25 X-HE-Tag: part89_6f42b027fee25 X-Filterd-Recvd-Size: 3997 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Mar 2020 04:59:24 +0000 (UTC) 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 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 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