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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 9AADDC33CB1 for ; Thu, 16 Jan 2020 08:25:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B00F20748 for ; Thu, 16 Jan 2020 08:25:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ECNCO10n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B00F20748 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 EA0308E0052; Thu, 16 Jan 2020 03:25:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E4FD88E003F; Thu, 16 Jan 2020 03:25:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D64D68E0052; Thu, 16 Jan 2020 03:25:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id C23AA8E003F for ; Thu, 16 Jan 2020 03:25:04 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 683C5181AEF07 for ; Thu, 16 Jan 2020 08:25:04 +0000 (UTC) X-FDA: 76382812128.06.hair79_f0ef725ecb35 X-HE-Tag: hair79_f0ef725ecb35 X-Filterd-Recvd-Size: 3982 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Jan 2020 08:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579163102; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B0rYzhQRc5mza2bd3EIWULLn19LobKoUgN0bWmQtIhM=; b=ECNCO10nGSEo5DAQPFol1/gcxD7KrEwjVqj6UgBJv0SiBvWd9LyPwkee9Kyt7+zcO+eMJl zxwRO3NSabO4DqAY7yJnyCcsDWraUEP2BF0/iDpn8wBct2hG+6JSAeXYrJZSVHKAsY05/n rxw6KFWDAt6MEWQpDXEl8vGBi06Jebk= 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-159-sDh67BIBPS-G-Sxckns2CA-1; Thu, 16 Jan 2020 03:24:59 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 00F31183B541; Thu, 16 Jan 2020 08:24:58 +0000 (UTC) Received: from localhost (ovpn-12-41.pek2.redhat.com [10.72.12.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B0B819C5B; Thu, 16 Jan 2020 08:24:54 +0000 (UTC) Date: Thu, 16 Jan 2020 16:24:51 +0800 From: Baoquan He To: David Hildenbrand Cc: Pingfan Liu , linux-mm@kvack.org, Andrew Morton , Dan Williams , Oscar Salvador , Michal Hocko , kexec@lists.infradead.org, Kazuhito Hagio Subject: Re: [PATCH] mm/sparse: reset section's mem_map when fully deactivated Message-ID: <20200116082451.GC26758@MiWiFi-R3L-srv> References: <1579143668-27941-1-git-send-email-kernelfans@gmail.com> <97ab281f-d038-d40c-648a-e0085a906dcf@redhat.com> <6cfd834a-72cc-656a-3954-40b37db5a66f@redhat.com> MIME-Version: 1.0 In-Reply-To: <6cfd834a-72cc-656a-3954-40b37db5a66f@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: sDh67BIBPS-G-Sxckns2CA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 01/16/20 at 09:14am, David Hildenbrand wrote: > On 16.01.20 09:06, David Hildenbrand wrote: > > On 16.01.20 04:01, Pingfan Liu wrote: > >> When fully deactivated, it is meaningless to keep the value of a secti= on's > >> mem_map. And its mem_map will be reassigned during re-added. > >> > >> Beside this, it breaks the user space tool "makedumpfile", which makes > >> assumption that a hot-removed section having mem_map as NULL. > >> > >> The bug can be reproduced on IBM POWERVM by "drmgr -c mem -r -q 5" , > >> trigger a crash, and save vmcore by makedumpfile > >=20 > > Are you using an up-to-date makedumfile and did kdump.service properly > > get reloaded on the udev events? I remember that this works. > >=20 > > makedumpfile will not dump memory sections that a) are not marked > > offline (SECTION_IS_ONLINE) - after offlining b) are not part of an > > iomem resource - after memory unplug. Makedumpfile seems to only check SECTION_MARKED_PRESENT. Then the NULL memmap will fail vmcore dumping, I guess. > >=20 > >=20 > > The current code makes sure that sparse_decode_mem_map() will return NU= LL. > >=20 >=20 > ... but it's only used at this very place. I think we should add a > Fixes: tag, although this might be fixed as well in makedumpfile (so > people are aware that patch broke something) Agree, it's worth fixing it too in makedumpfile side to enhance.