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: <d4e6ca53-79bc-b0ac-1a60-9460fe1bf856@linux.intel.com>
Date:	Fri, 17 Jun 2016 07:59:25 -0700
From:	Arjan van de Ven <arjan@...ux.intel.com>
To:	Oleg Drokin <green@...uxhacker.ru>,
	Jeff Layton <jlayton@...chiereds.net>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Mailing List <linux-kernel@...r.kernel.org>, mingo@...hat.com,
	"J . Bruce Fields" <bfields@...ldses.org>
Subject: Re: initialize a mutex into locked state?

On 6/17/2016 7:54 AM, Oleg Drokin wrote:
>
> Yes, we can add all sorts of checks that have various impacts on code readability,
> we can also move code around that also have code readability and CPU impact.
>
> But in my discussion with Arjan he said this is a new use case that was not met before
> and suggested to mail it to the list.

I'm all in favor of having "end code" be as clear as possible wrt intent.
(and I will admit this is an curious use case, but not an insane silly one)

one other option is to make a wrapper

mutex_init_locked( )
{
	mutex_init()
	mutex_trylock()
}

that way the wrapper can be an inline in a header, but doesn't need to touch a wide
berth of stuff... while keeping the end code clear wrt intent

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ