Subject: Re: [RFC PATCH] powerpc/mm/thp: Make page table walk safe against thp split/collapse

From: Benjamin Herrenschmidt <[email-masked]>
Date: Tue, 24 Mar 2015 19:55:17 +1100

On Tue, 2015-03-24 at 11:23 +0530, Aneesh Kumar K.V wrote:

> >>  	/* assume we don't have huge pages in vmalloc space... */
> >>  	addr = (pte_pfn(*p) << PAGE_SHIFT) | (addr & ~PAGE_MASK);
> >> +	local_irq_restore(flags);
> >>  	return __va(addr);
> >>  }
> >
> > This is called in real mode, I don't like the debug stuff that can
> > happen inside local_irq_* in that context. Can you either pounce that
> > to the higher level callers (and so not do it in real mode at all) or
> > use a lower level variant ? (I prefer going for the callers).
> >
> 
> Which debug stuff ? the dump_stack print in
> find_linux_pte_or_hugepte ?.

No, local_save/irq_restore

>  One of the reason I endup using pr_info and
> not WARN_ON is that the later didn't work in real mode. Or are you
> suggesting that we don't need to track for irqs_disabled for real-mode ?
> I was not sure whether we avoid taking an IPI when we are in real mode. 

We take no interrupts in real mode (we run with EE off). Just pounce the
local_irq_save/restore to the upper level callers in the handful of virt
mode cases where we call into these functions.

Cheers,
Ben.