linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dick Hollenbeck <dick@softplc.com>
To: linux-rt-users <linux-rt-users@vger.kernel.org>
Subject: wait_event_interruptible_timeout() not sleeping accurately
Date: Fri, 22 Nov 2019 13:39:38 -0600	[thread overview]
Message-ID: <d2127c27-f53d-8b0c-5a44-6bdd6edd2204@softplc.com> (raw)


In a user thread I block on wait_event_interruptible_timeout() for about 3300 usecs or
until my threaded interrupt handler calls wake_up_interruptible() when the hardware event
happens.

This seems to work fine for the case when the event actually happens.  But for the timeout
case, the function wait_event_interruptible_timeout() is sleeping 9000 usecs or so rather
than 3300 usecs as requested.  I confirmed this by toggling a GPIO pin before and after
the call and feeding that signal to a logic analyzer.

The user thread is RT round robin at about a priority 5.

Am I doing something disallowed under PREEMPT_RT?
What could be the reason for the inaccurate wait_event_interruptible_timeout() timeout?


			ret = wait_event_interruptible_timeout(bh->rx_waitq,
				bh->rx_intr_flag,
				usecs_to_jiffies(aTimeoutUSecs) );


             reply	other threads:[~2019-11-22 19:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 19:39 Dick Hollenbeck [this message]
2019-11-25 17:31 ` wait_event_interruptible_timeout() not sleeping accurately Sebastian Andrzej Siewior

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=d2127c27-f53d-8b0c-5a44-6bdd6edd2204@softplc.com \
    --to=dick@softplc.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).