Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756896AbbFPPnU (ORCPT ); Tue, 16 Jun 2015 11:43:20 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:35772 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752721AbbFPPnK (ORCPT ); Tue, 16 Jun 2015 11:43:10 -0400 Message-ID: <55804408.2090507@free.fr> Date: Tue, 16 Jun 2015 17:43:04 +0200 From: Mason User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32.1 MIME-Version: 1.0 To: Thomas Gleixner CC: LKML , Ingo Molnar , Peter Zijlstra , Andrew Morton Subject: Re: [Semaphore API] down_interruptible_timeout References: <557E9030.6080901@free.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1151 Lines: 30 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/