Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1206098

Re: [PATCH] ipc/sem.c: Update/correct memory barriers

From Oleg Nesterov <oleg@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] ipc/sem.c: Update/correct memory barriers
Date 2015-08-12 15:40 +0200
Message-ID <pWEqa-5Pp-69@gated-at.bofh.it> (permalink)
References <pVD33-4W3-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 08/09, Manfred Spraul wrote:
>
>  /*
> + * spin_unlock_wait() and !spin_is_locked() are not memory barriers, they
> + * are only control barriers.
> + * The code must pair with spin_unlock(&sem->lock) or
> + * spin_unlock(&sem_perm.lock), thus just the control barrier is insufficient.
> + *
> + * smp_rmb() is sufficient, as writes cannot pass the control barrier.
> + */
> +#define ipc_smp_acquire__after_spin_is_unlocked()	smp_rmb()

Agreed.



But to remind, this can have more users. In particular, task_work_run()
which currently does mb() after spin_unlock_wait().

Can someone suggest a good "generic" name for this helper so that we can
move it into include/linux/spinlock.h?

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] ipc/sem.c: Update/correct memory barriers Manfred Spraul <manfred@colorfullife.com> - 2015-08-09 20:00 +0200
  Re: [PATCH] ipc/sem.c: Update/correct memory barriers Peter Zijlstra <peterz@infradead.org> - 2015-08-10 10:20 +0200
  Re: [PATCH] ipc/sem.c: Update/correct memory barriers Oleg Nesterov <oleg@redhat.com> - 2015-08-12 15:40 +0200

csiph-web