From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754158AbdCTKlz (ORCPT ); Mon, 20 Mar 2017 06:41:55 -0400 Received: from merlin.infradead.org ([205.233.59.134]:40796 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754120AbdCTKlx (ORCPT ); Mon, 20 Mar 2017 06:41:53 -0400 Date: Mon, 20 Mar 2017 11:41:47 +0100 From: Peter Zijlstra To: Byungchul Park Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [PATCH] sched: Wake up all non-exclusive waiters in __wake_up_common() Message-ID: <20170320104147.bqmwsnnzs7tdoepm@hirez.programming.kicks-ass.net> References: <1488932512-18999-1-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1488932512-18999-1-git-send-email-byungchul.park@lge.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.