* [4.4-rc6-rt1 PATCH 0/2] ARM: am437x: boot test report [not found] ` <5696B025.8020909@ti.com> @ 2016-01-14 20:11 ` Grygorii Strashko 2016-01-14 21:30 ` Russell King - ARM Linux 0 siblings, 1 reply; 4+ messages in thread From: Grygorii Strashko @ 2016-01-14 20:11 UTC (permalink / raw) To: linux-arm-kernel Hi Sebastian, On 01/13/2016 10:14 PM, Grygorii Strashko wrote: > On 01/13/2016 01:41 PM, Grygorii Strashko wrote: >> On 01/12/2016 07:15 PM, Sebastian Andrzej Siewior wrote: >>> * Grygorii Strashko | 2015-12-28 20:00:09 [+0200]: >>> >>> >>>> 3) Seems there are some problem with HIGHMEM :(. System crashes if I'm trying >>>> to run hackbench (see log 1). I can run hackbench only if HIGHMEM is disabled. >>>> I've also tried to disable CONFIG_CPU_SW_DOMAIN_PAN, CONFIG_ARM_PATCH_PHYS_VIRT, >>>> and CONFIG_CPUSETS, before disabling HIGHMEM. >>>> Sorry, I'll not able to investigate it further because of Christmas holidays here. >>> >>> I see. It seems not to trigger anything on x86. >> >> Yah. I saw other reports - it seems this issue is not triggered on ARM SMP also >> (as per report from Tim Sander). Will try to dig deeper. >> > > I did more tests, but still don't know what is wrong. > 1) vanilla 4.4 - no issue > 2) 4.4-rt: CONFIG_PREEMPT_RT_BASE=n and CONFIG_PREEMPT_RT_FULL=n -- no issue > 3) 4.4-rt: CONFIG_DEBUG_HIGHMEM=y -- issue is present log1 > 4) 4.4-rt: this is interesting ;) > I can run hackbench few times without issues If I run hackbench with RT priority (log2) > But I got crash immediately once I run it using non-RT priorities. Seems I've found root cause of the issue - FIX_KMAP_BEGIN offset need to be taken into account in switch_kmaps() and below diff fixes this issue for me. What I'm not fully understand is why I'm the only one who hit this issue :( New functionality was added by commit: commit a5f4c561b3b19a9bc43a81da6382b0098ebbc1fb ARM: 8415/1: early fixmap support for earlycon and it is enabled by default. Luckiness :( diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index deabc36..b9b4f9c 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c @@ -167,7 +167,7 @@ void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p) * Clear @prev's kmap_atomic mappings */ for (i = 0; i < prev_p->kmap_idx; i++) { - int idx = i + KM_TYPE_NR * smp_processor_id(); + int idx = FIX_KMAP_BEGIN + i + KM_TYPE_NR * smp_processor_id(); set_fixmap_pte(idx, __pte(0)); } @@ -175,7 +175,7 @@ void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p) * Restore @next_p's kmap_atomic mappings */ for (i = 0; i < next_p->kmap_idx; i++) { - int idx = i + KM_TYPE_NR * smp_processor_id(); + int idx = FIX_KMAP_BEGIN + i + KM_TYPE_NR * smp_processor_id(); if (!pte_none(next_p->kmap_pte[i])) set_fixmap_pte(idx, next_p->kmap_pte[i]); -- regards, -grygorii ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [4.4-rc6-rt1 PATCH 0/2] ARM: am437x: boot test report 2016-01-14 20:11 ` [4.4-rc6-rt1 PATCH 0/2] ARM: am437x: boot test report Grygorii Strashko @ 2016-01-14 21:30 ` Russell King - ARM Linux 2016-01-15 11:35 ` Grygorii Strashko 0 siblings, 1 reply; 4+ messages in thread From: Russell King - ARM Linux @ 2016-01-14 21:30 UTC (permalink / raw) To: linux-arm-kernel On Thu, Jan 14, 2016 at 10:11:09PM +0200, Grygorii Strashko wrote: > diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c > index deabc36..b9b4f9c 100644 > --- a/arch/arm/mm/highmem.c > +++ b/arch/arm/mm/highmem.c > @@ -167,7 +167,7 @@ void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p) > * Clear @prev's kmap_atomic mappings > */ > for (i = 0; i < prev_p->kmap_idx; i++) { > - int idx = i + KM_TYPE_NR * smp_processor_id(); > + int idx = FIX_KMAP_BEGIN + i + KM_TYPE_NR * smp_processor_id(); > > set_fixmap_pte(idx, __pte(0)); > } > @@ -175,7 +175,7 @@ void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p) > * Restore @next_p's kmap_atomic mappings > */ > for (i = 0; i < next_p->kmap_idx; i++) { > - int idx = i + KM_TYPE_NR * smp_processor_id(); > + int idx = FIX_KMAP_BEGIN + i + KM_TYPE_NR * smp_processor_id(); > > if (!pte_none(next_p->kmap_pte[i])) > set_fixmap_pte(idx, next_p->kmap_pte[i]); This looks like it introduces the 4th and 5th copies of the same calcuation, so can I suggest that we do this to prevent this kind of error? diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index d02f8187b1cc..61f0d5941116 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c @@ -34,6 +34,11 @@ static inline pte_t get_fixmap_pte(unsigned long vaddr) return *ptep; } +static unsigned int fixmap_idx(int type) +{ + return FIX_KMAP_BEGIN + type + KM_TYPE_NR * smp_processor_id(); +} + void *kmap(struct page *page) { might_sleep(); @@ -79,7 +84,7 @@ void *kmap_atomic(struct page *page) type = kmap_atomic_idx_push(); - idx = FIX_KMAP_BEGIN + type + KM_TYPE_NR * smp_processor_id(); + idx = fixmap_idx(type); vaddr = __fix_to_virt(idx); #ifdef CONFIG_DEBUG_HIGHMEM /* @@ -106,7 +111,7 @@ void __kunmap_atomic(void *kvaddr) if (kvaddr >= (void *)FIXADDR_START) { type = kmap_atomic_idx(); - idx = FIX_KMAP_BEGIN + type + KM_TYPE_NR * smp_processor_id(); + idx = fixmap_idx(type); if (cache_is_vivt()) __cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE); @@ -138,7 +143,7 @@ void *kmap_atomic_pfn(unsigned long pfn) return page_address(page); type = kmap_atomic_idx_push(); - idx = FIX_KMAP_BEGIN + type + KM_TYPE_NR * smp_processor_id(); + idx = fixmap_idx(type); vaddr = __fix_to_virt(idx); #ifdef CONFIG_DEBUG_HIGHMEM BUG_ON(!pte_none(get_fixmap_pte(vaddr))); -- RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [4.4-rc6-rt1 PATCH 0/2] ARM: am437x: boot test report 2016-01-14 21:30 ` Russell King - ARM Linux @ 2016-01-15 11:35 ` Grygorii Strashko 2016-01-15 11:36 ` Russell King - ARM Linux 0 siblings, 1 reply; 4+ messages in thread From: Grygorii Strashko @ 2016-01-15 11:35 UTC (permalink / raw) To: linux-arm-kernel Hi Russell, On 01/14/2016 11:30 PM, Russell King - ARM Linux wrote: > On Thu, Jan 14, 2016 at 10:11:09PM +0200, Grygorii Strashko wrote: >> diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c >> index deabc36..b9b4f9c 100644 >> --- a/arch/arm/mm/highmem.c >> +++ b/arch/arm/mm/highmem.c >> @@ -167,7 +167,7 @@ void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p) >> * Clear @prev's kmap_atomic mappings >> */ >> for (i = 0; i < prev_p->kmap_idx; i++) { >> - int idx = i + KM_TYPE_NR * smp_processor_id(); >> + int idx = FIX_KMAP_BEGIN + i + KM_TYPE_NR * smp_processor_id(); >> >> set_fixmap_pte(idx, __pte(0)); >> } >> @@ -175,7 +175,7 @@ void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p) >> * Restore @next_p's kmap_atomic mappings >> */ >> for (i = 0; i < next_p->kmap_idx; i++) { >> - int idx = i + KM_TYPE_NR * smp_processor_id(); >> + int idx = FIX_KMAP_BEGIN + i + KM_TYPE_NR * smp_processor_id(); >> >> if (!pte_none(next_p->kmap_pte[i])) >> set_fixmap_pte(idx, next_p->kmap_pte[i]); > > This looks like it introduces the 4th and 5th copies of the same > calcuation, so can I suggest that we do this to prevent this kind > of error? > > diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c > index d02f8187b1cc..61f0d5941116 100644 > --- a/arch/arm/mm/highmem.c > +++ b/arch/arm/mm/highmem.c > @@ -34,6 +34,11 @@ static inline pte_t get_fixmap_pte(unsigned long vaddr) > return *ptep; > } > > +static unsigned int fixmap_idx(int type) > +{ > + return FIX_KMAP_BEGIN + type + KM_TYPE_NR * smp_processor_id(); > +} > + This looks very reasonable - I'll updated and re-send. Would you agree if I'll add your Signed-off-by: in final patch? Thanks for review. [...] -- regards, -grygorii ^ permalink raw reply [flat|nested] 4+ messages in thread
* [4.4-rc6-rt1 PATCH 0/2] ARM: am437x: boot test report 2016-01-15 11:35 ` Grygorii Strashko @ 2016-01-15 11:36 ` Russell King - ARM Linux 0 siblings, 0 replies; 4+ messages in thread From: Russell King - ARM Linux @ 2016-01-15 11:36 UTC (permalink / raw) To: linux-arm-kernel On Fri, Jan 15, 2016 at 01:35:33PM +0200, Grygorii Strashko wrote: > This looks very reasonable - I'll updated and re-send. > Would you agree if I'll add your Signed-off-by: in final patch? Yes, that's fine. Please use: Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Thanks. -- RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-15 11:36 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1451325611-21678-1-git-send-email-grygorii.strashko@ti.com> [not found] ` <20160112171556.GB31009@linutronix.de> [not found] ` <569637ED.1030304@ti.com> [not found] ` <5696B025.8020909@ti.com> 2016-01-14 20:11 ` [4.4-rc6-rt1 PATCH 0/2] ARM: am437x: boot test report Grygorii Strashko 2016-01-14 21:30 ` Russell King - ARM Linux 2016-01-15 11:35 ` Grygorii Strashko 2016-01-15 11:36 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).