Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp529228pxv; Thu, 8 Jul 2021 08:03:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwv1DalfFTHcaGNxGe81XL3Qlhdr1ezn3jJk0lHGWUN9gXgXJBAGZLBaAkjsB9xkEloAvJi X-Received: by 2002:a05:6402:268f:: with SMTP id w15mr22875098edd.206.1625756591889; Thu, 08 Jul 2021 08:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625756591; cv=none; d=google.com; s=arc-20160816; b=wZS0XDlz13nWrMZFoAjelzmD3tjmv050fcvsJSImZdTzJiS6qCMKxNlMYu4ofBi8sd kSDlo+93n930xhcsldvZx2+C1BNMKAybjRevUXZmEMkD85vFzSdhX6NE6i+p7J+G4RU9 7ax7cSvnL5dXL4Y9GcxLEsF5omrsxANMsOfo+UDQNwIXnAdqN8b9kt2Y0g+WJflCGNPs DovmkyOZmVOcPkR48T9/+iBlxPDkjJ2gbs02zSMPUM7dAVlWEn4Pd+W7dl3p1UmIchF+ u84wviSU5Q66EaB8O3dNoe6qvhL5PS3/WDIw0Q1ox7TBanX8/A+SJ/QSbonSVhlK8yNY zKJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=Kee/HxNxoop9MkyMLaehdkT91QMwP2vMGP881JeD+sU=; b=K0NaInf3P7tVaVwoBmWUROUCB08jc5v3tpt25q61vaIxXnTFo+4oNRZG3EFvl0A+/G QY0d7lvOTcxzOcPJcldu2qs9h0ZlqlqfsGrA1MR4UXwm2KSrypjaLP8eMTj3b9jA3pwr nNgyTAXIqLY1lKI//KVpCnPq8ErJbUMNDIqWUkxM9hhfBHB+tQHf9KJoc3A90T6yVzNQ dzbE+kCTLzJSDu93xGfLXxWCs+yWQTU6u5QVEoO5xyIJ+8teAX9b0fVrx6km4gPP0bx0 rHasZ2DmRCYxoW+0jNw9+njb6HnAPsf11/uCrbEpGMw4QWcTZfi/Thl4rYZ0ARKmpm9R ddPw== 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 dm10si3110041ejc.298.2021.07.08.08.02.42; Thu, 08 Jul 2021 08:03:11 -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 S231920AbhGHPEU convert rfc822-to-8bit (ORCPT + 99 others); Thu, 8 Jul 2021 11:04:20 -0400 Received: from mta-tor-003.bell.net ([209.71.212.30]:20950 "EHLO cmx-torrgo001.bell.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229738AbhGHPES (ORCPT ); Thu, 8 Jul 2021 11:04:18 -0400 X-RG-CM-BuS: 0 X-RG-CM-SC: 0 X-RG-CM: Clean X-Originating-IP: [67.71.147.238] X-RG-Env-Sender: dave.anglin@bell.net X-RG-Rigid: 60C8868801068702 X-CM-Envelope: MS4xfGyTTt95LmJz41oxT9430AOjrGfolv8+y88Ts31Mm1ggFI+mKrxElxz4+y5RQmpxz6amPnn8VN9U+OACfxSyJA11/YdDx+KK4jSqRhUqbx1UGos0AWgI 8WuoRSwDv2b0aY9sdjDriuUkxDDigFnp7TX/mvFx5Ck+7MwqN7OFCDNepW4VxNP9k2iOToxk4OyZJVqYUE8O9RoFg0s9eXmwLFE6mk/wK85sw1N8DECRyOnq K85h4eNkNBZfwPuWnfx6kj26vGAExfyLrfKGlm/yaL7T5HNE4bJePQm/9lkW3bwNyldShbPvVWTd4O31UbaF5eTGjrncYTuY2ynnvGm1BXv/Tv4iRlrUTDVz q3vT0X+qNKAQJeYciqGeE7C8p+8QQtJopAHGgJFZdXFG4cMz9UEMHnvI8YP+1ntQf1dyxdDaiya+t/KlAK9An467xvbL2jvY/0owXRE1L81d97L7sZe+DbB/ DuBciMBVICGUkgJSjeFf0v+/GAto7CjcyzMPyztbL9UX2z8HyVc7z8MKpLLA34LlNZz635kniYrCYOKC X-CM-Analysis: v=2.4 cv=Udwy9IeN c=1 sm=1 tr=0 ts=60e7134c a=/cPhanApxV8nRKTAyWrE3w==:117 a=/cPhanApxV8nRKTAyWrE3w==:17 a=IkcTkHD0fZMA:10 a=FBHGMhGWAAAA:8 a=GfkpTtF8mnDkJo9QkI0A:9 a=QEXdDO2ut3YA:10 a=9gvnlMMaQFpL9xblJ6ne:22 Received: from [192.168.2.49] (67.71.147.238) by cmx-torrgo001.bell.net (5.8.716.03) (authenticated as dave.anglin@bell.net) id 60C8868801068702; Thu, 8 Jul 2021 11:01:32 -0400 To: Arnd Bergmann , Helge Deller Cc: Abd-Alrhman Masalkhi , Christoph Hellwig , Jens Axboe , Bernardo Innocenti , Parisc List , linux-block , Linux Kernel Mailing List , Dan Carpenter References: <20210706205927.4407-1-abd.masalkhi@gmail.com> From: John David Anglin Subject: Re: div_u64/do_div stack size usage, was Re: [v3] block: Removed a warning while compiling with a cross compiler for parisc Message-ID: <3453ec06-fc62-81e4-33e9-88afd51f50f9@bell.net> Date: Thu, 8 Jul 2021 11:01:32 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-07-08 7:37 a.m., Arnd Bergmann wrote: >>> 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. Correct.  In the 32-bit target, the stack alignment is 64 bytes.  This is the main reason functions with small stacks use more stack than on x86.  There's also the frame marker that needs to be reserved.  In the 64-bit target, the stack alignment is 16 bytes.  However, the minimum allocation is quite large because of frame marker, 8 call registers and the argument pointer slots.  If a function uses a significant number of local variables, there shouldn't be much difference in stack size. Dave -- John David Anglin dave.anglin@bell.net