[tip:irq/urgent] irqchip/gic-v3-its: Cap lpi_id_bits to reduce memory footprint

2018-09-06 Thread tip-bot for Jia He
Commit-ID: 4cb205c0c50f613e2de91f0eb19d5247ed003e89 Gitweb: https://git.kernel.org/tip/4cb205c0c50f613e2de91f0eb19d5247ed003e89 Author: Jia He AuthorDate: Tue, 28 Aug 2018 12:53:26 +0800 Committer: Thomas Gleixner CommitDate: Thu, 6 Sep 2018 20:31:59 +0200 irqchip/gic-v3-its: Cap

[tip:irq/urgent] irqchip/gic-v3-its: Cap lpi_id_bits to reduce memory footprint

2018-09-06 Thread tip-bot for Jia He
Commit-ID: 4cb205c0c50f613e2de91f0eb19d5247ed003e89 Gitweb: https://git.kernel.org/tip/4cb205c0c50f613e2de91f0eb19d5247ed003e89 Author: Jia He AuthorDate: Tue, 28 Aug 2018 12:53:26 +0800 Committer: Thomas Gleixner CommitDate: Thu, 6 Sep 2018 20:31:59 +0200 irqchip/gic-v3-its: Cap

Re: mmotm 2018-08-23-17-26 uploaded

2018-08-30 Thread Jia He
Hi Andrew On 8/30/2018 9:00 AM, Jia He Wrote: > > > On 8/30/2018 7:22 AM, Andrew Morton Wrote: >> On Tue, 28 Aug 2018 12:20:46 +0800 Jia He wrote: >> >>> Hi Andrew >>> FYI,I watched a lockdep warning based on your mmotm master branch[1] >&g

Re: mmotm 2018-08-23-17-26 uploaded

2018-08-30 Thread Jia He
Hi Andrew On 8/30/2018 9:00 AM, Jia He Wrote: > > > On 8/30/2018 7:22 AM, Andrew Morton Wrote: >> On Tue, 28 Aug 2018 12:20:46 +0800 Jia He wrote: >> >>> Hi Andrew >>> FYI,I watched a lockdep warning based on your mmotm master branch[1] >&g

Re: mmotm 2018-08-23-17-26 uploaded

2018-08-29 Thread Jia He
On 8/30/2018 7:22 AM, Andrew Morton Wrote: > On Tue, 28 Aug 2018 12:20:46 +0800 Jia He wrote: > >> Hi Andrew >> FYI,I watched a lockdep warning based on your mmotm master branch[1] > > Thanks. We'll need help from ARM peeps on this please. > >> [

Re: mmotm 2018-08-23-17-26 uploaded

2018-08-29 Thread Jia He
On 8/30/2018 7:22 AM, Andrew Morton Wrote: > On Tue, 28 Aug 2018 12:20:46 +0800 Jia He wrote: > >> Hi Andrew >> FYI,I watched a lockdep warning based on your mmotm master branch[1] > > Thanks. We'll need help from ARM peeps on this please. > >> [

Re: [PATCH] irqchip/gic-v3-its: cap lpi_id_bits to reduce memory footprint

2018-08-28 Thread Jia He
On 8/28/2018 4:58 PM, Marc Zyngier Wrote: > On Tue, 28 Aug 2018 05:53:26 +0100, > Jia He wrote: >> >> In commit fe8e93504ce8 ("irqchip/gic-v3-its: Use full range of LPIs"), >> it removes the cap for lpi_id_bits. But it will cause more pointless >> me

Re: [PATCH] irqchip/gic-v3-its: cap lpi_id_bits to reduce memory footprint

2018-08-28 Thread Jia He
On 8/28/2018 4:58 PM, Marc Zyngier Wrote: > On Tue, 28 Aug 2018 05:53:26 +0100, > Jia He wrote: >> >> In commit fe8e93504ce8 ("irqchip/gic-v3-its: Use full range of LPIs"), >> it removes the cap for lpi_id_bits. But it will cause more pointless >> me

[PATCH] irqchip/gic-v3-its: cap lpi_id_bits to reduce memory footprint

2018-08-27 Thread Jia He
at 16 (which is what we had before) is plenty, will save a some memory, and gives some margin before we need to push it up again. This patch re-caps the lpi_id_bits. Fixes: fe8e93504ce8 ("irqchip/gic-v3-its: Use full range of LPIs") Signed-off-by: Jia He Suggested-by: Marc Zyngier ---

[PATCH] irqchip/gic-v3-its: cap lpi_id_bits to reduce memory footprint

2018-08-27 Thread Jia He
at 16 (which is what we had before) is plenty, will save a some memory, and gives some margin before we need to push it up again. This patch re-caps the lpi_id_bits. Fixes: fe8e93504ce8 ("irqchip/gic-v3-its: Use full range of LPIs") Signed-off-by: Jia He Suggested-by: Marc Zyngier ---

Re: mmotm 2018-08-23-17-26 uploaded

2018-08-27 Thread Jia He
Hi Andrew FYI,I watched a lockdep warning based on your mmotm master branch[1] [6.692731] [ cut here ] [6.696391] DEBUG_LOCKS_WARN_ON(!current->hardirqs_enabled) [6.696404] WARNING: CPU: 3 PID: 320 at kernel/locking/lockdep.c:3845 check_flags.part.38+0x9c/0x16c

Re: mmotm 2018-08-23-17-26 uploaded

2018-08-27 Thread Jia He
Hi Andrew FYI,I watched a lockdep warning based on your mmotm master branch[1] [6.692731] [ cut here ] [6.696391] DEBUG_LOCKS_WARN_ON(!current->hardirqs_enabled) [6.696404] WARNING: CPU: 3 PID: 320 at kernel/locking/lockdep.c:3845 check_flags.part.38+0x9c/0x16c

Re: [PATCH] irqchip/gic-v3-its: add allocation max order limitation for lpi_id_bits

2018-08-26 Thread Jia He
Hi Marc Thanks for the comments On 8/27/2018 3:01 AM, Marc Zyngier Wrote: > [I'm travelling, so expect some major delays in responding to email] > > Hi Jia, > > On Sun, 26 Aug 2018 10:00:51 +0100, > Jia He wrote: >> >> There is a WARN_ON when my QDF2400 s

Re: [PATCH] irqchip/gic-v3-its: add allocation max order limitation for lpi_id_bits

2018-08-26 Thread Jia He
Hi Marc Thanks for the comments On 8/27/2018 3:01 AM, Marc Zyngier Wrote: > [I'm travelling, so expect some major delays in responding to email] > > Hi Jia, > > On Sun, 26 Aug 2018 10:00:51 +0100, > Jia He wrote: >> >> There is a WARN_ON when my QDF2400 s

[PATCH] irqchip/gic-v3-its: add allocation max order limitation for lpi_id_bits

2018-08-26 Thread Jia He
cate_prop_table will try to allocate 16M(order 12 if pagesize=4k). Thus it causes the WARN_ON. This patch fixes it by limiting the lpi_id_bits. Signed-off-by: Jia He --- drivers/irqchip/irq-gic-v3-its.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/ir

[PATCH] irqchip/gic-v3-its: add allocation max order limitation for lpi_id_bits

2018-08-26 Thread Jia He
cate_prop_table will try to allocate 16M(order 12 if pagesize=4k). Thus it causes the WARN_ON. This patch fixes it by limiting the lpi_id_bits. Signed-off-by: Jia He --- drivers/irqchip/irq-gic-v3-its.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/ir

Re: [PATCH] fs: Fix double prealloc_shrinker() in sget_fc()

2018-08-24 Thread Jia He
On 7/11/2018 10:37 PM, Kirill Tkhai Wrote: > Hi, > > I'm observing "KASAN: use-after-free Read in shrink_slab" on recent > linux-next in the code I've added: > > https://syzkaller.appspot.com/bug?id=91767fc6346a4b9e0309a8cd7e2f356c434450b9 > > It seems to be not related to my patchset, since

Re: [PATCH] fs: Fix double prealloc_shrinker() in sget_fc()

2018-08-24 Thread Jia He
On 7/11/2018 10:37 PM, Kirill Tkhai Wrote: > Hi, > > I'm observing "KASAN: use-after-free Read in shrink_slab" on recent > linux-next in the code I've added: > > https://syzkaller.appspot.com/bug?id=91767fc6346a4b9e0309a8cd7e2f356c434450b9 > > It seems to be not related to my patchset, since

[PATCH v11 1/3] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-08-21 Thread Jia He
Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He Reviewed-by: Pavel Tatashin

[PATCH v11 1/3] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-08-21 Thread Jia He
Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He Reviewed-by: Pavel Tatashin

[PATCH v11 3/3] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn

2018-08-21 Thread Jia He
0.00] DMA32 zone: 0 pages reserved [0.00] DMA32 zone: 1028048 pages, LIFO batch:31 [0.00] Normal zone: 376832 pages used for memmap [0.00] Normal zone: 24117248 pages, LIFO batch:31 Signed-off-by: Jia He Reviewed-by: Pavel Tatashin --- mm/membl

[PATCH v11 2/3] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-08-21 Thread Jia He
ps from 109 to 62 seconds." Thus it would be better if we remain memblock_next_valid_pfn on arm/arm64. Suggested-by: Daniel Vacek Signed-off-by: Jia He --- include/linux/mmzone.h | 9 + mm/memblock.c | 30 ++ mm/page_alloc.c| 5 -

[PATCH v11 3/3] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn

2018-08-21 Thread Jia He
0.00] DMA32 zone: 0 pages reserved [0.00] DMA32 zone: 1028048 pages, LIFO batch:31 [0.00] Normal zone: 376832 pages used for memmap [0.00] Normal zone: 24117248 pages, LIFO batch:31 Signed-off-by: Jia He Reviewed-by: Pavel Tatashin --- mm/membl

[PATCH v11 2/3] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-08-21 Thread Jia He
ps from 109 to 62 seconds." Thus it would be better if we remain memblock_next_valid_pfn on arm/arm64. Suggested-by: Daniel Vacek Signed-off-by: Jia He --- include/linux/mmzone.h | 9 + mm/memblock.c | 30 ++ mm/page_alloc.c| 5 -

[PATCH v11 0/3] remain and optimize memblock_next_valid_pfn on arm and arm64

2018-08-21 Thread Jia He
alid_pfn on arm64 - refine memblock_search_pfn_regions and pfn_valid_region Jia He (3): arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64 mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn arch/arm/Kconfig

[PATCH v11 0/3] remain and optimize memblock_next_valid_pfn on arm and arm64

2018-08-21 Thread Jia He
alid_pfn on arm64 - refine memblock_search_pfn_regions and pfn_valid_region Jia He (3): arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64 mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn arch/arm/Kconfig

Re: [RESEND PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-08-21 Thread Jia He
Hi Andrew On 8/22/2018 5:08 AM, Andrew Morton Wrote: > On Tue, 21 Aug 2018 14:14:30 +0800 Jia He wrote: > >> Hi Pasha >> >> On 8/17/2018 9:08 AM, Pasha Tatashin Wrote: >>> >>>> Signed-off-by: Jia He >>>> --- >>>> mm/membl

Re: [RESEND PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-08-21 Thread Jia He
Hi Andrew On 8/22/2018 5:08 AM, Andrew Morton Wrote: > On Tue, 21 Aug 2018 14:14:30 +0800 Jia He wrote: > >> Hi Pasha >> >> On 8/17/2018 9:08 AM, Pasha Tatashin Wrote: >>> >>>> Signed-off-by: Jia He >>>> --- >>>> mm/membl

Re: [RESEND PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-08-21 Thread Jia He
Hi Pasha On 8/17/2018 9:08 AM, Pasha Tatashin Wrote: > >> Signed-off-by: Jia He >> --- >> mm/memblock.c | 37 + >> 1 file changed, 29 insertions(+), 8 deletions(-) >> >> diff --git a/mm/memblock.c b/mm/memblock.c >&

Re: [RESEND PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-08-21 Thread Jia He
Hi Pasha On 8/17/2018 9:08 AM, Pasha Tatashin Wrote: > >> Signed-off-by: Jia He >> --- >> mm/memblock.c | 37 + >> 1 file changed, 29 insertions(+), 8 deletions(-) >> >> diff --git a/mm/memblock.c b/mm/memblock.c >&

Re: [RESEND PATCH v10 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-08-20 Thread Jia He
On 8/17/2018 10:50 PM, Catalin Marinas Wrote: > On Fri, Jul 06, 2018 at 05:01:10PM +0800, Jia He wrote: >> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig >> index 42c090c..26d75f4 100644 >> --- a/arch/arm64/Kconfig >> +++ b/arch/arm64/Kconfig >

Re: [RESEND PATCH v10 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-08-20 Thread Jia He
On 8/17/2018 10:50 PM, Catalin Marinas Wrote: > On Fri, Jul 06, 2018 at 05:01:10PM +0800, Jia He wrote: >> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig >> index 42c090c..26d75f4 100644 >> --- a/arch/arm64/Kconfig >> +++ b/arch/arm64/Kconfig >

Re: [RESEND PATCH v10 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid()

2018-08-16 Thread Jia He
Hi Pasha Thanks for the comments On 8/17/2018 9:35 AM, Pasha Tatashin Wrote: > > > On 7/6/18 5:01 AM, Jia He wrote: >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") optimized the loop in memmap_init_zone().

Re: [RESEND PATCH v10 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid()

2018-08-16 Thread Jia He
Hi Pasha Thanks for the comments On 8/17/2018 9:35 AM, Pasha Tatashin Wrote: > > > On 7/6/18 5:01 AM, Jia He wrote: >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") optimized the loop in memmap_init_zone().

Re: [RESEND PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-08 Thread Jia He
Hi Andew Thanks for the comments On 7/7/2018 6:37 AM, Andrew Morton Wrote: > On Fri, 6 Jul 2018 17:01:11 +0800 Jia He wrote: > >> From: Jia He >> >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible"

Re: [RESEND PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-08 Thread Jia He
Hi Andew Thanks for the comments On 7/7/2018 6:37 AM, Andrew Morton Wrote: > On Fri, 6 Jul 2018 17:01:11 +0800 Jia He wrote: > >> From: Jia He >> >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible"

Re: [PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-06 Thread Jia He
Sorry for my mistake, I have to resend this set because I missed some important maillists. Please ignore this thread. Terribly sorry about it Cheers, Jia On 7/6/2018 4:14 PM, Jia He Wrote: > From: Jia He > > Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invali

Re: [PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-06 Thread Jia He
Sorry for my mistake, I have to resend this set because I missed some important maillists. Please ignore this thread. Terribly sorry about it Cheers, Jia On 7/6/2018 4:14 PM, Jia He Wrote: > From: Jia He > > Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invali

[RESEND PATCH v10 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid()

2018-07-06 Thread Jia He
37us in my armv8a server(QDF2400 with 96G memory, pagesize 64k). Signed-off-by: Jia He --- include/linux/mmzone.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 57cdc42..83b1d11 100644 --- a/include/linux/mmzone.h +++

[RESEND PATCH v10 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid()

2018-07-06 Thread Jia He
37us in my armv8a server(QDF2400 with 96G memory, pagesize 64k). Signed-off-by: Jia He --- include/linux/mmzone.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 57cdc42..83b1d11 100644 --- a/include/linux/mmzone.h +++

[RESEND PATCH v10 5/6] mm/memblock: introduce pfn_valid_region()

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. in early_pfn_valid(), we can record the last returned memblock region. If current pfn an

[RESEND PATCH v10 5/6] mm/memblock: introduce pfn_valid_region()

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. in early_pfn_valid(), we can record the last returned memblock region. If current pfn an

[RESEND PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But it causes possible panic bug. So Daniel Vacek reverted it later. But as suggested by Daniel Vacek, it is fine to using memblock to

[RESEND PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But it causes possible panic bug. So Daniel Vacek reverted it later. But as suggested by Daniel Vacek, it is fine to using memblock to

[RESEND PATCH v10 4/6] mm/memblock: introduce memblock_search_pfn_regions()

2018-07-06 Thread Jia He
This helper is to find the memory region index of input pfn. Signed-off-by: Jia He --- include/linux/memblock.h | 2 ++ mm/memblock.c| 9 + 2 files changed, 11 insertions(+) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ca59883..b0f0307 100644

[RESEND PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. if pfn and pfn+1 are in the same memblock region, we can simply pfn++ instead of doing

[RESEND PATCH v10 4/6] mm/memblock: introduce memblock_search_pfn_regions()

2018-07-06 Thread Jia He
This helper is to find the memory region index of input pfn. Signed-off-by: Jia He --- include/linux/memblock.h | 2 ++ mm/memblock.c| 9 + 2 files changed, 11 insertions(+) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ca59883..b0f0307 100644

[RESEND PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. if pfn and pfn+1 are in the same memblock region, we can simply pfn++ instead of doing

[RESEND PATCH v10 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-07-06 Thread Jia He
Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He Reviewed-by: Pavel Tatashin

[RESEND PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-06 Thread Jia He
alid_pfn on arm64 - refine memblock_search_pfn_regions and pfn_valid_region Jia He (6): arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64 mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_

[RESEND PATCH v10 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-07-06 Thread Jia He
Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He Reviewed-by: Pavel Tatashin

[RESEND PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-06 Thread Jia He
alid_pfn on arm64 - refine memblock_search_pfn_regions and pfn_valid_region Jia He (6): arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64 mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_

[PATCH v10 4/6] mm/memblock: introduce memblock_search_pfn_regions()

2018-07-06 Thread Jia He
This helper is to find the memory region index of input pfn. Signed-off-by: Jia He --- include/linux/memblock.h | 2 ++ mm/memblock.c| 9 + 2 files changed, 11 insertions(+) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ca59883..b0f0307 100644

[PATCH v10 4/6] mm/memblock: introduce memblock_search_pfn_regions()

2018-07-06 Thread Jia He
This helper is to find the memory region index of input pfn. Signed-off-by: Jia He --- include/linux/memblock.h | 2 ++ mm/memblock.c| 9 + 2 files changed, 11 insertions(+) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ca59883..b0f0307 100644

[PATCH v10 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid()

2018-07-06 Thread Jia He
37us in my armv8a server(QDF2400 with 96G memory, pagesize 64k). Signed-off-by: Jia He --- include/linux/mmzone.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 57cdc42..83b1d11 100644 --- a/include/linux/mmzone.h +++

[PATCH v10 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid()

2018-07-06 Thread Jia He
37us in my armv8a server(QDF2400 with 96G memory, pagesize 64k). Signed-off-by: Jia He --- include/linux/mmzone.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 57cdc42..83b1d11 100644 --- a/include/linux/mmzone.h +++

[PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But it causes possible panic bug. So Daniel Vacek reverted it later. But as suggested by Daniel Vacek, it is fine to using memblock to

[PATCH v10 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-07-06 Thread Jia He
Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He Reviewed-by: Pavel Tatashin

[PATCH v10 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But it causes possible panic bug. So Daniel Vacek reverted it later. But as suggested by Daniel Vacek, it is fine to using memblock to

[PATCH v10 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-07-06 Thread Jia He
Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He Reviewed-by: Pavel Tatashin

[PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. if pfn and pfn+1 are in the same memblock region, we can simply pfn++ instead of doing

[PATCH v10 5/6] mm/memblock: introduce pfn_valid_region()

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. in early_pfn_valid(), we can record the last returned memblock region. If current pfn an

[PATCH v10 3/6] mm: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. if pfn and pfn+1 are in the same memblock region, we can simply pfn++ instead of doing

[PATCH v10 5/6] mm/memblock: introduce pfn_valid_region()

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But there is still some room for improvement. E.g. in early_pfn_valid(), we can record the last returned memblock region. If current pfn an

[PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But it causes possible panic bug. So Daniel Vacek reverted it later. But as suggested by Daniel Vacek, it is fine to using memblock to

[PATCH v10 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-06 Thread Jia He
From: Jia He Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") optimized the loop in memmap_init_zone(). But it causes possible panic bug. So Daniel Vacek reverted it later. But as suggested by Daniel Vacek, it is fine to using memblock to

Re: [PATCH v9 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-05 Thread Jia He
Hi Pavel, sorry for the late reply On 6/30/2018 1:07 AM, Pavel Tatashin Wrote: > On Thu, Jun 28, 2018 at 10:30 PM Jia He wrote: >> >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") optimized the loop in memmap_init_zo

Re: [PATCH v9 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-05 Thread Jia He
Hi Pavel, sorry for the late reply On 6/30/2018 1:07 AM, Pavel Tatashin Wrote: > On Thu, Jun 28, 2018 at 10:30 PM Jia He wrote: >> >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") optimized the loop in memmap_init_zo

Re: [PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-02 Thread Jia He
On 7/2/2018 7:40 PM, Michal Hocko Wrote: > On Fri 29-06-18 10:29:17, Jia He wrote: >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") tried to optimize the loop in memmap_init_zone(). But >> there is still some room

Re: [PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-02 Thread Jia He
On 7/2/2018 7:40 PM, Michal Hocko Wrote: > On Fri 29-06-18 10:29:17, Jia He wrote: >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") tried to optimize the loop in memmap_init_zone(). But >> there is still some room

Re: [PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-02 Thread Jia He
Hi Michal Thanks for the comments On 7/2/2018 7:40 PM, Michal Hocko Wrote: > On Fri 29-06-18 10:29:17, Jia He wrote: >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") tried to optimize the loop in memmap_init_zone(). But &g

Re: [PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-02 Thread Jia He
Hi Michal Thanks for the comments On 7/2/2018 7:40 PM, Michal Hocko Wrote: > On Fri 29-06-18 10:29:17, Jia He wrote: >> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >> where possible") tried to optimize the loop in memmap_init_zone(). But &g

Re: [PATCH v9 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-02 Thread Jia He
Hi, Pavel Thanks for the comments. On 6/30/2018 2:13 AM, Pavel Tatashin Wrote: >> +++ b/include/linux/early_pfn.h >> @@ -0,0 +1,34 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +/* Copyright (C) 2018 HXT-semitech Corp. */ >> +#ifndef __EARLY_PFN_H >> +#define __EARLY_PFN_H >> +#ifdef

Re: [PATCH v9 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-02 Thread Jia He
Hi, Pavel Thanks for the comments. On 6/30/2018 2:13 AM, Pavel Tatashin Wrote: >> +++ b/include/linux/early_pfn.h >> @@ -0,0 +1,34 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +/* Copyright (C) 2018 HXT-semitech Corp. */ >> +#ifndef __EARLY_PFN_H >> +#define __EARLY_PFN_H >> +#ifdef

[PATCH v9 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid()

2018-06-28 Thread Jia He
37us in my armv8a server(QDF2400 with 96G memory, pagesize 64k). Signed-off-by: Jia He --- include/linux/mmzone.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 57cdc42..ac34238 100644 --- a/include/linux/mmzone.h +++

[PATCH v9 3/6] arm: arm64: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-06-28 Thread Jia He
ary search in memblock_next_valid_pfn. Furthermore, if the pfn is in a *gap* of two memory region, skip to next region directly if possible. Signed-off-by: Jia He --- include/linux/early_pfn.h | 37 + 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/inc

[PATCH v9 6/6] mm: page_alloc: reduce unnecessary binary search in early_pfn_valid()

2018-06-28 Thread Jia He
37us in my armv8a server(QDF2400 with 96G memory, pagesize 64k). Signed-off-by: Jia He --- include/linux/mmzone.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 57cdc42..ac34238 100644 --- a/include/linux/mmzone.h +++

[PATCH v9 3/6] arm: arm64: page_alloc: reduce unnecessary binary search in memblock_next_valid_pfn()

2018-06-28 Thread Jia He
ary search in memblock_next_valid_pfn. Furthermore, if the pfn is in a *gap* of two memory region, skip to next region directly if possible. Signed-off-by: Jia He --- include/linux/early_pfn.h | 37 + 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/inc

[PATCH v9 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-06-28 Thread Jia He
arly_pfn.h Suggested-by: Daniel Vacek Signed-off-by: Jia He --- arch/arm/mm/init.c| 1 + arch/arm64/mm/init.c | 1 + include/linux/early_pfn.h | 34 ++ include/linux/mmzone.h| 11 +++ mm/page_alloc.c | 5 - 5 files changed, 51

[PATCH v9 5/6] arm: arm64: introduce pfn_valid_region()

2018-06-28 Thread Jia He
n the same memory region, we needn't do the unnecessary binary searches because memblock_is_nomap is the same result for whole memory region. Signed-off-by: Jia He --- include/linux/early_pfn.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/early_pfn.h

[PATCH v9 4/6] mm/memblock: introduce memblock_search_pfn_regions()

2018-06-28 Thread Jia He
This helper is to find the memory region index of input pfn. Signed-off-by: Jia He --- include/linux/memblock.h | 2 ++ mm/memblock.c| 9 + 2 files changed, 11 insertions(+) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ca59883..b0f0307 100644

[PATCH v9 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-06-28 Thread Jia He
arly_pfn.h Suggested-by: Daniel Vacek Signed-off-by: Jia He --- arch/arm/mm/init.c| 1 + arch/arm64/mm/init.c | 1 + include/linux/early_pfn.h | 34 ++ include/linux/mmzone.h| 11 +++ mm/page_alloc.c | 5 - 5 files changed, 51

[PATCH v9 5/6] arm: arm64: introduce pfn_valid_region()

2018-06-28 Thread Jia He
n the same memory region, we needn't do the unnecessary binary searches because memblock_is_nomap is the same result for whole memory region. Signed-off-by: Jia He --- include/linux/early_pfn.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/early_pfn.h

[PATCH v9 4/6] mm/memblock: introduce memblock_search_pfn_regions()

2018-06-28 Thread Jia He
This helper is to find the memory region index of input pfn. Signed-off-by: Jia He --- include/linux/memblock.h | 2 ++ mm/memblock.c| 9 + 2 files changed, 11 insertions(+) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ca59883..b0f0307 100644

[PATCH v9 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-06-28 Thread Jia He
Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He --- arch/arm/Kconfig | 4

[PATCH v9 1/6] arm: arm64: introduce CONFIG_HAVE_MEMBLOCK_PFN_VALID

2018-06-28 Thread Jia He
Make CONFIG_HAVE_MEMBLOCK_PFN_VALID a new config option so it can move memblock_next_valid_pfn to generic code file. All the latter optimizations are based on this config. The memblock initialization time on arm/arm64 can benefit from this. Signed-off-by: Jia He --- arch/arm/Kconfig | 4

[PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-06-28 Thread Jia He
pecific V4: - refine patches as suggested by Danial Vacek and Wei Yang - optimized on arm besides arm64 V3: - fix 2 issues reported by kbuild test robot V2: - rebase to mmotm latest - remain memblock_next_valid_pfn on arm64 - refine memblock_search_pfn_regions and pfn_valid_region Jia He

[PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-06-28 Thread Jia He
pecific V4: - refine patches as suggested by Danial Vacek and Wei Yang - optimized on arm besides arm64 V3: - fix 2 issues reported by kbuild test robot V2: - rebase to mmotm latest - remain memblock_next_valid_pfn on arm64 - refine memblock_search_pfn_regions and pfn_valid_region Jia He

[PATCH] crypto: arm64/aes-blk - fix and move skcipher_walk_done out of kernel_neon_begin,_end

2018-06-08 Thread Jia He
In a arm64 server(QDF2400),I met a similar might-sleep warning as [1]: [7.019116] BUG: sleeping function called from invalid context at ./include/crypto/algapi.h:416 [7.027863] in_atomic(): 1, irqs_disabled(): 0, pid: 410, name: cryptomgr_test [7.035106] 1 lock held by

[PATCH] crypto: arm64/aes-blk - fix and move skcipher_walk_done out of kernel_neon_begin,_end

2018-06-08 Thread Jia He
In a arm64 server(QDF2400),I met a similar might-sleep warning as [1]: [7.019116] BUG: sleeping function called from invalid context at ./include/crypto/algapi.h:416 [7.027863] in_atomic(): 1, irqs_disabled(): 0, pid: 410, name: cryptomgr_test [7.035106] 1 lock held by

Re: [PATCH v2] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm

2018-06-07 Thread Jia He
ks on hva_start/hva_end after converting it to > gfn_start/end and that being in pfn units the bits are zapped before > they risk to cause trouble. For this panic issue on arm64, I started another thread to discuss https://lkml.org/lkml/2018/5/2/61 -- Cheers, Jia > >> >>

Re: [PATCH v2] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm

2018-06-07 Thread Jia He
ks on hva_start/hva_end after converting it to > gfn_start/end and that being in pfn units the bits are zapped before > they risk to cause trouble. For this panic issue on arm64, I started another thread to discuss https://lkml.org/lkml/2018/5/2/61 -- Cheers, Jia > >> >>

Re: [PATCH v2] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm

2018-06-07 Thread Jia He
Hi Andrew On 6/8/2018 6:13 AM, Andrew Morton Wrote: > On Thu, 24 May 2018 13:38:05 -0700 Andrew Morton > wrote: >>> >>> Jia, Andrew, >>> >>> What is the status of this patch ? >>> >> >> I have it scheduled for 4.18-rc1, with a cc:stable for backporting. >> >> I'd normally put such a fix into

Re: [PATCH v2] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm

2018-06-07 Thread Jia He
Hi Andrew On 6/8/2018 6:13 AM, Andrew Morton Wrote: > On Thu, 24 May 2018 13:38:05 -0700 Andrew Morton > wrote: >>> >>> Jia, Andrew, >>> >>> What is the status of this patch ? >>> >> >> I have it scheduled for 4.18-rc1, with a cc:stable for backporting. >> >> I'd normally put such a fix into

Re: [PATCH v2] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm

2018-05-24 Thread Jia He
On 5/24/2018 5:01 PM, Suzuki K Poulose Wrote: > On 24/05/18 09:50, Jia He wrote: >> Hi Suzuki >> >> On 5/24/2018 4:44 PM, Suzuki K Poulose Wrote: >>> On 14/05/18 10:45, Suzuki K Poulose wrote: >>>> On 10/05/18 00:31, Andrew Morton wrote: >>>

Re: [PATCH v2] mm/ksm: ignore STABLE_FLAG of rmap_item->address in rmap_walk_ksm

2018-05-24 Thread Jia He
On 5/24/2018 5:01 PM, Suzuki K Poulose Wrote: > On 24/05/18 09:50, Jia He wrote: >> Hi Suzuki >> >> On 5/24/2018 4:44 PM, Suzuki K Poulose Wrote: >>> On 14/05/18 10:45, Suzuki K Poulose wrote: >>>> On 10/05/18 00:31, Andrew Morton wrote: >>>

[PATCH v3] KVM: arm/arm64: add WARN_ON if size is not PAGE_SIZE aligned in unmap_stage2_range

2018-05-20 Thread Jia He
There is a panic in armv8a server(QDF2400) under memory pressure tests (start 20 guests and run memhog in the host). -begin [35380.800950] BUG: Bad page state in process qemu-kvm pfn:dd0b6 [35380.805825] page:7fe003742d80

[PATCH v3] KVM: arm/arm64: add WARN_ON if size is not PAGE_SIZE aligned in unmap_stage2_range

2018-05-20 Thread Jia He
There is a panic in armv8a server(QDF2400) under memory pressure tests (start 20 guests and run memhog in the host). -begin [35380.800950] BUG: Bad page state in process qemu-kvm pfn:dd0b6 [35380.805825] page:7fe003742d80

Re: [PATCH v2 2/2] KVM: arm/arm64: harden unmap_stage2_ptes in case end is not PAGE_SIZE aligned

2018-05-18 Thread Jia He
On 5/18/2018 5:48 PM, Marc Zyngier Wrote: > On 18/05/18 10:27, Jia He wrote: >> If it passes addr=0x20292,size=0xfe00 to unmap_stage2_range-> >> ...->unmap_stage2_ptes, unmap_stage2_ptes will get addr=0x20292, >> end=0x20292fe00. After first while loop addr=0

Re: [PATCH v2 2/2] KVM: arm/arm64: harden unmap_stage2_ptes in case end is not PAGE_SIZE aligned

2018-05-18 Thread Jia He
On 5/18/2018 5:48 PM, Marc Zyngier Wrote: > On 18/05/18 10:27, Jia He wrote: >> If it passes addr=0x20292,size=0xfe00 to unmap_stage2_range-> >> ...->unmap_stage2_ptes, unmap_stage2_ptes will get addr=0x20292, >> end=0x20292fe00. After first while loop addr=0

<    1   2   3   4   5   6   7   >