Skip to contentSkip to conversation

arm64: mm: remove the redundant code

PATCH New Huang Shijie 2 participants 4 messages Apr 18, 2016 – Apr 19, 2016 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: mm: remove the redundant code

We already re-enable interrupts where necessary in the entry code, so there is no need to do it again in do_page fault. This patch removes the redundant code.

---
 arch/arm64/mm/fault.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/mm/fault.c +0 -4
index 95df28b..bdc193c 100644
@@ -212,10 +212,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 	tsk = current;
 	mm  = tsk->mm;
 
-	/* Enable interrupts if they were enabled in the parent context. */
-	if (interrupts_enabled(regs))
-		local_irq_enable();
-
 	/*
 	 * If we're in an interrupt or have no user context, we must not take
 	 * the fault.
Signature · 1 line
2.5.5
maintainer
#1 lore raw

PATCH 1/1 arm64: mm: remove the redundant code

Quoted 14 lines · Huang Shijie

We already re-enable interrupts where necessary in the entry code, so there is no need to do it again in do_page fault. This patch removes the redundant code.

---
 arch/arm64/mm/fault.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/mm/fault.c +0 -0
index 95df28b..bdc193c 100644

arch/arm64/mm/fault.c static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, · line 217

Quoted 6 lines
arch/arm64/mm/fault.c +0 -3
@@ -212,10 +212,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 	tsk = current;
 	mm  = tsk->mm;
 
-	/* Enable interrupts if they were enabled in the parent context. */
-	if (interrupts_enabled(regs))
-		local_irq_enable();

We indeed don't have to re-enable interrupts here as they have been enabled by the calling code in entry.S. But have you run this with CONFIG_TRACE_IRQFLAGS enabled? I don't think there is any issue, just a sanity check.

Signature · 1 line
Catalin
#2 lore raw

PATCH 1/1 arm64: mm: remove the redundant code

Quoted 4 lines · Catalin Marinas
Quoted 4 lines
arch/arm64/mm/fault.c +0 -0
@@ -212,10 +212,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
    tsk = current;
    mm  = tsk->mm;
 
Quoted 8 lines

arch/arm64/mm/fault.c static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, · line 217

Quoted 3 lines
arch/arm64/mm/fault.c +0 -3
-   /* Enable interrupts if they were enabled in the parent context. */
-   if (interrupts_enabled(regs))
-           local_irq_enable();

We indeed don't have to re-enable interrupts here as they have been enabled by the calling code in entry.S. But have you run this with CONFIG_TRACE_IRQFLAGS enabled? I don't think there is any issue, just a sanity check.

I tested this patch with the CONFIG_TRACE_IRQFLAGS/CONFIG_PROVE_LOCKING/CONFIG_DEBUG_LOCKDEP enabled, in my Juno board, it works fine.

Also I find that with this patch, if we want to check the lockdep stat with:
#cat /proc/lockdep_stats

The "redundant hardirq ons" become 0. Without this patch, the redundant hardirq ons" is a big number, such as 123444.

thanks
Huang Shijie
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

maintainer
#3 lore raw

PATCH 1/1 arm64: mm: remove the redundant code

Quoted 13 lines · Huang Shijie
Quoted 4 lines · Catalin Marinas
Quoted 4 lines
arch/arm64/mm/fault.c +0 -0
@@ -212,10 +212,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
    tsk = current;
    mm  = tsk->mm;
 
Quoted 8 lines

arch/arm64/mm/fault.c static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, · line 217

Quoted 3 lines
arch/arm64/mm/fault.c +0 -3
-   /* Enable interrupts if they were enabled in the parent context. */
-   if (interrupts_enabled(regs))
-           local_irq_enable();

We indeed don't have to re-enable interrupts here as they have been enabled by the calling code in entry.S. But have you run this with CONFIG_TRACE_IRQFLAGS enabled? I don't think there is any issue, just a sanity check.

Quoted 8 lines

I tested this patch with the CONFIG_TRACE_IRQFLAGS/CONFIG_PROVE_LOCKING/CONFIG_DEBUG_LOCKDEP enabled, in my Juno board, it works fine.

Also I find that with this patch, if we want to check the lockdep stat with:
#cat /proc/lockdep_stats

The "redundant hardirq ons" become 0. Without this patch, the redundant hardirq ons" is a big number, such as 123444.

Thanks for checking.

Will can pick this up for 4.7.

Signature · 1 line
Catalin