From: Michal Hocko <mhocko@suse.com>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
Dan Williams <dan.j.williams@intel.com>,
Oscar Salvador <osalvador@suse.de>, Baoquan He <bhe@redhat.com>,
Qian Cai <cai@lca.pw>,
kexec@lists.infradead.org, Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Subject: Re: [PATCHv2] mm/sparse: reset section's mem_map when fully deactivated
Date: Mon, 20 Jan 2020 08:29:39 +0100 [thread overview]
Message-ID: <20200120072939.GD18451@dhcp22.suse.cz> (raw)
In-Reply-To: <1579487594-28889-1-git-send-email-kernelfans@gmail.com>
On Mon 20-01-20 10:33:14, Pingfan Liu wrote:
> After commit ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug"),
> when a mem section is fully deactivated, section_mem_map still records the
> section's start pfn, which is not used any more and will be reassigned
> during re-added.
>
> In analogy with alloc/free pattern, it is better to clear all fields of
> section_mem_map.
>
> Beside this, it breaks the user space tool "makedumpfile" [1], which makes
> assumption that a hot-removed section has mem_map as NULL, instead of
> checking directly against SECTION_MARKED_PRESENT bit. (makedumpfile will be
> better to change the assumption, and need a patch)
>
> The bug can be reproduced on IBM POWERVM by "drmgr -c mem -r -q 5" ,
> trigger a crash, and save vmcore by makedumpfile
While makedumpfile lives very closely to the kernel and occasional
breakage is to be expected I still believe that Fixes: ba72b4c8cf60
is due.
> [1]: makedumpfile, commit e73016540293 ("[v1.6.7] Update version")
>
> Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
> To: linux-mm@kvack.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Oscar Salvador <osalvador@suse.de>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Baoquan He <bhe@redhat.com>
> Cc: Qian Cai <cai@lca.pw>
> Cc: kexec@lists.infradead.org
> Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> v1 -> v2:
> make an explicit convertion from NULL to ulong
> improve commit log
>
> mm/sparse.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 3822ecb..3918fc3 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -789,7 +789,7 @@ 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 = sparse_encode_mem_map(NULL, section_nr);
> + ms->section_mem_map = (unsigned long)NULL;
> }
>
> if (section_is_early && memmap)
> --
> 2.7.5
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2020-01-20 7:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 2:33 Pingfan Liu
2020-01-20 7:29 ` Michal Hocko [this message]
2020-01-20 9:03 ` David Hildenbrand
2020-01-20 10:12 ` Pingfan Liu
2020-01-24 3:10 ` Andrew Morton
2020-01-24 6:49 ` Michal Hocko
2020-01-25 13:26 ` Pingfan Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200120072939.GD18451@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=cai@lca.pw \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=k-hagio@ab.jp.nec.com \
--cc=kernelfans@gmail.com \
--cc=kexec@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox