Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp377730pxv; Thu, 8 Jul 2021 04:45:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDQqGe2Ege+Cj1haThFSmevZJZVos+n8ke2Wx07QJwssNYqm0YDN4MWR4GbRTkvZnn4hg4 X-Received: by 2002:a17:906:698a:: with SMTP id i10mr30066931ejr.499.1625744744195; Thu, 08 Jul 2021 04:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625744744; cv=none; d=google.com; s=arc-20160816; b=DDBenH/zCzjwcP7vEfxKJj0FU6nM7GgZdbO0ZrrE9LJKkCgbel0dnBHtgzved6QeKp z6nVHm5/8LPfvqXLhv4mZ5INK/BwnPaeBLWzhz9kJwcL4c7r1l1rQmQB/5yiBloqwsH1 yqKy0dxd6GvnDRhwC5mPWPScUJ74UVdN2cP8DXvSfayQu9mdDOhiZRtLJs2ql295ikHx s7IoVy+mXA11NV5r01PS8MxDVku5ThHw0hNz2UjNSAvsCI1DdesER328aKhPId3juaHt /tu20V1iuzglNQ9EqrQFJtASu6ruqd9KHYBCeApaKBRCAwC+joV37YuJ7Lb8ux0PFZ6S l0Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=rdEYrjIwqhUe2tr54d8adTlHH3PPXbujtroEaVwQEAM=; b=cUKg3FPIncruhXlSxgEgkV69CvOFPEC9xKJVY0EwpsddG1QFsy9pBPbYtdYD+KbgUB ZLW5CBcBup6ZbazKGaU4cvx8+iRm6HdO1YEEOtr1JGS8zIP2/1iNpzwOyGUg4cQ2Q4WC ah6UCr+HUydEHqfPEwI9V9gm48HH4Y3wK4rMzZi+GwHCnw/iMhetan7Eh8qLKfD8jp/J mAHa3unAHnjsi3pRMWTnbZyySOsfF1D/PPHQjHHPozAxoIIvtcS9E1mJzx3jzj+LaykO 8H2bdjIZ9Cg36uZk1gh9/Suh9ycSkEj13+3l/6KNqoEcAB0KWoXjGkI9CSVIHnWXwLMP HQzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si3108892ejc.221.2021.07.08.04.45.21; Thu, 08 Jul 2021 04:45:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231764AbhGHLqH (ORCPT + 99 others); Thu, 8 Jul 2021 07:46:07 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:43163 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231575AbhGHLqF (ORCPT ); Thu, 8 Jul 2021 07:46:05 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MOzKk-1lpJKg2EPc-00PMdE; Thu, 08 Jul 2021 13:43:22 +0200 Received: by mail-wm1-f54.google.com with SMTP id u8-20020a7bcb080000b02901e44e9caa2aso3817518wmj.4; Thu, 08 Jul 2021 04:43:22 -0700 (PDT) X-Gm-Message-State: AOAM532ocqVsq+x/Y2MqihGYv91R01sEYBklJWeoXfwALxENjNdaHD3C C2pP4YxBvkloaImyZY8Wyejbg9aTox4a8MShIbA= X-Received: by 2002:a1c:4e0c:: with SMTP id g12mr4697466wmh.120.1625744253544; Thu, 08 Jul 2021 04:37:33 -0700 (PDT) MIME-Version: 1.0 References: <20210706205927.4407-1-abd.masalkhi@gmail.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 8 Jul 2021 13:37:17 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: div_u64/do_div stack size usage, was Re: [v3] block: Removed a warning while compiling with a cross compiler for parisc To: Helge Deller Cc: Abd-Alrhman Masalkhi , Christoph Hellwig , Jens Axboe , Bernardo Innocenti , Parisc List , linux-block , Linux Kernel Mailing List , Dan Carpenter Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:n35Htb9MrjAP/WLrgMNtcMItQh2Zk244KS4GSxPhEn1TdM3c4pm HqktELI5uhvK998xOq64Ic+OHSb6pdH/jeUEg45YkiQ4GqrJtNWiGNjMD958n1mGFI9DoCc 1mqFFkzzsdmDZlVjNDpv1XJuaUk1BX00AIDSIy/yS7A47kr+5vdcOpHXWa1uICCpoVcPE9N 0V/xgbu0+z+IWQq7MxDng== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:g9gOPVnN2wk=:qNUObeuKz8MzuIxH8hlHNz PhwAQLvXs+QZuRoGYJS6a/dJdZ7RYWJkYRLGt4Hfi9H7oj2SbCOlNXFgGpU3U5hNljQJ+ubsB TlVSeZ2tWifIP2KUWJRJe0kCOkCWv/VWEiJsqg4zMBIqESaHl3EdPbggXoDhxTZ7Pl1bYh16J oJZGYb4RsmsA0Ctu59l1hfoYgm0aHGFupsSiRqrjvoQldq0ZLUXrlU1yiEe3b4BWrl2ZDNibJ MsLAHNYcylf0CIZTlvB7jtPktwca7KBf5mSVmoIXMZfFcgGZFVVCWkpmZbZHZmaf08if9FMdE wljOG1sVwusJDtu13wZ9cpp+WQNR3UyHd8TFuHye03CTV5Sk7AhrxIOlSmZ2rnJJR4v2y+R5N 4M/ctEb4mqucOWZLaT20mXJBoELURusic7L6IcXSqV2ULt73JlckDoSoBIC8vScnAmF/OgNx3 wH5Swq/uUxNBnX6VcPuoyqJIGsCY5mABHqe2+bAQZjLKIaLbBLQ9GpK/N84sp+7eDW26EjZPw kadc2PqfoWSKPcKIOWY42t/dk4wl0rGMuQoWmyBB4qLZxFVhIDTg5kdydoDr4HJHSSYcd5ugT OfKx3feBxwegTQLdibcCEklri2Ti/HTZl3t5/Qfy1ev65nnKptFUUPTskTuF2wpWCnlGHSipx yDAVdtKGkIcNkjyhWQXvBEKld38PmZMfjqdCWbG/W+KjpbnPJ2GZtBjRwOzo9yy2tmb4Z/xLO f3wEDK0P7WuDw/6NA3QCEYhlLVwNqHw0SPph1LJNtsjdu0gIcmX5RLpy6mIEC6IoCiFo84mtX B9Sul5EkCHPxpZLfb77+0QyJVDKRk2Wh7mSe2TYzJcBlzZ/FkhkJENiy9Bx2YxMs/V8GdMifO EdIcdyYN69Mpm5Zpv+amGk2c1vHoyF7cxqFDaJ+FMcI5MPpul5Dun98ZXSxfjCIzsIAV0Qv42 MekupFSg4M9LeF6JWI96KAA8IcMof5DYR+hYLD0oioukRhivtMTqk Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 8, 2021 at 11:30 AM Helge Deller wrote: > On 7/7/21 10:39 PM, Arnd Bergmann wrote: > >> [PATCH] parisc: Increase gcc stack frame check to 2048 for 32- and 64-bit > >> > >> parisc uses much bigger frames than other architectures, so increase the > >> stack frame check value to 2048 to avoid compiler warnings. > > > > I think setting it to 2048 is rather excessive, > > Since parisc needs roughly twice the frame (and stack) size as x86, > 2048 seemed logical since that's the double of what's used on x86. > Of course we can reduce it, e.g. to 1536. But it doesn't use twice as much for large functions at all. The stack frame for a small function is much larger, so you need a larger kernel stack to allow for deely nested call chains, but the frame for single function with large variables is only a bit larger as most of it is used up by those variables. > > and it would make you miss other real bugs. What I suggested was to > > change the defconfig to use CONFIG_CC_OPTIMIZE_FOR_SIZE instead. > > But then you still will see those warnings in case you choose to not > optize for size. Right, and I would consider that a good thing: this warning is for a real (though fairly harmless) bug that has already been fixed with newer toolchains, so anyone that runs into the bug should probably see the warning for it. Doubling the limit would effectively prevent similar bugs from being noticed, and they could be in performance-critical code or cause an actual stack overrun. I can think of two other, more directed workarounds: - change block/Makefile to add -Os to the cflags for this one file in known-broken configurations (parisc with old gcc and -O2), to be removed in a few years when gcc-10 becomes the minimum supported version - add a warning that points to the gcc bug (if someone has a link) when building an affected configuration, and let users decide to either change their setup (using -Os or a newer compiler) or to ignore the warning. > or bad coding, e.g. huge local variables That's what I meant with 'kernel bug'. Arnd