All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mason <slash.tmp@free.fr>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [Semaphore API] down_interruptible_timeout
Date: Tue, 16 Jun 2015 17:43:04 +0200	[thread overview]
Message-ID: <55804408.2090507@free.fr> (raw)
In-Reply-To: <alpine.DEB.2.11.1506151855160.4120@nanos>

On 15/06/2015 18:56, Thomas Gleixner wrote:

> On Mon, 15 Jun 2015, Mason wrote:
> 
>> A) process-context kernel thread fills a FIFO and calls down(&fifo_empty);
>> B) ISR handles the FIFO-empty interrupt with up(&fifo_empty);
>>
>> However, in case something goes wrong and the interrupt never fires,
>> I don't want the process to be stuck in an uninterruptible sleep.
>>
>> Perhaps I can set a tiny timeout (e.g. 10 µs) and not worry about
>> the interruptible part for such a small duration? (Hmm, __down_common
>> calls schedule_timeout, which is jiffies-based. I don't think there
>> is a hrtimers flavor. So µs timeouts would be off the table?)
>>
>> Or I could use the interruptible version, and let the user kill the
>> operation if necessary.
> 
> Use a completion.

Thanks for the pointer. I will also read the following LKML thread.
http://thread.gmane.org/gmane.linux.kernel/664514

Regards.


      reply	other threads:[~2015-06-16 15:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15  8:43 [Semaphore API] down_interruptible_timeout Mason
2015-06-15 16:56 ` Thomas Gleixner
2015-06-16 15:43   ` Mason [this message]

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=55804408.2090507@free.fr \
    --to=slash.tmp@free.fr \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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.