Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1228222rwn; Thu, 8 Sep 2022 15:55:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR5I8y0BKvqP3dd3EO8T3RGVYx0qqEQfwPSpgGjV3LEHBdfMAJBpBGxdUYm+FR0iuCqNYYmZ X-Received: by 2002:a17:90a:e644:b0:200:2f9a:bd0a with SMTP id ep4-20020a17090ae64400b002002f9abd0amr6460244pjb.88.1662677725745; Thu, 08 Sep 2022 15:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662677725; cv=none; d=google.com; s=arc-20160816; b=xBuEYH6ncwuv3RC/wNiMg6vInYrkZqLmpoOURmyrlFcC1tKR/k9aL6WDnbwtLgfZJc Z4kCJBbJIAGYjymHj1UDnOlWBVBixuLKMD+ow+YcDXWfgARU5Dk9y15GtefzTFWbZKNN bJAORBYv7IMpnjrTKykv4dCv9AeKkMcccOO4rkvTrrdN/ezktFT/7hXKaPFJHh+Ge3fL YkZ14xzoCLAZpTrMOjQg/BXCtiRQWpo9EQTX5dTc6hgyycSTSj4ifMswJ4R+boNS1p5g Cdt1XKO1NH0R55zkBeENLl0s1xtjqrf/A6RvskxXitX1e5kFaViG2+nh/Pgro/QsJ0Au 4+pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=u4x4qRy9IhgXaopG/1cYwK2+tniTkvH1YyYjdGMdPoE=; b=0KH4SQeZh4Ly5tiW2dZan3zyHLQNS+TacdV4Gan+jS6Skw+7aeQVZZqsBy3rOeE/p6 uK4LhtboOOZATum3I/DbvS2mGylQyA3r4bvMW9Z9PiV+uuSRat+crrbbaepyo6v9vkcV MaSXclZs3VBcBKsPk7VktN+86x9ztazCUP3CHnabiiRnhjXfv7tdSaQv/9bmfGp43A9x sIOzICkPHzpB4xeesWJfuMOko99Xij/msAAR2vY/J0BLYSw8+MowzSFzFYfQYzOGhj4c IyyupxHgqTNvLfddJ9vh5OtDzlAiWOWemAVku21xal/LFuGu/+Z0IXuDF9GWw82YpXX6 7GCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t12-20020a17090a4e4c00b002005e1169d6si1713614pjl.51.2022.09.08.15.55.13; Thu, 08 Sep 2022 15:55:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbiIHWwJ (ORCPT + 99 others); Thu, 8 Sep 2022 18:52:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbiIHWwF (ORCPT ); Thu, 8 Sep 2022 18:52:05 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 698BEFCA09 for ; Thu, 8 Sep 2022 15:52:04 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 288Me86X019587; Thu, 8 Sep 2022 17:40:08 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 288Me5E7019584; Thu, 8 Sep 2022 17:40:05 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 8 Sep 2022 17:40:05 -0500 From: Segher Boessenkool To: Arnd Bergmann Cc: Michael Ellerman , Christophe Leroy , Mathieu Malaterre , Nick Desaulniers , Paul Mackerras , llvm@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Joel Stanley Subject: Re: [PATCH] powerpc/lib/xor_vmx: Relax frame size for clang Message-ID: <20220908224005.GN25951@gate.crashing.org> References: <20190621085822.1527-1-malat@debian.org> <7cb1285a-42e6-2b67-664f-7d206bc9fd80@csgroup.eu> <87v8pyemmw.fsf@mpe.ellerman.id.au> <8afc110f-641e-40f0-9bf9-b7b2ca3df6a1@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8afc110f-641e-40f0-9bf9-b7b2ca3df6a1@www.fastmail.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Thu, Sep 08, 2022 at 05:07:24PM +0200, Arnd Bergmann wrote: > - if the XOR code has its frame size explode like this, it's > probably an indication of the compiler doing something wrong, > not the kernel code. On the contrary, it is most likely an indication that the kernel code wants something unreasonable. Like, having 20 variables live at the same time, but still wanting nicely scheduled machine code generated. But I suspect GCC unrolled the loops here, even? Best way to prevent that here is to put an option in the Makefile, for these files. We don't want any of this unrolled after all? Or, alternatively, remove all the manual unrolling from this code, let GCC do its thing, without painting it in a corner. > The result is likely that the "optimized" > XOR implementation is slower than the default version as a > result, and the kernel will pick the other one at boot time. Yes. So it's self-healing even, of a sort :-) Segher