public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: tglx@linutronix.de, pbonzini@redhat.com, bigeasy@linutronix.de,
	rostedt@goodmis.org, torvalds@linux-foundation.org,
	will@kernel.org, joel@joelfernandes.org,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 3/5] rcuwait: Introduce prepare_to and finish_rcuwait
Date: Thu, 23 Apr 2020 11:23:14 +0200	[thread overview]
Message-ID: <20200423092314.GQ20730@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200422040739.18601-4-dave@stgolabs.net>

On Tue, Apr 21, 2020 at 09:07:37PM -0700, Davidlohr Bueso wrote:

> +static inline void prepare_to_rcuwait(struct rcuwait *w)
> +{
> +	rcu_assign_pointer(w->task, current);
> +}
> +
> +static inline void finish_rcuwait(struct rcuwait *w)
> +{
> +	WRITE_ONCE(w->task, NULL);

I think that wants to be:

	rcu_assign_pointer(w->task, NULL);

There is a special case in rcu_assign_pointer() that looses the barrier,
but it will keep the __rcu sparse people happy. That is w->task is
__rcu, and WRITE_ONCE ignores that etc.. blah.

The alternative is using RCU_INIT_POINTER() I suppose.

> +	__set_current_state(TASK_RUNNING);
> +}

  reply	other threads:[~2020-04-23  9:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22  4:07 [PATCH v3 -tip 0/5] kvm: Use rcuwait for vcpu blocking Davidlohr Bueso
2020-04-22  4:07 ` [PATCH 1/5] rcuwait: Fix stale wake call name in comment Davidlohr Bueso
2020-04-22  4:07 ` [PATCH 2/5] rcuwait: Let rcuwait_wake_up() return whether or not a task was awoken Davidlohr Bueso
2020-04-22  4:07 ` [PATCH 3/5] rcuwait: Introduce prepare_to and finish_rcuwait Davidlohr Bueso
2020-04-23  9:23   ` Peter Zijlstra [this message]
2020-04-22  4:07 ` [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait Davidlohr Bueso
2020-04-22  8:32   ` Paolo Bonzini
2020-04-22 10:14   ` Marc Zyngier
2020-04-23  8:41   ` Marc Zyngier
2020-04-23  8:57     ` Paolo Bonzini
2020-04-23  9:19       ` Peter Zijlstra
2020-04-23  9:26         ` Paolo Bonzini
2020-04-22  4:07 ` [PATCH 5/5] sched/swait: Reword some of the main description Davidlohr Bueso
2020-05-01 18:22   ` [tip: sched/core] " tip-bot2 for Davidlohr Bueso
2020-04-22 11:33 ` [PATCH v3 -tip 0/5] kvm: Use rcuwait for vcpu blocking Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2020-04-24  5:48 [PATCH v4 " Davidlohr Bueso
2020-04-24  5:48 ` [PATCH 3/5] rcuwait: Introduce prepare_to and finish_rcuwait 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=20200423092314.GQ20730@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=joel@joelfernandes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.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