lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070911153628.26ca02bc@laptopd505.fenrus.org>
Date:	Tue, 11 Sep 2007 15:36:28 +0100
From:	Arjan van de Ven <arjan@...radead.org>
To:	Matti Linnanvuori <mattilinnanvuori@...oo.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: Do not deprecate binary semaphore or do allow mutex in software
 interrupt contexts

On Tue, 11 Sep 2007 06:20:51 -0700 (PDT)
Matti Linnanvuori <mattilinnanvuori@...oo.com> wrote:

Hi,

> I thought of a scenario where it seems appropriate to use a binary
> semaphore or a mutex in a software interrupt context. If a device
> cannot interrupt when some important variable changes, it can be
> polled occasionally to update e.g. LEDs to indicate status. Such
> polling can be done most efficiently in timers that are software
> interrupts. Timers are more efficient than works because they do not
> have so much context switching overhead. If the access to the
> variables of the device must be serialized, a binary semaphore or a
> mutex is a natural choice. If user-space writing to the device is
> likely to change the status, it can make sense not to poll the status
> of the device at the same time. The timer could therefore sensibly
> call mutex_trylock.

what do you do if the trylock fails?

> Therefore, it seems wrong to me to deprecate
> binary semaphores and disallow the use of mutexes in software
> interrupt contexts.

to be honest, the scenario describe really smells of broken locking, in
fact it really sounds like it wants to use spinlocks instead 

Greetings,
   Arjan van de Ven
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ