On Mon, Apr 28, 2008 at 03:10:40PM +1000, David Chinner wrote:I'm glad you asked! Arjan, Ingo and I have been batting around something called a kcounter. I appear to have misplaced the patch right now, but the basic idea is that it returns you a cookie when you down(), which you then have to pass to the up()-equivalent. This gives you at least some of the assurances you get from mutexes. Though ... looking at XFS, you have 5 counting semaphores currently: 1. i_flock This one seems to be a mutex. I'd need to immerse myself in XFS for a couple of days to verify that though -- there's a lot of places that use it, and it doesn't have obvious lock/unlock pairing. Is it sometimes unlocked from a different thread than the one which locked it? If so, kcounters might be the right thing to use here. 2. l_flushsema This seems to be a completion. ie you're using it to wait for the log to be flushed. 3. q_flock Ow. ow. My brain hurts. What are these semantics? 4. b_iodonesema This should be a completion. It's used to wait for the io to be complete. 5. b_sema This looks like a mutex, but I think it's released in a different context from the one which acquires it. ----- Possibly XFS should be using constructs like wait_on_bit instead of semaphores. See the implementation of wait_on_buffer for an example. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." --
| Ingo Molnar | Re: [patch] paravirt: VDSO page is essential |
| Johannes Weiner | Re: Versioning file system |
| Matt Mackall | [PATCH 1/13] maps: Uninline some functions in the page walker |
| Greg KH | [patch 00/49] 2.6.25-stable review |
git: | |
| Johannes Schindelin | Re: [PATCH 1/4] Move redo merge code in a function |
| Dmitry Potapov | Re: [RFC] Git User's Survey 2008 |
| Johannes Schindelin | Re: [PATCH] Teach 'git apply' to look at $GIT_DIR/config |
| Shawn O. Pearce | Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins |
| Brian A. Seklecki | sshd_config(5) PermitRootLogin yes |
| Richard Stallman | Real men don't attack straw men |
| ropers | Re: low-MHz server |
| Diego Fernando Nieto Moreno | Intel DG33 Support |
| Holger Schurig | Re: Linux Wireless Mini-Summit -- Ottawa -- July 22, 2008 |
| Tilman Schmidt | Re: 2.6.25-rc8: FTP transfer errors |
| Eric Dumazet | Re: [rfc][patch 3/3] use SLAB_ALIGN_SMP |
| Lennert Buytenhek | [PATCH 21/39] mv643xx_eth: move port_receive() into its only caller |
| high memory | 14 hours ago | Linux kernel |
| semaphore access speed | 17 hours ago | Applications and Utilities |
| the kernel how to power off the machine | 18 hours ago | Linux kernel |
| Easter Eggs in windows XP | 21 hours ago | Windows |
| Shared swap partition | 22 hours ago | Linux general |
| Root password | 22 hours ago | Linux general |
| Where/when DNOTIFY is used? | 1 day ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 1 day ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 1 day ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 1 day ago | Linux general |
