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, INCLUDES_PATCH,MAILING_LIST_MULTI,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 2D4F1C35250 for ; Mon, 10 Feb 2020 06:07:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EC69A20870 for ; Mon, 10 Feb 2020 06:07:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC69A20870 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 86D2D6B00BE; Mon, 10 Feb 2020 01:07:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 81E336B00BF; Mon, 10 Feb 2020 01:07:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 732AD6B00C0; Mon, 10 Feb 2020 01:07:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id 59EDE6B00BE for ; Mon, 10 Feb 2020 01:07:50 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F17DD180AD802 for ; Mon, 10 Feb 2020 06:07:49 +0000 (UTC) X-FDA: 76473186300.26.cake18_7e865a107bb29 X-HE-Tag: cake18_7e865a107bb29 X-Filterd-Recvd-Size: 3146 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Mon, 10 Feb 2020 06:07:49 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2020 22:07:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,424,1574150400"; d="scan'208";a="221454434" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga007.jf.intel.com with ESMTP; 09 Feb 2020 22:07:46 -0800 Date: Mon, 10 Feb 2020 14:08:04 +0800 From: Wei Yang To: Baoquan He Cc: Wei Yang , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, dan.j.williams@intel.com, david@redhat.com Subject: Re: [PATCH 7/7] mm/hotplug: fix hot remove failure in SPARSEMEM|!VMEMMAP case Message-ID: <20200210060804.GF7326@richard> Reply-To: Wei Yang References: <20200209104826.3385-1-bhe@redhat.com> <20200209104826.3385-8-bhe@redhat.com> <20200209235202.GC8705@richard> <20200210034105.GA8965@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200210034105.GA8965@MiWiFi-R3L-srv> 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 Mon, Feb 10, 2020 at 11:41:05AM +0800, Baoquan He wrote: >On 02/10/20 at 07:52am, Wei Yang wrote: >> >--- >> > mm/sparse.c | 4 +++- >> > 1 file changed, 3 insertions(+), 1 deletion(-) >> > >> >diff --git a/mm/sparse.c b/mm/sparse.c >> >index 623755e88255..345d065ef6ce 100644 >> >--- a/mm/sparse.c >> >+++ b/mm/sparse.c >> >@@ -854,13 +854,15 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages, >> > ms->usage = NULL; >> > } >> > memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr); >> >- ms->section_mem_map = (unsigned long)NULL; >> > } >> > >> > if (section_is_early && memmap) >> > free_map_bootmem(memmap); >> > else >> > depopulate_section_memmap(pfn, nr_pages, altmap); >> >> The crash happens in depopulate_section_memmap() when trying to get memmap by >> pfn_to_page(). Can we pass memmap directly? > >Yes, that's also a good idea. While it needs to add a parameter for >depopulate_section_memmap(), the parameter is useless for VMEMMAP >though, I personally prefer the current fix which is a little simpler. > Not a new parameter, but replace pfn with memmap. Not sure why the parameter is useless for VMEMMAP? memmap will be assigned to start and finally pass to vmemmap_free(). >Anyway, both is fine to me, I can update if you think passing memmap is >better. > >> >> >+ >> >+ if(!rc) >> >+ ms->section_mem_map = (unsigned long)NULL; >> > } >> > >> > static struct page * __meminit section_activate(int nid, unsigned long pfn, >> >-- >> >2.17.2 >> >> -- >> Wei Yang >> Help you, Help me >> -- Wei Yang Help you, Help me