mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Davidlohr Bueso <dave@stgolabs.net>
Cc: mingo@redhat.com, npiggin@gmail.com, paulmck@linux.vnet.ibm.com,
	linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 1/6] sched/wait: Add swq_has_sleepers()
Date: Wed, 11 Oct 2017 13:21:47 +0200	[thread overview]
Message-ID: <ea81e3d1-3c2f-6fca-354f-7a980e333852@redhat.com> (raw)
In-Reply-To: <20171011082749.7z23viezxyds2utx@hirez.programming.kicks-ass.net>

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

  reply	other threads:[~2017-10-11 11:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 19:00 [PATCH 0/6] swait: Introduce and use swq_has_sleepers Davidlohr Bueso
2017-09-05 19:00 ` [PATCH 1/6] sched/wait: Add swq_has_sleepers() Davidlohr Bueso
2017-10-11  8:27   ` Peter Zijlstra
2017-10-11 11:21     ` Paolo Bonzini [this message]
2017-10-11 11:29       ` Peter Zijlstra
2017-09-05 19:00 ` [PATCH 2/6] kvm,async_pf: Use swq_has_sleepers() Davidlohr Bueso
2017-09-05 19:00 ` [PATCH 3/6] kvm,lapic: Justify use of swait_activate() Davidlohr Bueso
2017-09-05 19:00 ` [PATCH 4/6] x86,kvm: Fix apf_task_wake_one() serialization Davidlohr Bueso
2017-09-10  9:20   ` Paolo Bonzini
2017-09-10  9:24     ` Paolo Bonzini
2017-10-12  8:23       ` Peter Zijlstra
2017-09-05 19:00 ` [PATCH 5/6] kvm: Serialize wq active checks in kvm_vcpu_wake_up() Davidlohr Bueso
2017-09-05 19:00 ` [PATCH 6/6] kvm,powerpc: Serialize wq active checks in ops->vcpu_kick Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea81e3d1-3c2f-6fca-354f-7a980e333852@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®