[LITMUS^RT] Modifying Page Table Entry in gsnedf_schedule()

Björn Brandenburg bbb at mpi-sws.org
Fri Sep 19 10:25:57 CEST 2014


On 19 Sep 2014, at 08:12, Christopher Kenna <cjk at cs.unc.edu> wrote:

> The stack traces might have been useful in determining the call path into gsnedf_schedule(). Why did you remove them? It's hard to say anything about the state of interrupts, especially if there's no context around how gsnedf_schedule() was called.
> 
>  -- Chris

Indeed, please don't truncate error reports; it makes diagnosing issues much more complicated.

> On Thu, Sep 18, 2014 at 8:18 PM, Namhoon Kim <namhoonk at cs.unc.edu> wrote:
> Hi All,
> 
> I'd like to modify page permissions to invoke a page fault. So, I used set_pte() with modified pte access bits in gsnedf_schedule() . According to kernel documentation (https://www.kernel.org/doc/Documentation/cachetlb.txt), I should call flush_cache_page() before set_pte() and call flush_tlb_page() after set_pte(). But, when I run several rtspin tasks, the following warning messages are shown.
> 
> 3194 P0 [vprintk_emit at kernel/printk.c:1564]: 4------------[ cut here ]------------
> 3195 P0 [vprintk_emit at kernel/printk.c:1564]: 4WARNING: at kernel/smp.c:244 smp_call_function_single+0x12f/0x190()
> 3196 P0 [vprintk_emit at kernel/printk.c:1564]: dModules linked in:3197 P0 [vprintk_emit at kernel/printk.c:1564]: 
> 3198 P0 [vprintk_emit at kernel/printk.c:1564]: dCPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W    3.10.5-kvm-test-pagefault #223
> 3199 P0 [vprintk_emit at kernel/printk.c:1564]: dHardware name:  , BIOS QEMU 01/01/2007
> ~~~(stack traces)
> 
> The codes at kernel/smp.c:244: (https://github.com/LITMUS-RT/litmus-rt/blob/master/kernel/smp.c#L243)
> /*
>  * Can deadlock when called with interrupts disabled.
>  * We allow cpu's that are not yet online though, as no one else can
>  * send smp call function interrupt to this cpu and as such deadlocks
>  * can't happen.
>  */
> 
>  
> WARN_ON_ONCE(cpu_online(this_cpu) && irqs_disabled
> ()
>                 && !
> oops_in_progress);
> Are interrupts disabled when we enter gsnedf_schedule()? Does anyone know how to modify page access bits in schedule() properly?

Yes, of course. Interrupts are always disabled while scheduling in Linux to defend against scheduler invocations within interrupts. You can easily see this for yourself by observing that gsnedf_schedule() is called from within schedule(), which disables all interrupts. 

- Björn





More information about the litmus-dev mailing list