From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752247AbcEQRaa (ORCPT ); Tue, 17 May 2016 13:30:30 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:34719 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbcEQRa2 (ORCPT ); Tue, 17 May 2016 13:30:28 -0400 Subject: Re: [PATCH v3 3/4] locking/rwsem: Improve reader wakeup code To: Waiman Long References: <1463093811-10684-1-git-send-email-Waiman.Long@hpe.com> <1463093811-10684-4-git-send-email-Waiman.Long@hpe.com> Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Davidlohr Bueso , Jason Low , Dave Chinner , Scott J Norton , Douglas Hatch From: Peter Hurley Message-ID: <573B5530.2060301@hurleysoftware.com> Date: Tue, 17 May 2016 10:30:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1463093811-10684-4-git-send-email-Waiman.Long@hpe.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/12/2016 03:56 PM, Waiman Long wrote: > In __rwsem_do_wake(), the reader wakeup code will assume a writer > has stolen the lock if the active reader/writer count is not 0. > However, this is not as reliable an indicator as the original > "< RWSEM_WAITING_BIAS" check. If another reader is present, the code > will still break out and exit even if the writer is gone. This patch > changes it to check the same "< RWSEM_WAITING_BIAS" condition to > reduce the chance of false positive. Nice. Reviewed-by: Peter Hurley