Re: [PATCH 3/5] rcuwait: Introduce prepare_to and finish_rcuwait

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
> +}



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux