Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp340776ybl; Fri, 9 Aug 2019 06:50:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS1ZuNvPOuOc4NUVNmR0nshjlA/fPIJCa74lSb2rXD+TImAS3bKRFgTzdZp4YZ3tI9c/zW X-Received: by 2002:a17:902:20e3:: with SMTP id v32mr8461585plg.142.1565358646758; Fri, 09 Aug 2019 06:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565358646; cv=none; d=google.com; s=arc-20160816; b=HDMPK63oEIQsglCW84MeiKI/Hnr+p13MEjfrn2UNMebKs0BAZZDpkVlzBUmJkCf2f0 djA4FKA/Mu7CKxlGFXGK3cc5mP92eaBreXDxJIhWDzOuowyt8kdYiSll4o2PRKtBwroa TvdPNjJ74YjO6B3V55hcg3W4xAqkPgcOBeZlQFTD+zOyaF/lLqoklkdGEd+h1XeFBvku bghh1GiofrGItjUEZIWlm8SGxIgnCdOJ8eCCJweLZgFQVXCHNy5ngf3rbTz5NQURy5/b MsZMBCqaeirYQGGcRly6FyiyVRL6Vc5zKpjuyvjsCKen4WrNYuIjt0AM6PabQLnlWVPZ uoNQ== 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:dkim-signature; bh=LyignUp7I1w3k1JhRB7hSSaZmUScIlvleAzqEtH71gA=; b=lwFHqLlFET68neehi0EWe143SYsGydUWwI3bf7+C50+aagtaEHgfcO1zKK9HgGnL17 dqkgjTm0RYRhyhLLmNqza1kXyX5+6e7C9o1G6QC+kAb5MFk2SKufIBINPRpydaInTnyM wcPCDWiufWhBlcfzKScjKmLZj1FPCQpTwgEjzzGy8Gz3G20nvj90FkzD1v0HIKIIeSWt /CgAoBm2h/1lfAOkRRqYEePlaxn5qoDghMtDFIkGqVJ+V2CgHdkh+/9nQleQuCRFKHlq llFrn4AyUN4aXCSrRWmji889htN2TzHFnUCBt5mkDFLI70ah1MbCNSQP4RIrgoDOt2ai IWCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a4W0NpB7; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si39385556pgl.536.2019.08.09.06.50.29; Fri, 09 Aug 2019 06:50:46 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=a4W0NpB7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407208AbfHINtM (ORCPT + 99 others); Fri, 9 Aug 2019 09:49:12 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:46066 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436496AbfHINq1 (ORCPT ); Fri, 9 Aug 2019 09:46:27 -0400 Received: by mail-ed1-f68.google.com with SMTP id x19so89100996eda.12 for ; Fri, 09 Aug 2019 06:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LyignUp7I1w3k1JhRB7hSSaZmUScIlvleAzqEtH71gA=; b=a4W0NpB7Ky7ZNvyTrbh1FeBLRkzD3aPh58RS1Yx4bs/BVTnp45+DINWMGfkbq8hq7Q Y3Z4bdj5hgCTeGW+PRshMaXOMxfFs+yMLbXwPTZLqJTcO/dIrpBRkUNMwIYuvyefgxLE ghaZnnGxRRWhYKHkI/uJzl52jBCmY6GTaX4J6IMtYXbQlVLgECyZntsud91yKcOGxjq1 ATUWqTH0gQtzKxNRtGFOYFydwjEzo49N/C0g2sw3KGDcPT84ORGadNZJiyoF1tdgy86l pT+EYQrZCc/tezrHEA9IExUAHvjCjPlw9d1k0TydyGhC6W7edZj2zop9pkCTsz+j9sKa GMoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=LyignUp7I1w3k1JhRB7hSSaZmUScIlvleAzqEtH71gA=; b=E6/E093iNzfh1IkVjH+MGFmj3Za8JrapJa0hKg9DPmktU1mj/yynOBVXwppSEx3Dzz lmE78Pku1PFVernVEtbMNd0wSZc5YxxOny37Yb7dHlpQe9ZXZH/OM5fNW1ALW7bvlipK cnrBfxDhPQ2OK7R05WwgDxNANGv/GgaV76JAzkfBecyRRNcgNxQFyXopvce02q9Xf0aq Ge+1HhAsyjstofw2ESy0OO8zh+ruIeyOTu9Gbjb8qd569r/gHvhCl9QBknGoSKz0cW/F 1eM+2eov9fFgnLRYzdSMeRDZB5/C1inCSjJMeYsoyMBR+gigV1prCwHUfnmFAk3vJPPs 81xA== X-Gm-Message-State: APjAAAWobaXrzhtelQFkQG2o+B4HIWIGA2/I8lr3wiSMz5Cle4WorVUX Q5Qyf3zSRM2pagJbckVLN0o= X-Received: by 2002:aa7:ccd6:: with SMTP id y22mr21987171edt.274.1565358386098; Fri, 09 Aug 2019 06:46:26 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id c15sm16018545ejs.17.2019.08.09.06.46.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Aug 2019 06:46:25 -0700 (PDT) Date: Fri, 9 Aug 2019 13:46:24 +0000 From: Wei Yang To: Anshuman Khandual Cc: Wei Yang , akpm@linux-foundation.org, osalvador@suse.de, pasha.tatashin@oracle.com, mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/sparse: use __nr_to_section(section_nr) to get mem_section Message-ID: <20190809134624.htv6jws7hphs4tvz@master> Reply-To: Wei Yang References: <20190809010242.29797-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 09, 2019 at 02:39:59PM +0530, Anshuman Khandual wrote: > > >On 08/09/2019 06:32 AM, Wei Yang wrote: >> __pfn_to_section is defined as __nr_to_section(pfn_to_section_nr(pfn)). > >Right. > >> >> Since we already get section_nr, it is not necessary to get mem_section >> from start_pfn. By doing so, we reduce one redundant operation. >> >> Signed-off-by: Wei Yang > >Looks right. > >With this applied, memory hot add still works on arm64. Thanks for your test. > >Reviewed-by: Anshuman Khandual > >> --- >> mm/sparse.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/mm/sparse.c b/mm/sparse.c >> index 72f010d9bff5..95158a148cd1 100644 >> --- a/mm/sparse.c >> +++ b/mm/sparse.c >> @@ -867,7 +867,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn, >> */ >> page_init_poison(pfn_to_page(start_pfn), sizeof(struct page) * nr_pages); >> >> - ms = __pfn_to_section(start_pfn); >> + ms = __nr_to_section(section_nr); >> set_section_nid(section_nr, nid); >> section_mark_present(ms); >> >> -- Wei Yang Help you, Help me