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: <20180515082547.GU12217@hirez.programming.kicks-ass.net>
Date:   Tue, 15 May 2018 10:25:47 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Waiman Long <longman@...hat.com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        Davidlohr Bueso <dave@...olabs.net>,
        "Theodore Y. Ts'o" <tytso@....edu>,
        Oleg Nesterov <oleg@...hat.com>,
        Amir Goldstein <amir73il@...il.com>, Jan Kara <jack@...e.cz>
Subject: Re: [RFC PATCH v2 1/2] locking/rwsem: Add a new
 RWSEM_WRITER_OWNED_NOSPIN flag

On Mon, May 14, 2018 at 03:31:06PM -0400, Waiman Long wrote:
> There are use cases where a rwsem can be acquired by one task, but
> released by another task. In thess cases, it may not be appropriate
> for the lock waiters to spin on the task that acquires the lock.
> One example will be the filesystem freeze/thaw code.
> 
> To handle such use cases, a new RWSEM_WRITER_OWNED_NOSPIN
> flag can now be set in the owner field of the rwsem by the new
> rwsem_set_writer_owned_nospin() function to indicate that the rwsem is
> writer owned, but optimistic spinning on the rwsem should be disabled.
> 
> Later on, the new rwsem_set_writer_owned() function can be called to
> set the new owner, if it is known. This function should not be called
> without a prior rwsem_set_writer_owned_nospin() call.

Urgh.. no please don't do this. Aside from the horrible naming, do not
expose 'set-owner' semantics. Can't we just stick to the existing
_non_owner() interface without further polluting the API?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ