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


Groups > linux.kernel > #1202846

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

From Vineet Gupta <vgupta@synopsys.com>
Newsgroups linux.kernel
Subject Re: [PATCH] coredump: Replace opencoded set_mask_bits()
Date 2015-08-07 18:00 +0200
Message-ID <pUSdQ-43B-15@gated-at.bofh.it> (permalink)
References (1 earlier) <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> <pUS4a-3Sp-17@gated-at.bofh.it>
Organization Synopsys

Show all headers | View raw


On Friday 07 August 2015 09:15 PM, Peter Zijlstra wrote:
> 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 :-)
> 

How ? We have

typedef struct {
 int counter;
} atomic_t;

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

Type safe - how / what ?

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

Right, but how does that relate to this discussion - perhaps I shd stop talking -
long friday already :-)

> 
> Fwiw, you might want to set ARCH_SUPPORTS_ATOMIC_RMW for ARC_HAS_LLSC.
> 

Sure I will !
--
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