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: <1410946476.9389.32.camel@linux-t7sj.site>
Date:	Wed, 17 Sep 2014 11:34:37 +0200
From:	Davidlohr Bueso <dbueso@...e.de>
To:	Jason Low <jason.low2@...com>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>,
	Tim Chen <tim.c.chen@...ux.intel.com>,
	Peter Hurley <peter@...leysoftware.com>,
	linux-kernel@...r.kernel.org,
	Aswin Chandramouleeswaran <aswin@...com>,
	Chegu Vinod <chegu_vinod@...com>
Subject: Re: [PATCH v3] locking/rwsem: Avoid double checking before try
 acquiring write lock

On Tue, 2014-09-16 at 17:16 -0700, Jason Low wrote:
> Commit 9b0fc9c09f1b checks for if there are known active lockers
> in order to avoid write trylocking using expensive cmpxchg() when
> it likely wouldn't get the lock.

Ah, I remember you had this one in your queue for some time :)

> However, a subsequent patch was added such that we directly
> check for sem->count == RWSEM_WAITING_BIAS right before trying
> that cmpxchg(). Thus, commit 9b0fc9c09f1b now just adds overhead.
> This patch modifies it so that we only do a check for if
> count == RWSEM_WAITING_BIAS.
> 
> Also, add a comment on why we do an "extra check" of count
> before the cmpxchg().

heh, so people don't try to remove the "redundant" check!

> Cc: Peter Hurley <peter@...leysoftware.com>
> Cc: Tim Chen <tim.c.chen@...ux.intel.com>

Acked-by: Davidlohr Bueso <dave@...olabs.net>

> Signed-off-by: Jason Low <jason.low2@...com>

--
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