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


Groups > linux.kernel > #1202837

Re: [PATCH] coredump: Replace opencoded set_mask_bits()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] coredump: Replace opencoded set_mask_bits()
Date 2015-08-07 17:50 +0200
Message-ID <pUS4a-3Sp-17@gated-at.bofh.it> (permalink)
References <pUL2G-2d0-31@gated-at.bofh.it> <pUOtA-6YZ-19@gated-at.bofh.it> <pUR86-2r6-7@gated-at.bofh.it> <pURhM-2CP-13@gated-at.bofh.it> <pURUv-3H0-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 07, 2015 at 09:05:06PM +0530, Vineet Gupta wrote:
> On Friday 07 August 2015 08:27 PM, Peter Zijlstra wrote:
> > On Fri, Aug 07, 2015 at 08:14:03PM +0530, Vineet Gupta wrote:
> > 
> >> > See, I have such a cmpxchg loop in ARC code - originally from Peter :-)
> >> > arch/arc/kernel/smp.c. @ipi_data_ptr is NOT atomic_t
> >> > 
> >> > 	do {
> >> > 		new = old = ACCESS_ONCE(*ipi_data_ptr);
> >> > 		new |= 1U << msg;
> >> > 	} while (cmpxchg(ipi_data_ptr, old, new) != old);
> >> > 
> > Well, you'll have atomic_or() real soon now.
> 
> Doesn't help my cause - ipi_data_ptr is not atomic_t - hence my prev question in
> this thread

A cast will work :-)

But yes, ideally everything will be type safe because of those archs
that cannot have atomic RmW ops like !ARC_HAS_LLSC.

Mixing cmpxchg()/xchg() with regular stores is broken on those.

Fwiw, you might want to set ARCH_SUPPORTS_ATOMIC_RMW for ARC_HAS_LLSC.
--
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 | Next in thread | Find similar | Unroll thread


Thread

[PATCH] coredump: Replace opencoded set_mask_bits() Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-08-07 10:20 +0200
  Re: [PATCH] coredump: Replace opencoded set_mask_bits() Oleg Nesterov <oleg@redhat.com> - 2015-08-07 14:00 +0200
    Re: [PATCH] coredump: Replace opencoded set_mask_bits() Vineet Gupta <vgupta@synopsys.com> - 2015-08-07 16:50 +0200
      Re: [PATCH] coredump: Replace opencoded set_mask_bits() Peter Zijlstra <peterz@infradead.org> - 2015-08-07 17:00 +0200
        Re: [PATCH] coredump: Replace opencoded set_mask_bits() Vineet Gupta <vgupta@synopsys.com> - 2015-08-07 17:40 +0200
          Re: [PATCH] coredump: Replace opencoded set_mask_bits() Peter Zijlstra <peterz@infradead.org> - 2015-08-07 17:50 +0200
            Re: [PATCH] coredump: Replace opencoded set_mask_bits() Vineet Gupta <vgupta@synopsys.com> - 2015-08-07 18:00 +0200
              Re: [PATCH] coredump: Replace opencoded set_mask_bits() Peter Zijlstra <peterz@infradead.org> - 2015-08-07 18:10 +0200

csiph-web