Re: pagefaults ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14.06.2013 07:18, Lars Segerlund wrote:

>  I have an application which should be realtime but apparently
> generates page faults from a realtime context, I am trying to find a
> way to get a stacktrace when this occurs, does anybody have any ideas
> ?

Couuld you say more about your environment? Processor, kernel version,
what does you application do, how and when it is reproducible,
are these major or minor faults, ...?

If the system looks fine it is probably not the problem
I am hunting ( https://patchwork.kernel.org/patch/2581631/ )
but please look there whether you find some similarities.
I am still not able to reproduce that...

> I looked at ftrace and perf but haven't figured out how to get a
> trace from the app, but I figured this must have occured before so I
> better ask first.

For the start you can implant trace_printk into handle_pte_fault
to record the faulting address and then look in the /proc/<pid>/maps
where that address is.

For deciding when to stop the trace you can poll /proc/<pid>/task/<tid>/stat
and evaluate number of page faults. If you also enable tracing
the syscalls you can get an idea what the application was doing
right before it happened.

Basic questions:

- do you call mlockall(MCL_CURRENT | MCL_FUTURE) _before_ your
  threads are started?

- do the faulting threads allocate memory?

- do the faulting threads call kernel functions that might allocate memory?


Regards
-- 
                                      Stano

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux