All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Meduna <stano@meduna.org>
To: Lars Segerlund <lars.segerlund@gmail.com>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: pagefaults ...
Date: Fri, 14 Jun 2013 09:45:17 +0200	[thread overview]
Message-ID: <51BACA0D.2000907@meduna.org> (raw)
In-Reply-To: <CAF-VNaq1UQQW7MZUQ5N7nmvF_FFboXr4yn8CHaMzUGL6qndQXA@mail.gmail.com>

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


  reply	other threads:[~2013-06-14  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14  5:18 pagefaults Lars Segerlund
2013-06-14  7:45 ` Stanislav Meduna [this message]
2013-06-14 13:03   ` pagefaults Josh Cartwright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51BACA0D.2000907@meduna.org \
    --to=stano@meduna.org \
    --cc=lars.segerlund@gmail.com \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.