From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755580AbdCTXOb (ORCPT ); Mon, 20 Mar 2017 19:14:31 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:58710 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753574AbdCTXO3 (ORCPT ); Mon, 20 Mar 2017 19:14:29 -0400 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 165.244.249.25 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Tue, 21 Mar 2017 08:13:54 +0900 From: Byungchul Park To: Peter Zijlstra CC: , , Subject: Re: [PATCH] sched: Wake up all non-exclusive waiters in __wake_up_common() Message-ID: <20170320231354.GI11100@X58A-UD3R> References: <1488932512-18999-1-git-send-email-byungchul.park@lge.com> <20170320104147.bqmwsnnzs7tdoepm@hirez.programming.kicks-ass.net> MIME-Version: 1.0 In-Reply-To: <20170320104147.bqmwsnnzs7tdoepm@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/21 08:14:25, Serialize by Router on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/21 08:14:26, Serialize complete at 2017/03/21 08:14:26 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 20, 2017 at 11:41:47AM +0100, Peter Zijlstra wrote: > On Wed, Mar 08, 2017 at 09:21:52AM +0900, Byungchul Park wrote: > > __wake_up_common() should wake up all non-exclusive waiters and > > exclusive waiters as many as nr_exclusive, but currently it does not. > > > > Consider a wait queue like the following for example: > > > > A(exclusive) -> B(non-exclusive) -> C(non-exclusive) > > > > Current code will wake up only A when nr_exclusive = 1, but has to wake > > up A, B and C. Make it do as we expect. > > You have the list oredered the wrong way around. We add exclusive > waiters to the tail, therefore we'll have woken up all the !exclusive > waiters before we start decrementing nr_exclusive. You're right. I proposed the patch because of __add_wait_queue_exclusive(), which queues an item at the head. But it was my mistake. Sorry.