On Wed, Sep 8, 2021 at 4:12 PM Shuah Khan skhan@linuxfoundation.org wrote:
On 9/7/21 5:14 PM, Linus Torvalds wrote:
The KUNIT macros create all these individually reasonably small initialized structures on stack, and when you have more than a small handful of them the KUNIT infrastructure just makes the stack space explode. Sometimes the compiler will be able to re-use the stack slots, but it seems to be an iffy proposition to depend on it - it seems to be a combination of luck and various config options.
I have been concerned about these macros creeping in for a while. I will take a closer look and work with Brendan to come with a plan to address it.
I've previously sent patches to turn off the structleak plugin for any kunit test file to work around this, but only a few of those patches got merged and new files have been added since. It would definitely help to come up with a proper fix, but my structleak-disable hack should be sufficient as a quick fix.
Arnd