Re: [PATCH] mm/sparse: reset section's mem_map when fully deactivated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16.01.20 09:24, Baoquan He wrote:
> 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 section'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
>>>
>>> Are you using an up-to-date makedumfile and did kdump.service properly
>>> get reloaded on the udev events? I remember that this works.
>>>
>>> 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.

But why should the section be marked SECTION_MARKED_PRESENT? After
unplugging a section, the flag will be cleared.

validate_mem_section() seems to iterate over all sections 0..num_section
- 1 and validates them.

section = nr_to_section(section_nr, mem_sec);
if (section == NOT_KV_ADDR) {
	mem_map = NOT_MEMMAP_ADDR:
} else {
	mem_map = section_mem_map_addr(section, &map_mask)
	if (!(map_mask & SECTION_MARKED_PRESENT)) {
		return FALSE;
	}
	if (mem_map == 0) {
		mem_map = NOT_MEMMAP_ADDR;
	} else {
	...

But here it is:

section_mem_map_addr():

map = ULONG(mem_section + OFFSET(mem_section.section_mem_map));
mask = SECTION_MAP_MASK;
*map_mask = map & ~mask;
if (map == 0x0)
	*map_mask |= SECTION_MARKED_PRESENT;

If the map is zero, the section is assumed to be present. The way the
map is calculated, it will be zero due to the changes in the kernel.

-- 
Thanks,

David / dhildenb






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux