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


Groups > linux.kernel > #1610470

Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations
Date 2017-03-28 11:30 +0200
Message-ID <tpVBU-5sY-25@gated-at.bofh.it> (permalink)
References (2 earlier) <tormy-64z-11@gated-at.bofh.it> <torFU-6sZ-7@gated-at.bofh.it> <tov6P-la-29@gated-at.bofh.it> <towPg-1DH-11@gated-at.bofh.it> <tpUcN-4ow-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Mar 28, 2017 at 09:52:32AM +0200, Ingo Molnar wrote:

> No, regular C code.
> 
> I don't see the point of generating all this code via CPP - it's certainly not 
> making it more readable to me. I.e. this patch I commented on is a step backwards 
> for readability.

Note that much of the atomic stuff we have today is all CPP already.

x86 is the exception because its 'weird', but most other archs are
almost pure CPP -- check Alpha for example, or asm-generic/atomic.h.

Also, look at linux/atomic.h, its a giant maze of CPP.

The CPP help us generate functions, reduces endless copy/paste (which
induces random differences -- read bugs) and construct variants
depending on the architecture input.

Yes, the CPP is a pain, but writing all that out explicitly is more of a
pain.



I've not yet looked too hard at these patches under consideration; and I
really wish we could get the compiler to do the right thing here, but
reducing the endless copy/paste that's otherwise the result of this, is
something I've found to be very valuable.

Not to mention that adding additional atomic ops got trivial (the set is
now near complete, so that's not much of an argument anymore -- but it
was, its what kept me sane sanitizing the atomic ops across all our 25+
architectures).

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


Thread

[PATCH 0/3] x86, kasan: add KASAN checks to atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-14 20:30 +0100
  Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Mark Rutland <mark.rutland@arm.com> - 2017-03-20 18:20 +0100
    Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Mark Rutland <mark.rutland@arm.com> - 2017-03-21 11:50 +0100
      Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-21 19:10 +0100
        Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Arnd Bergmann <arnd@arndb.de> - 2017-03-21 22:30 +0100
          Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-22 11:50 +0100
            Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Arnd Bergmann <arnd@arndb.de> - 2017-03-22 12:40 +0100
              Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-22 13:30 +0100
                Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Arnd Bergmann <arnd@arndb.de> - 2017-03-22 13:50 +0100
  Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Ingo Molnar <mingo@kernel.org> - 2017-03-24 08:00 +0100
    Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 08:20 +0100
      Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 09:50 +0100
      Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Ingo Molnar <mingo@kernel.org> - 2017-03-24 12:00 +0100
        Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 13:50 +0100
          Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Ingo Molnar <mingo@kernel.org> - 2017-03-28 10:00 +0200
            Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Peter Zijlstra <peterz@infradead.org> - 2017-03-28 11:30 +0200
              Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-28 11:50 +0200
              Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-28 12:00 +0200
                Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Ingo Molnar <mingo@kernel.org> - 2017-03-28 12:20 +0200
                Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Dmitry Vyukov <dvyukov@google.com> - 2017-03-28 18:40 +0200
              Re: [PATCH 2/3] asm-generic, x86: wrap atomic operations Ingo Molnar <mingo@kernel.org> - 2017-03-28 12:00 +0200
  Re: [PATCH 0/3] x86, kasan: add KASAN checks to atomic operations Andrew Morton <akpm@linux-foundation.org> - 2017-03-31 00:40 +0200

csiph-web