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


Groups > linux.kernel > #1603588

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

From Michael Davidson <md@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array
Date 2017-03-17 20:30 +0100
Message-ID <tm5Jw-2QT-7@gated-at.bofh.it> (permalink)
References <tlNWh-6eK-9@gated-at.bofh.it> <tlNWh-6eK-17@gated-at.bofh.it> <tlZ1o-6iZ-29@gated-at.bofh.it> <tlZkK-6pR-11@gated-at.bofh.it> <tlZup-6vs-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Mar 17, 2017 at 5:44 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> Be that as it may; what you construct above is disgusting. Surely the
> code can be refactored to not look like dog vomit?
>
> Also; its not immediately obvious conf->copies is 'small' and this
> doesn't blow up the stack; I feel that deserves a comment somewhere.
>

I agree that the code is horrible.

It is, in fact, exactly the same solution that was used to remove
variable length arrays in structs from several of the crypto drivers a
few years ago - see the definition of SHASH_DESC_ON_STACK() in
"crypto/hash.h" - I did not, however, hide the horrors in a macro
preferring to leave the implementation visible as a warning to whoever
might touch the code next.

I believe that the actual stack usage is exactly the same as it was previously.

I can certainly wrap this  up in a macro and add comments with
appropriately dire warnings in it if you feel that is both necessary
and sufficient.

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


Thread

[PATCH 6/7] md/raid10, LLVM: get rid of variable length array Michael Davidson <md@google.com> - 2017-03-17 01:30 +0100
  Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 13:20 +0100
    Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Alexander Potapenko <glider@google.com> - 2017-03-17 13:40 +0100
      Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 13:50 +0100
        Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Michael Davidson <md@google.com> - 2017-03-17 20:30 +0100
          Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 21:10 +0100
            Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array hpa@zytor.com - 2017-03-17 21:50 +0100
              Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 14:50 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-24 15:20 +0100
      Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Alexander Potapenko <glider@google.com> - 2017-03-17 13:50 +0100
        Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Borislav Petkov <bp@alien8.de> - 2017-03-17 19:10 +0100
          Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-17 19:50 +0100
            Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Borislav Petkov <bp@alien8.de> - 2017-03-17 20:10 +0100
              Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-17 20:10 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 20:40 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 15:00 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-24 15:20 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Dmitry Vyukov <dvyukov@google.com> - 2017-03-24 15:30 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Peter Zijlstra <peterz@infradead.org> - 2017-03-17 21:40 +0100
                Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Fengguang Wu <fengguang.wu@intel.com> - 2017-03-18 01:50 +0100

csiph-web