Unverified Commit c9b60916 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5629 v3 Mitigate a vmap lock contention

Merge Pull Request from: @ci-robot 
 
PR sync from: Peng Zhang <zhangpeng362@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/2ZGYT7WKVGU3EBYLY2DITYMYCGQUYCSO/ 
From: ZhangPeng <zhangpeng362@huawei.com>

This patch set includes two patch sets: Mitigate a vmap lock contention
and mm/vmalloc: lock contention optimization under multi-threading.

In high-concurrency scenarios such as the "/test_vmalloc.sh
run_test_mask=7 nr_threads=64" scenario, the performance is improved by
more than 10x. The run time was reduced from 18m45.268s to 1m45.066s.

Changelog:
v2->v3:
- Fix commit format warning

v1->v2:
- Remove 2 maillist inclusion patches
- Merge patch 21 to resolve the conflict in patch 16

Alexei Starovoitov (3):
  mm: Enforce VM_IOREMAP flag and range in ioremap_page_range.
  mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages().
  mm: Introduce vmap_page_range() to map pages in PCI address space

Baoquan He (2):
  mm/vmalloc: fix the unchecked dereference warning in vread_iter()
  mm/vmalloc: remove vmap_area_list

Uladzislau Rezki (Sony) (13):
  mm: vmalloc: add va_alloc() helper
  mm: vmalloc: rename adjust_va_to_fit_type() function
  mm: vmalloc: move vmap_init_free_space() down in vmalloc.c
  mm: vmalloc: remove global vmap_area_root rb-tree
  mm: vmalloc: remove global purge_vmap_area_root rb-tree
  mm: vmalloc: offload free_vmap_area_lock lock
  mm: vmalloc: add a scan area of VA only once
  mm: vmalloc: support multiple nodes in vread_iter
  mm: vmalloc: support multiple nodes in vmallocinfo
  mm: vmalloc: set nr_nodes based on CPUs in a system
  mm: vmalloc: add a shrinker to drain vmap pools
  mm: vmalloc: improve description of vmap node layer
  mm: vmalloc: refactor vmalloc_dump_obj() function


-- 
2.25.1
 
https://gitee.com/openeuler/kernel/issues/I9CHG1 
 
Link:https://gitee.com/openeuler/kernel/pulls/5629

 

Reviewed-by: default avatarZucheng Zheng <zhengzucheng@huawei.com>
Reviewed-by: default avatarMingzheng Xing <xingmingzheng@iscas.ac.cn>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parents 926d5e01 8c620d05
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -65,11 +65,11 @@ Defines the beginning of the text section. In general, _stext indicates
the kernel start address. Used to convert a virtual address from the
direct kernel map to a physical address.

vmap_area_list
--------------
VMALLOC_START
-------------

Stores the virtual area list. makedumpfile gets the vmalloc start value
from this variable and its value is necessary for vmalloc translation.
Stores the base address of vmalloc area. makedumpfile gets this value
since is necessary for vmalloc translation.

mem_map
-------
+4 −4
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ void __init add_static_vm_early(struct static_vm *svm)
int ioremap_page(unsigned long virt, unsigned long phys,
		 const struct mem_type *mtype)
{
	return ioremap_page_range(virt, virt + PAGE_SIZE, phys,
	return vmap_page_range(virt, virt + PAGE_SIZE, phys,
			       __pgprot(mtype->prot_pte));
}
EXPORT_SYMBOL(ioremap_page);
@@ -466,7 +466,7 @@ int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
	if (res->end > IO_SPACE_LIMIT)
		return -EINVAL;

	return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr,
	return vmap_page_range(vaddr, vaddr + resource_size(res), phys_addr,
			       __pgprot(get_mem_type(pci_ioremap_mem_type)->prot_pte));
}
EXPORT_SYMBOL(pci_remap_iospace);
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ void arch_crash_save_vmcoreinfo(void)
	/* Please note VMCOREINFO_NUMBER() uses "%d", not "%x" */
	vmcoreinfo_append_str("NUMBER(MODULES_VADDR)=0x%lx\n", MODULES_VADDR);
	vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END);
	vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START);
	vmcoreinfo_append_str("NUMBER(VMALLOC_END)=0x%lx\n", VMALLOC_END);
	vmcoreinfo_append_str("NUMBER(VMEMMAP_START)=0x%lx\n", VMEMMAP_START);
	vmcoreinfo_append_str("NUMBER(VMEMMAP_END)=0x%lx\n", VMEMMAP_END);
+1 −1
Original line number Diff line number Diff line
@@ -591,7 +591,7 @@ static int __init add_legacy_isa_io(struct fwnode_handle *fwnode,
	}

	vaddr = (unsigned long)(PCI_IOBASE + range->io_start);
	ioremap_page_range(vaddr, vaddr + size, hw_start, pgprot_device(PAGE_KERNEL));
	vmap_page_range(vaddr, vaddr + size, hw_start, pgprot_device(PAGE_KERNEL));

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ static int __init add_legacy_isa_io(struct fwnode_handle *fwnode, resource_size_

	vaddr = PCI_IOBASE + range->io_start;

	ioremap_page_range(vaddr, vaddr + size, hw_start, pgprot_device(PAGE_KERNEL));
	vmap_page_range(vaddr, vaddr + size, hw_start, pgprot_device(PAGE_KERNEL));

	return 0;
}
Loading