Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp134455iog; Fri, 24 Jun 2022 00:29:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vfooRFcDBw3bhfL7aVyPr6wwloLR7jA7rm1ajhPja2Hu9+NoY3bTnyzkIoufcQJBi96zwo X-Received: by 2002:a17:906:4fd4:b0:722:f223:8d86 with SMTP id i20-20020a1709064fd400b00722f2238d86mr11644653ejw.558.1656055766929; Fri, 24 Jun 2022 00:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656055766; cv=none; d=google.com; s=arc-20160816; b=bX4slawYdRbKPlj89DMuqMS1Por8NAJM0jq0TzNqqzXnRb8IMXjixa+yEjqoTSiV8c tetgVDVYCy2WbvRQ1krJeYrHx0C+VPRWjv5mEDo6x3chaX6dZN4MFVYEheV00YLgwcFX LlLXJDKhAAc7DujOClVohyH7rhUqVXfRoajLJMs1J3q/S4nCgo6mUx3o7Gr7Dxc1b4ZN kjQYl32/787aVNo26MTVdcHYjSbeYEUrc6XWUE3hWEJIOs4S0G88Rv0B6NTuTi8r8tPR tuvaFeNlRhnaGyS+1r0Ci4pNMFd8VH6xU34ji+d0SIvbjAAfGHHbqXXb9m/PwLP5hFZq hlNw== 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=0MjBNXqwwGDkVecLauwz1kkXNtGYgBPvTgjD+2hmJws=; b=VwRGFPAA63sX1FrCBUbCEuA5Mk0YrA/NPwm21gUtdfxGase4HCGt/b84Q8DnzbfVif b8r36nzWcs2x0Ysbtm9zt9RZOrHR883JStMjETqLPWvGvWKHT2fLjwKc2eKLCPxAb9GW xQ0sx6g9SxjRgbojKB/XgQdDL7FwHF1g4kHDPVASdp7WvC1arrFgVEG4GnapTRRdCaen 9p/4el3lRlXCGUHh4YTl3reOrNlR1wMdCHDra6PZ9x1EqCTi30+jYnG+hd5PaOUBp1aW 9WxG4YUpXeGda3/pz7foILL67KNK16V/4dYSxw/bpT1SGrtnUrlC6RJdi/V00tAzaQB2 D2RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="R/R4WTDg"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020aa7d94c000000b004357d46d8a6si2181718eds.424.2022.06.24.00.29.02; Fri, 24 Jun 2022 00:29:26 -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=@infradead.org header.s=desiato.20200630 header.b="R/R4WTDg"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiFXHR2 (ORCPT + 99 others); Fri, 24 Jun 2022 03:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiFXHRX (ORCPT ); Fri, 24 Jun 2022 03:17:23 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5570B50B0E for ; Fri, 24 Jun 2022 00:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0MjBNXqwwGDkVecLauwz1kkXNtGYgBPvTgjD+2hmJws=; b=R/R4WTDgCM0bGE57KtGi/9cgGQ CuMm79deh88rFq9Dbrsa64htpoYUnS5Q0UVypXII1E0iTGOCBFSKQUSo/KcIMzpra0+rAHVAGdEh/ Dx/Ad7K6FV4AjUQ3rNUk66/+R7Zdt8gNwr7T6Fikm1/KOaw6lNoSWnZSg2gbJIBZBs/wkEHH6lk0u usqyjZcKegeaAPbTgcHh+0pdl61wPYIF+M7jCWoED2K6ln7Ql4NRkBxes+T63kg52j9jaalRS4RSV TrB3d5uvyha0+rtnKHs7gPfElQxPMuJF1HP6Bf2sTpa1MfK0qmkqQK+lGmltZAJolv+MO7RK90W+0 sg7vjaPw==; Received: from dhcp-077-249-017-003.chello.nl ([77.249.17.3] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4dYh-00C6ID-Od; Fri, 24 Jun 2022 07:16:52 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 70B4F30023F; Fri, 24 Jun 2022 09:16:48 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4B54929A7C416; Fri, 24 Jun 2022 09:16:48 +0200 (CEST) Date: Fri, 24 Jun 2022 09:16:48 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf , christophe.leroy@csgroup.eu, naveen.n.rao@linux.vnet.ibm.com, mbenes@suse.cz Subject: Re: [RFC][PATCH] ftrace,objtool: PC32 based __mcount_loc Message-ID: References: <20220622105017.04630f12@rorschach.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220622105017.04630f12@rorschach.local.home> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 Wed, Jun 22, 2022 at 10:50:18AM -0400, Steven Rostedt wrote: > On Fri, 17 Jun 2022 13:24:53 +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. > > Wait, it's not dropped? Nothing uses it after it is read. It should be > dropped when init data is dropped. > > From include/asm-generic/vmlinux.lds.h > > /* init and exit section handling */ > #define INIT_DATA \ > KEEP(*(SORT(___kentry+*))) \ > *(.init.data init.data.*) \ > MEM_DISCARD(init.data*) \ > KERNEL_CTORS() \ > MCOUNT_REC() \ <<---- > *(.init.rodata .init.rodata.*) \ > FTRACE_EVENTS() \ > TRACE_SYSCALLS() \ > KPROBE_BLACKLIST() \ > ERROR_INJECT_WHITELIST() \ > MEM_DISCARD(init.rodata) \ > > > So it should be dropped after boot. Urgh, clearly I got lost somewhere along the line. In that case it doesn't matter nearly as much.