From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2C10254B09 for ; Wed, 5 Mar 2025 19:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741204540; cv=none; b=V45GQRBcekyZBJPmGcXTMWT3+OkuW5QOYG18IS8o5C874pNxcMyXm/eNsOXYvsSEGpWWKDoix9xsjdLc6Ag2sroLvXpo/4y6cx72iILuIUMbkMYKmmFf0DR/8iwZNTGRNSZhfEaVFToLO+pJIjH+bqmqe7k+oU6pbDIzdTQucZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741204540; c=relaxed/simple; bh=GLQ2hhASLmjtNMDIBmNt+vg3kC2QMbCrfNgPLvED20M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hDfRslDedUIMtN/7RmrkIGcdNvFwWFAz5ywLmpwlJGIme3yxbCKJTq1mvA+tLXVcvO0dyQTObN5+nr5NY/O8HNM+nuyY1NqOeyDoD4FkoslL2RBI/YAyNfets5NbO4mpjmlI20txTNtx0/jQ5lghLR3Zy5/CS76yOy5axH+ghbc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QASbOe78; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QASbOe78" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB5F3C4CEE8; Wed, 5 Mar 2025 19:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741204540; bh=GLQ2hhASLmjtNMDIBmNt+vg3kC2QMbCrfNgPLvED20M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QASbOe786OGzi7rq+l7DNTX3uRjP9hgILvR/Zr2YYBO0QM89OxJRwvll3VyLKiPIR zb2Om90MyskJuM8QtbpdKitZwJIThEkTOYTynEazrKGMAFRiYbo3/gIGY8yadNiseS bU7yL/BBhPJskVSgYsFYTAdPnDiWKMN6ZOToOjpqk9KqRJpO3wNDU8Yuy3KGa/U45J PhQY8CbQSum+OTqNOe+ZWYltebVFljwEkr6kFS+gNljbD2rNgiUH0+sBhn0VAhze+p wB3zC00XBFoL1fvX2HEvwc5CGKlTkYgc34Zc9iCly1MiB/BNrET0nxiS/t0nuxP2dy tTX06z6rHSJlQ== Date: Wed, 5 Mar 2025 20:55:35 +0100 From: Ingo Molnar To: Uros Bizjak Cc: Borislav Petkov , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Thomas Gleixner , Dave Hansen , "H. Peter Anvin" , Linus Torvalds Subject: Re: [PATCH -tip] x86/locking/atomic: Use asm_inline for atomic locking insns Message-ID: References: <20250228123825.2729925-1-ubizjak@gmail.com> <20f1af22-71dc-4d62-9615-03030012222e@intel.com> <20250301123802.GCZ8L_qsv7-WwUwqt5@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: * Uros Bizjak wrote: > On Sat, Mar 1, 2025 at 1:38 PM Borislav Petkov wrote: > > > > On Sat, Mar 01, 2025 at 10:05:56AM +0100, Uros Bizjak wrote: > > > OTOH, -Os, where different code size/performance heuristics are used, now > > > performs better w.r.t code size. > > > > Did anything change since: > > > > 281dc5c5ec0f ("Give up on pushing CC_OPTIMIZE_FOR_SIZE") > > 3a55fb0d9fe8 ("Tell the world we gave up on pushing CC_OPTIMIZE_FOR_SIZE") > > > > wrt -Os? > > > > Because if not, we still don't love -Os and you can drop the -Os argument. > > The -Os argument was to show the effect of the patch when the compiler > is instructed to take care of the overall size. Giving the compiler > -O2 and then looking at the overall size of the produced binary is > just wrong. > > > And without any perf data showing any improvement, this patch does nothing but > > enlarge -O2 size... > > Even to my surprise, the patch has some noticeable effects on the > performance, please see the attachment in [1] for LMBench data or [2] > for some excerpts from the data. So, I think the patch has potential > to improve the performance. > > [1] https://lore.kernel.org/lkml/CAFULd4YBcG45bigHBox2pu+To+Y5BzbRxG+pUr42AVOWSnfKsg@mail.gmail.com/ > [2] https://lore.kernel.org/lkml/CAFULd4ZsSKwJ4Dz3cCAgaVsa4ypbb0e2savO-3_Ltbs=1wzgKQ@mail.gmail.com/ If you are measuring micro-costs, please make sure you pin the workload to a single CPU (via 'taskset' for example) and run 'perf stat --null --repeat 5' or so to measure the run-over-run noise of the benchmark. Thanks, Ingo