Re: [PATCH] use spinlock instead of binary mutex in idt77252 driver



hi,

El Mon, Apr 23, 2007 at 09:40:19AM +0200 Eddie C. Dost ha dit:

as long as mutexes are not converted to nop when CONFIG_SMP is not
defined (I don't know what current kernels do), this is of course
correct. You need to verify the headerfiles for the above.

i just checked this, neither the mutex header nor implementation files
handle things different for CONFIG_SMP.

thanks for your comments

On Mon, Apr 23, 2007 at 09:40:26AM +0200, Matthias Kaehlcke wrote:
El Mon, Apr 23, 2007 at 09:16:08AM +0200 Eddie C. Dost ha dit:

Please note that the semaphore is used to lock the idt77252 config
tables among multiple users including atmsigd even on single processor
machines. Does this work with mutexes?

afaik mutexes have the same behaviour as binary semaphores that are
used as mutexes (always locked and unlocked by the same
process/thread):

".. the semaphore type can officially be considered to be on its way
out. New code should not use semaphores, and old code which uses
semaphores as mutexes should be converted over when an opportunity
presents itself."

http://lwn.net/Articles/167034/

please correct me if i'm wrong, i'm just doing my first steps with
linux kernel development

--
Matthias Kaehlcke
Linux Application Developer
Barcelona

You must have a plan. If you don't have a plan,
you'll become part of somebody else's plan
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH] use spinlock instead of binary mutex in idt77252 driver
    ... defined (I don't know what current kernels do), ... Does this work with mutexes? ... New code should not use semaphores, ... Pascalstrasse 67 ...
    (Linux-Kernel)
  • [PATCH] kernel/cpuset.c mutex conversion comment fix
    ... The conversion of kernel/cpuset from semaphores to mutexes ... I didn't know offhand the state of read-write mutexes, ... - * We have two global cpuset semaphores below. ... - * zero, then only attach_task, which holds both semaphores, can ...
    (Linux-Kernel)
  • Re: help w/ mutex
    ... Mutexes are not any faster than semaphores, as they both involve switch to ... > thread-dependant, they are merely count down dependant. ... a CriticalSection is probably what you ...
    (microsoft.public.win32.programmer.kernel)
  • Re: [patch 04/15] Generic Mutex Subsystem, add-atomic-call-func-x86_64.patch
    ... don't forget to compare this with our existing semaphore ... this means that mutexes will be _FAR MORE EXPENSIVE_ on ARM ... We'd be far better off sticking to semaphores ...
    (Linux-Kernel)
  • Re: help w/ mutex
    ... > Microsoft claims Mutexes are quicker, ... > Semaphores are non binary, they are based on a count-down, you can ... A semaphore can block a high priority thread ... the high priority thread to that of the lower priority thread. ...
    (microsoft.public.win32.programmer.kernel)