linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ahmed S. Darwish" <a.darwish@linutronix.de>
To: Dipen Patel <dipenp@nvidia.com>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: Multi pthreaded RT application - mlock doubt
Date: Tue, 25 May 2021 09:26:58 +0200	[thread overview]
Message-ID: <YKymwnknCImO30CU@lx-t490> (raw)
In-Reply-To: <896cf71c-f610-961a-9d30-8a82d433e0f6@nvidia.com>

On Wed, Mar 31, 2021 at 07:06:26PM -0700, Dipen Patel wrote:
> Hi,
>
> I was following
> https://rt.wiki.kernel.org/index.php/Threaded_RT-application_with_memory_locking_and_stack_handling_example
> with some below changes:
>

The example above is a bit inaccurate, as it prefaults the thread's
stack much later than it should be.

...

>
> thread_fn {
> 	getrusage(RUSAGE_SELF, &usage);>
> 	print and save usage.ruminflt;
> 	prove_thread_stack_use_is_safe
> 	getrusage(RUSAGE_SELF, &usage);
> 	print usage.ruminflt - last_saved_cnt;
> }
>
> I observed there are still page faults.

Well, in the snippet above, there will obviously be page faults, as
you're also measuring the faults generated by
prove_thread_stack_use_is_safe(). On first invocation, this is actually
the method prefaulting the thread stack.

To make sure the discussion is more concrete, can you please send a
complete, compilable, *.c file?

Good luck,

--
Ahmed S. Darwish
Linutronix GmbH

  parent reply	other threads:[~2021-05-25  7:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  2:06 Multi pthreaded RT application - mlock doubt Dipen Patel
2021-05-25  3:08 ` Dipen Patel
2021-05-25  7:26 ` Ahmed S. Darwish [this message]
2021-05-25 22:24   ` Dipen Patel
2021-05-26  8:31     ` Ahmed S. Darwish
2021-05-26 10:26       ` John Ogness

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=YKymwnknCImO30CU@lx-t490 \
    --to=a.darwish@linutronix.de \
    --cc=dipenp@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).