From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751815AbcEQRqA (ORCPT ); Tue, 17 May 2016 13:46:00 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36697 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbcEQRp7 (ORCPT ); Tue, 17 May 2016 13:45:59 -0400 Subject: Re: [PATCH v3 2/4] locking/rwsem: Don't wake up one's own task To: Waiman Long References: <1463093811-10684-1-git-send-email-Waiman.Long@hpe.com> <1463093811-10684-3-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: <573B58D4.4090406@hurleysoftware.com> Date: Tue, 17 May 2016 10:45:56 -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-3-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: > As rwsem_down_read_failed() will queue itself and potentially call > __rwsem_do_wake(sem, RWSEM_WAKE_ANY), it is possible that a reader > will try to wake up its own task. This patch adds a check to make > sure that this won't happen. Although there's no particular harm in the current code, this at least spells out this condition is normal (ie., when a failed reader wakes itself while waking the other waiting readers). Reviewed-by: Peter Hurley