Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3275965ybv; Sun, 9 Feb 2020 19:42:35 -0800 (PST) X-Google-Smtp-Source: APXvYqydF0CCXGXSgnjzxhvp8HfaCEfMtiZbOGm2k2jOQ39H7nUB9f5zpSaqiI3LgYecf7hcrdWu X-Received: by 2002:a9d:7984:: with SMTP id h4mr8915365otm.297.1581306155024; Sun, 09 Feb 2020 19:42:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581306155; cv=none; d=google.com; s=arc-20160816; b=dvjT2NQb/Sok1975t4VP5LAwq7YqzBoYBA8SM91GkbW+vATpSN4xC8QM1XQc4uFVuS CFoWMmSvlWP0L6/3wQ/oUvNk7+1Jj4Ad9uxyhhCFZGqPFjv+YkkO/gqPC2U+te060Mhr ii8WFKh7jKqJCfNCCLdbIVQbRmRgUTXIibUX1mS/nrpYqTltttMdZCc1/6tAzBJU4wVu hSBeCiMXMD/ErKKojVeohewKSHvBf0kgOMd04wbQbJ+H3XKH++Pag44IENLMVwDG85Wd QhrldMbg0+7GwlhMciKL3AD+Auy3nnN+rO7VzgGmFNfTKh5BpDhYNQbE8zW6TLBXvwPw G5FQ== 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=/pHa40SKVl7GVRBNIgZW7Fzw40vKYdw53Amy6nQt9S0=; b=GtHMckPBxmhsozvo6U7WyKB3wK+CGI2SSfvZ2usTzR8n5E7GnA4sttDtf7NV/tFBpv GUQrDN+o/YeiZriN7RmJJRDz8PeLZrMTlvOTUeOSfodRZufqfQmSRGcwFviU075pHNS6 tzghANOJeq1aZuF6+/KW2mBujYAkN3I1vKxtCwMaRGmTwpBGWD/YSU0vz7WyUxlHZ9ic TEOCm/O1697vq1WfOBM4SJWfBo7W0/JBC4qqCJJxsQMNVrGyEINwLEH/6+/oJh1DdZgy RMZEUaitP0wgnZKle36XEmbVfE4/d3cmOcXcswPZkuqpLKbQ3vXE10fb7q/VxqahgryT rJzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KKDa5L80; 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 v17si4155801otp.244.2020.02.09.19.42.22; Sun, 09 Feb 2020 19:42:35 -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=KKDa5L80; 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 S1727029AbgBJDlU (ORCPT + 99 others); Sun, 9 Feb 2020 22:41:20 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:47515 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726958AbgBJDlU (ORCPT ); Sun, 9 Feb 2020 22:41:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581306079; 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=/pHa40SKVl7GVRBNIgZW7Fzw40vKYdw53Amy6nQt9S0=; b=KKDa5L80S+qi0yTMYeEbc6R/4TC7lqDAUTifxoDhKZ/HM0hUZJZS4TPZ7/LWBuaeiWPiKv SwEsuue0p54ZDrRq3VEp+YyQuz1OOH1mj7zkDkWWZiLUHmg8neIet03wmD0C3t9ELTd/HI Tf2O7+Tb6AadYh0LCtL1v0rBMU0YX5U= 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-366-1fAzcPC4NUu9x981PK8czg-1; Sun, 09 Feb 2020 22:41:14 -0500 X-MC-Unique: 1fAzcPC4NUu9x981PK8czg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9AD21801E70; Mon, 10 Feb 2020 03:41:13 +0000 (UTC) Received: from localhost (ovpn-12-27.pek2.redhat.com [10.72.12.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 18BAF857B4; Mon, 10 Feb 2020 03:41:07 +0000 (UTC) Date: Mon, 10 Feb 2020 11:41:05 +0800 From: Baoquan He To: Wei Yang Cc: 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: <20200210034105.GA8965@MiWiFi-R3L-srv> References: <20200209104826.3385-1-bhe@redhat.com> <20200209104826.3385-8-bhe@redhat.com> <20200209235202.GC8705@richard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200209235202.GC8705@richard> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 >