From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753552AbdJKLVw (ORCPT ); Wed, 11 Oct 2017 07:21:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51230 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbdJKLVv (ORCPT ); Wed, 11 Oct 2017 07:21:51 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0D9377EA94 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: [PATCH 1/6] sched/wait: Add swq_has_sleepers() To: Peter Zijlstra , Davidlohr Bueso Cc: mingo@redhat.com, npiggin@gmail.com, paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, Davidlohr Bueso References: <20170905190022.1474-1-dave@stgolabs.net> <20170905190022.1474-2-dave@stgolabs.net> <20171011082749.7z23viezxyds2utx@hirez.programming.kicks-ass.net> From: Paolo Bonzini Message-ID: Date: Wed, 11 Oct 2017 13:21:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171011082749.7z23viezxyds2utx@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 11 Oct 2017 11:21:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/2017 10:27, Peter Zijlstra wrote: > On Tue, Sep 05, 2017 at 12:00:17PM -0700, Davidlohr Bueso wrote: >> Which is the equivalent of what we have in regular waitqueues. >> I'm not crazy about the name, but this also helps us get both >> apis closer -- which iirc comes originally from the -net folks. > > I'm confused. I don't see anything like this in the original waitqueue. > /** * wq_has_sleeper - check if there are any waiting processes * @wq_head: wait queue head * * Returns true if wq_head has waiting processes * * Please refer to the comment for waitqueue_active. */ static inline bool wq_has_sleeper(struct wait_queue_head *wq_head) { /* * We need to be sure we are in sync with the * add_wait_queue modifications to the wait queue. * * This memory barrier should be paired with one on the * waiting side. */ smp_mb(); return waitqueue_active(wq_head); } Paolo