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


Groups > linux.kernel > #1602548

Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and to_kthread()

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and to_kthread()
Date 2017-03-16 16:40 +0100
Message-ID <tlFFo-lI-5@gated-at.bofh.it> (permalink)
References <tlqmZ-6ih-3@gated-at.bofh.it> <tlF2H-8g9-19@gated-at.bofh.it> <tlFFo-lI-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 16, 2017 at 11:33:01AM -0400, Tejun Heo wrote:
> > And perhaps we should add another helper, say,
> > 
> > 	#define lockless_assign_pointer(ptr, val)	\
> > 		smp_store_release(&ptr, val)
> > 
> > for set_kthread_struct() ? it can have more users.
> > 
> > Not that I think you should change your patch, I am just asking.
> 
> Ah yeah, that would look better.  I vaguely remembered the new macro
> but couldn't quite remember it fully. :)  Will update the patch.

Oops, as for adding lockless_assign_pointer(), wouldn't smp_wmb() be a
better match for smp_read_barrier_depends()?  ISTR acquire/release
pairs being more expensive on some archs.

Thanks.

-- 
tejun

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


Thread

[PATCH 1/2] kthread: add barriers to set_kthread_struct() and  to_kthread() Tejun Heo <tj@kernel.org> - 2017-03-16 00:20 +0100
  Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and         to_kthread() Oleg Nesterov <oleg@redhat.com> - 2017-03-16 16:00 +0100
    Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and  to_kthread() Tejun Heo <tj@kernel.org> - 2017-03-16 16:40 +0100
      Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and         to_kthread() Oleg Nesterov <oleg@redhat.com> - 2017-03-16 16:50 +0100
      Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and  to_kthread() Peter Zijlstra <peterz@infradead.org> - 2017-03-16 17:00 +0100
        Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and  to_kthread() Peter Zijlstra <peterz@infradead.org> - 2017-03-16 17:20 +0100
        Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and  to_kthread() Tejun Heo <tj@kernel.org> - 2017-03-16 17:20 +0100
    Re: [PATCH 1/2] kthread: add barriers to set_kthread_struct() and  to_kthread() Tejun Heo <tj@kernel.org> - 2017-03-16 16:40 +0100

csiph-web