Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1047423rdb; Wed, 1 Nov 2023 09:49:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxKYNcQ50vp/B5TQDGZUAspU33bc2O2nxJsrACAcyUVf2zhKTCuKL5xVXu7qnNtFocqcOK X-Received: by 2002:a05:6870:a108:b0:1e9:bda8:ba79 with SMTP id m8-20020a056870a10800b001e9bda8ba79mr18951319oae.27.1698857371908; Wed, 01 Nov 2023 09:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698857371; cv=none; d=google.com; s=arc-20160816; b=DXrlcah53tEzZEFmrO0RUc25DVDoKU7IMrSwivefhG/sL5LDvIEHbYPeQPAoY2+QhS LppgYZNK0yh7pqv0NyedO5WpAo08Btif6HZtNYPKNshmd7wDwU5DdeXg1fjHfLP+bPUP VpE8IeJRTS1q3uWfm/lZePBf/hnSd3dJm02PtcV7DAWfiYYCT4uE2qtnRwWx3HI9x4EV 2HfQmzYMj4dbmq6e28vGsd4gWbo0EpAg+Bp+TkLTswe1P3ltKgjeLvFR+Ie4T6VQyKRn +a10qpn+hSbbg2zQusK+w0eGbEFLjL6468N5X5DA9adkEuLjH4qknbyzySlfkDGfBOLP sulg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9LlQDf6L5flbywxuUr0vUhsjISwDWf3rnihr9I/fAx8=; fh=Nwzly9O6yFmmU4MLAYxZf5nuRPro0y0GP8pklk72l3Y=; b=zVJuPw91xm/BNWdgjZiN5n8j2b/5X7BYK682Wn0sIB7ziIdks0cligt+zcCxhAZOrX h8A+cYDq4q3ohiLTzi37FCpSdKgn7pg0LWnOxCPOQk6lhmlyL8XBWRgb4Bh7TL0qW/Xk cw280Vxet7MPoFpuF9S5btxOwvp+U4ziuE6mpk5KVbE8iLGlApq8G03s1TWfHWr+nfW7 DSvgElmnjuG6Co2suWRjkrARKr2ON10p9Szp2GXLFjJVX7emZO7gvF8VzlsDjfTtu9qM R66gudNkbHAo13pQ/j2zLlP4o4jk65eils4DoajOa2S0cUQCshwoIinseZPITsyTizNg 29xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=AfVhE87V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id bw19-20020a056a02049300b00565e865d381si257464pgb.447.2023.11.01.09.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 09:49:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=AfVhE87V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 1317280C843C; Wed, 1 Nov 2023 09:49:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344094AbjKAQsw (ORCPT + 99 others); Wed, 1 Nov 2023 12:48:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbjKAQsv (ORCPT ); Wed, 1 Nov 2023 12:48:51 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75565FD for ; Wed, 1 Nov 2023 09:48:45 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 1AE051F74A; Wed, 1 Nov 2023 16:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1698857324; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9LlQDf6L5flbywxuUr0vUhsjISwDWf3rnihr9I/fAx8=; b=AfVhE87VJNvxstipLdhohGxwA0Ka27gY0FYJCjWzEnMBG4nBmnprOs4r0iY3lblC0d4lHF 77R/Ht/ltb+9IaYVUbljGS3VsVnN8yn8irFYFNvID4fldXhkkx1eFR8NPPWMDRWPIycQ1F ExPXyw83Fl+BcTfSjtZmiP+kgAdCOoE= Received: from suse.cz (pmladek.tcp.ovpn2.prg.suse.de [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 5B4242C33E; Wed, 1 Nov 2023 16:48:43 +0000 (UTC) Date: Wed, 1 Nov 2023 17:48:43 +0100 From: Petr Mladek To: Alexey Dobriyan Cc: Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH] vsprintf: uninline simple_strntoull(), reorder arguments Message-ID: References: <82a2af6e-9b6c-4a09-89d7-ca90cc1cdad1@p183> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82a2af6e-9b6c-4a09-89d7-ca90cc1cdad1@p183> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 01 Nov 2023 09:49:27 -0700 (PDT) On Fri 2023-10-27 17:13:58, Alexey Dobriyan wrote: > * uninline simple_strntoull(), > gcc overinlines and this function is not performance critical > > * reorder arguments, so that appending INT_MAX as 4th argument > generates very efficient tail call > > Space savings: > > add/remove: 1/0 grow/shrink: 0/3 up/down: 27/-179 (-152) > Function old new delta > simple_strntoll - 27 +27 > simple_strtoull 15 10 -5 > simple_strtoll 41 7 -34 > vsscanf 1930 1790 -140 > > Signed-off-by: Alexey Dobriyan I am usually quite skeptical about these micro-optimizations. They might help only on some architectures with some compiler versions. And they might make it worse for others. Well, I could imagine that passing constant via the last parameter might help in most cases. And the new ordering of the parameters is fine. So let's get it in. Reviewed-by: Petr Mladek I have just pushed the patch into printk/linux.git, branch for-6.7. Best Regards, Petr