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


Groups > linux.kernel > #1280152

Re: [PATCH 1/7] atomic: Export fetch_or()

From Chris Metcalf <cmetcalf@ezchip.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/7] atomic: Export fetch_or()
Date 2015-11-30 19:20 +0100
Message-ID <qABdn-76v-9@gated-at.bofh.it> (permalink)
References (1 earlier) <qunwu-7y6-13@gated-at.bofh.it> <qyoaE-1F0-35@gated-at.bofh.it> <qytjZ-56r-17@gated-at.bofh.it> <qytDk-5dS-13@gated-at.bofh.it> <qAAAG-6D4-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


(Resending as plain text.  Not sure what Thunderbird was smoking to make
this message multipart/alternative originally...)

On 11/30/2015 12:36 PM, Frederic Weisbecker wrote:
> On Tue, Nov 24, 2015 at 04:48:35PM -0500, Chris Metcalf wrote:
>> >Unless you want to take a big diversion into atomics, I'd be tempted
>> >to leave Peter's macro alone and just write it off as necessary evil
>> >to handle the fact that thread_info.flags is all kinds of different sizes
>> >and types on different platforms, and definitely never an atomic_t.
>> >Instead just create an inline function atomic_return_or(), or
>> >whatever name you prefer, that operates on an atomic_t, and use
>> >the atomic_t type for your structure field.  It's clearly a win to mark
>> >the data types as being atomic to the extent we can do so, I think.
> I agree that cmpxchg, test_and_set_bit, fetch_or... functions with loose
> namespaces aren't the best layout.
>
> But casting thread_info to atomic_t really worries me, I'm not sure the ending
> result would be correct at all. I prefer to sacrify correctness over namespace
> sanity:-)

Just to clear, I wasn't suggesting that that necessarily was the way for you to go.
The last four lines of my message quoted above are what I think might be the
best way forward, and don't involve messing with thread_info at all.

-- 
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com

--
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

Re: [PATCH 1/7] atomic: Export fetch_or() Chris Metcalf <cmetcalf@ezchip.com> - 2015-11-24 17:00 +0100
  Re: [PATCH 1/7] atomic: Export fetch_or() Frederic Weisbecker <fweisbec@gmail.com> - 2015-11-24 22:30 +0100
    Re: [PATCH 1/7] atomic: Export fetch_or() Chris Metcalf <cmetcalf@ezchip.com> - 2015-11-24 22:50 +0100
      Re: [PATCH 1/7] atomic: Export fetch_or() Frederic Weisbecker <fweisbec@gmail.com> - 2015-11-30 18:40 +0100
        Re: [PATCH 1/7] atomic: Export fetch_or() Chris Metcalf <cmetcalf@ezchip.com> - 2015-11-30 19:20 +0100
    Re: [PATCH 1/7] atomic: Export fetch_or() Peter Zijlstra <peterz@infradead.org> - 2015-11-25 10:20 +0100

csiph-web