Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3998120iog; Tue, 21 Jun 2022 09:59:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1svj89lx/8isK9r4nVBjFK5YKWH5PLWUsh89S0a7XLls8Ddgx0zQbjHVtqmq4zP8ikKzdQB X-Received: by 2002:a17:902:ba90:b0:16a:2863:fb85 with SMTP id k16-20020a170902ba9000b0016a2863fb85mr10134521pls.15.1655830795137; Tue, 21 Jun 2022 09:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655830795; cv=none; d=google.com; s=arc-20160816; b=nig8+NVDDeQwwduGdiIQHde6QGpA2mP1/er0kApcCTzzXGQkCflxlDgQ0/DyFQbomb KBelJqA/Sz7V7su8fxqcrIBpa6FVQmML7nqN/9HlkAZcL6LYKu5AirVXDMGtYUIXnzPq KNNQM00s8YsPmYGUXsRdfdZAspYhcGGO3flGGuRHHsm330iZynN2obDP2GtpHs2NdEIr hw23CaPT9WHM5juxEDmst0n/m9nXZs/ksdbe9rxi+0mlf5pmBcQvQAMM3jYr5GCGP0OT a9mBejP/vuih/WIoaYIAApdIOA7zJFliyp+codd9FYd6+thq5MGNOnl8OKW9mWSYf8PO goiw== 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:dkim-signature; bh=Ow9D4yPO25VtNl7FIH7LrdA561YGWfpt8NV3HmX+5v4=; b=aRBgJP6dXxoZ6j22X9aDPrqnmuZnjprmI/sJ5VbiB0HyZbrhqyBG9gcP0EjQ46ouwv vGwJ0vJxkLpPbwoYNjxniD0hsfa3sgRskguvhkApIDGj4cizH4TZOrpOGo1kAuxCgKD2 FiWlBT9X6zA2cWbnEZLoDzs5AMX5avkB675DzSMNhbYJN9NMUucj4PNrh//rJFTL0mkZ UqYK6+0NRYxp7Pr5vEVUrixHPrZJ1s+0jURpnPPvTjDqhJulP/fBd1vYQtPFVD+YRY7o 4pY6PdxFKh4BrB4z9efiHSF0GynithkLokF7IX87tCPAzHhWnG4oA8S41hxh0ypHVDU/ KEgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=US9MeMpu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x23-20020a656ab7000000b003fd4101223bsi21295969pgu.798.2022.06.21.09.59.43; Tue, 21 Jun 2022 09:59:55 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=US9MeMpu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352731AbiFUQ16 (ORCPT + 99 others); Tue, 21 Jun 2022 12:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237637AbiFUQ15 (ORCPT ); Tue, 21 Jun 2022 12:27:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D96B21AD for ; Tue, 21 Jun 2022 09:27:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 16DC3B81A6A for ; Tue, 21 Jun 2022 16:27:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D52B5C341C7 for ; Tue, 21 Jun 2022 16:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655828872; bh=Ow9D4yPO25VtNl7FIH7LrdA561YGWfpt8NV3HmX+5v4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=US9MeMpuQsEBK65ATBnqHn4e5RKa2YBVmkswS9nBUZOi2h2TsyxRhyry6a3l9JpbD aWktDLEN9y8JJnihtKcDFWNu7RbWTQg2hT6tFtTKoUHSpZQe4OHsAI50EgSISyr0Mu FlhLLbYQxOjZt/6IayLDNX9/9MiiFtBKqZGqeRWT9IgxDkYnRksrPcSkBWiZFdKYEj iprn8upEG0Kheov3FPBdXNZ3OSWwfM5Y9NF/ILFj4IKIvR6AYbj96YmqQhFPmC08Ol Q3eIgQBtWUqJxQItmCxHgSqivgFYuogw5b/pWuJ5TmdpdURaUd/R9/WQoXDEvDfmpJ SApob/jBWsO2w== Received: by mail-lf1-f50.google.com with SMTP id c2so23309748lfk.0 for ; Tue, 21 Jun 2022 09:27:52 -0700 (PDT) X-Gm-Message-State: AJIora/RnVdF8tRxH3sDW9iImWgHW0wq65EfPA7vXLgC8Ma7L03nHQYV qiF6fptTIWbt9oSmatOI6ISm5slXVDouVRUtWEQ= X-Received: by 2002:a05:6512:1292:b0:479:6313:789e with SMTP id u18-20020a056512129200b004796313789emr17953388lfs.538.1655828870919; Tue, 21 Jun 2022 09:27:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Tue, 21 Jun 2022 18:27:39 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH] ftrace,objtool: PC32 based __mcount_loc To: Mark Rutland Cc: Peter Zijlstra , Steven Rostedt , X86 ML , Linux Kernel Mailing List , Josh Poimboeuf , Christophe Leroy , "Naveen N . Rao" , Miroslav Benes , Nathan Chancellor , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 On Fri, 17 Jun 2022 at 13:40, Mark Rutland wrote: > > On Fri, Jun 17, 2022 at 01:24:53PM +0200, Peter Zijlstra wrote: > > > > Hi, > > > > I recently noticed that __mcount_loc is 64bit wide, containing absolute > > addresses. Since __mcount_loc is a permanent section (not one we drop > > after boot), this bloats the kernel memory usage for no real purpose. > > > > The below patch adds __mcount_loc_32 and objtool support to generate it. > > This saves, on an x86_64-defconfig + FTRACE, 23975*4 ~= 94K of permanent > > storage. > > We have a similar issue on arm64, which is exacerbated by needing ABS64 > relocations (24 bytes per entry!) adding significant bloat when FTRACE is > enabled. > > It'd be really nice if going forwards compilers could expose an option to > generate PC32/PREL32 entries directly for this. > As opposed to generating absolute references today? Or as opposed to having to rely on our own tooling?