login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
April
»
14
Re: [PATCH] Replace completions with semaphores
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Peter Zijlstra
Subject:
Re: [PATCH] Replace completions with semaphores
Date: Monday, April 14, 2008 - 9:32 am
On Mon, 2008-04-14 at 08:58 -0700, Roland Dreier wrote:
quoted text
> > which ones exactly are these places that demand the use of a counting > > semaphore? I cannot think of a single place where it's the best choice, > > let alone one where it's the only choice. > > Two of the places that use semaphores are drivers/infiniband/hw/mthca > and drivers/net/mlx4 -- in both cases, the device firmware allows up to > "N" outstanding firmware commands to be in flight, and the driver uses a > semaphore to handle issuing firmware commands. That is, down() when we > want to issue a command, and up() when the firmware responds that the > command is complete. > > What would you suggest as a better way to code this? This is an honest > question -- there probably is a more elegant way to handle this > situation and I really would like to learn about it. > > Also, the argument that removing semaphores makes the kernel as a whole > better does make sense to me; I wouldn't be opposed to basically > open-coding semaphores in terms of wait_event() in the driver or > something like that, but I wouldn't say that such an implementation is > locally more readable or maintainable if we look only at the driver > code.
Yeah, I would open code it. But this is indeed a sane usage of the counting semaphore because there is no priority inversion. --
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Fri Apr 11, 2:00 pm)
Re: [PATCH] Replace completions with semaphores
, Daniel Walker
, (Fri Apr 11, 11:43 pm)
Re: [PATCH] Replace completions with semaphores
, Ingo Oeser
, (Sat Apr 12, 3:31 am)
Re: [PATCH] Replace completions with semaphores
, Peter Zijlstra
, (Sat Apr 12, 5:24 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Sat Apr 12, 10:26 am)
Re: [PATCH] Replace completions with semaphores
, Daniel Walker
, (Sat Apr 12, 11:01 am)
Re: [PATCH] Replace completions with semaphores
, Peter Zijlstra
, (Sat Apr 12, 11:05 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Sat Apr 12, 12:04 pm)
Re: [PATCH] Replace completions with semaphores
, Peter Zijlstra
, (Sat Apr 12, 12:16 pm)
Re: [PATCH] Replace completions with semaphores
, Roland Dreier
, (Sat Apr 12, 12:53 pm)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Sat Apr 12, 1:47 pm)
Re: [PATCH] Replace completions with semaphores
, Ingo Molnar
, (Sun Apr 13, 12:05 am)
Re: [PATCH] Replace completions with semaphores
, Ingo Molnar
, (Sun Apr 13, 12:08 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Sun Apr 13, 5:52 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Sun Apr 13, 5:57 am)
Re: [PATCH] Replace completions with semaphores
, Bart Van Assche
, (Sun Apr 13, 6:55 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Sun Apr 13, 7:22 am)
Re: [PATCH] Replace completions with semaphores
, Bart Van Assche
, (Sun Apr 13, 7:55 am)
Re: [PATCH] Replace completions with semaphores
, Ingo Molnar
, (Mon Apr 14, 8:39 am)
Re: [PATCH] Replace completions with semaphores
, Ingo Molnar
, (Mon Apr 14, 8:41 am)
Re: [PATCH] Replace completions with semaphores
, Roland Dreier
, (Mon Apr 14, 8:58 am)
Re: [PATCH] Replace completions with semaphores
, Peter Zijlstra
, (Mon Apr 14, 9:32 am)
Re: [PATCH] Replace completions with semaphores
, Jens Axboe
, (Mon Apr 14, 9:54 am)
Re: [PATCH] Replace completions with semaphores
, Arjan van de Ven
, (Mon Apr 14, 9:56 am)
Re: API documentation (was [PATCH] Replace completions wit ...
, Jonathan Corbet
, (Mon Apr 14, 10:12 am)
Re: API documentation (was [PATCH] Replace completions wit ...
, Peter Zijlstra
, (Mon Apr 14, 10:33 am)
Re: [PATCH] Replace completions with semaphores
, Andi Kleen
, (Mon Apr 14, 10:46 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Mon Apr 14, 10:46 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Mon Apr 14, 10:50 am)
Re: [PATCH] Replace completions with semaphores
, Peter Zijlstra
, (Mon Apr 14, 10:54 am)
Re: [PATCH] Replace completions with semaphores
, Daniel Walker
, (Mon Apr 14, 11:09 am)
Re: API documentation (was [PATCH] Replace completions wit ...
, Bart Van Assche
, (Mon Apr 14, 11:38 am)
Re: [PATCH] Replace completions with semaphores
, Andi Kleen
, (Mon Apr 14, 12:16 pm)
Re: [PATCH] Replace completions with semaphores
, Alan Cox
, (Mon Apr 14, 12:16 pm)
Re: [PATCH] Replace completions with semaphores
, Bart Van Assche
, (Mon Apr 14, 11:18 pm)
Re: [PATCH] Replace completions with semaphores
, Peter Zijlstra
, (Mon Apr 14, 11:46 pm)
Re: [PATCH] Replace completions with semaphores
, Bart Van Assche
, (Tue Apr 15, 12:17 am)
Re: [PATCH] Replace completions with semaphores
, Peter Zijlstra
, (Tue Apr 15, 1:44 am)
Re: [PATCH] Replace completions with semaphores
, Bart Van Assche
, (Tue Apr 15, 6:15 am)
Re: [PATCH] Replace completions with semaphores
, Linus Torvalds
, (Tue Apr 15, 9:09 am)
Re: [PATCH] Replace completions with semaphores
, Andi Kleen
, (Tue Apr 15, 9:27 am)
Re: [PATCH] Replace completions with semaphores
, Linus Torvalds
, (Tue Apr 15, 9:57 am)
Re: [PATCH] Replace completions with semaphores
, Ingo Molnar
, (Tue Apr 15, 10:05 am)
Re: [PATCH] Replace completions with semaphores
, Andi Kleen
, (Tue Apr 15, 10:15 am)
Re: [PATCH] Replace completions with semaphores
, Linus Torvalds
, (Tue Apr 15, 10:26 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Tue Apr 15, 10:41 am)
Re: [PATCH] Replace completions with semaphores
, Linus Torvalds
, (Tue Apr 15, 11:14 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Tue Apr 15, 11:50 am)
Re: [PATCH] Replace completions with semaphores
, Ingo Molnar
, (Wed Apr 16, 5:37 am)
Re: [PATCH] Replace completions with semaphores
, Andi Kleen
, (Wed Apr 16, 5:50 am)
Killable stat/readdir
, Matthew Wilcox
, (Wed Apr 16, 5:59 am)
Re: [PATCH] Replace completions with semaphores
, Ingo Oeser
, (Wed Apr 16, 9:07 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Wed Apr 16, 9:16 am)
Re: [PATCH] Replace completions with semaphores
, Oliver Neukum
, (Wed Apr 16, 9:31 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Wed Apr 16, 9:34 am)
Re: [PATCH] Replace completions with semaphores
, Oliver Neukum
, (Wed Apr 16, 9:42 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Wed Apr 16, 9:44 am)
Re: [PATCH] Replace completions with semaphores
, Roland Dreier
, (Wed Apr 16, 9:47 am)
Re: [PATCH] Replace completions with semaphores
, Arjan van de Ven
, (Wed Apr 16, 9:50 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Wed Apr 16, 9:58 am)
Re: [PATCH] Replace completions with semaphores
, Arjan van de Ven
, (Wed Apr 16, 10:08 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Wed Apr 16, 10:12 am)
Re: [PATCH] Replace completions with semaphores
, Matthew Wilcox
, (Wed Apr 16, 11:10 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 17/36] sysdev: detect multiple driver registrations
Sam Ravnborg
Re: [PATCH] kbuild: fix make V=1
Nick Piggin
Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures
Greg Kroah-Hartman
[PATCH 16/36] driver core: cpu: fix section mismatch in cpu.c:store_online
Greg Kroah-Hartman
[PATCH 22/36] PM: Make wakeup flags available whenever CONFIG_PM is set
git
:
Junio C Hamano
Re: [PATCH 1/2] Teach git-describe to display distances from tags.
Johannes Schindelin
Re: [PATCH 2/2] git-svn: support fetch with autocrlf on
Mark Burton
Re: [PATCH] builtin-branch: highlight current remote branches with an asterisk
Junio C Hamano
Re: [PATCH 6/6] Teach core object handling functions about gitlinks
Johan Herland
[PATCH 6/7] Softrefs: Administrivia associated with softrefs subsystem and git-sof...
linux-netdev
:
Jarek Poplawski
Re: [PATCH] flush_work_sync vs. flush_scheduled_work Re: [PATCH] PHYLIB: IRQ event...
Lennert Buytenhek
Re: Distributed Switch Architecture(DSA)
Daniel Schaffrath
Re: tcp bw in 2.6
Guo-Fu Tseng
Re: jme: UDP checksum error, and lots of them
Gerrit Renker
[PATCH 37/37] dccp: Debugging functions for feature negotiation
openbsd-misc
:
Conor
Re: RFID Reader
Josh Grosse
ssh/sshd challenge-response seems to have stopped working in -current
Pieter Verberne
File collision while using pkg_add
Stuart Henderson
Re: SquidGuard problem
Community First Financial
Teacher A+ Loan
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
ath9k: Added get_survey callback in order to get channel noise
Linux Kernel Mailing List
ALSA: snd-usb-caiaq: Do not expose hardware input mode 0 of A4DJ
Linux Kernel Mailing List
tracing: protect reader of cmdline output
Linux Kernel Mailing List
kconfig: recalc symbol value before showing search results
Colocation donated by:
Syndicate