Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp534291rdg; Thu, 12 Oct 2023 12:49:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9SNG2v+DmgqqLW1LR03/ttdj2j0ChDOxxL5VYVdB5KvIdVwBh8i/sqp2zp4DG6a8vJkJq X-Received: by 2002:a17:902:db0c:b0:1c7:54ee:c560 with SMTP id m12-20020a170902db0c00b001c754eec560mr24436915plx.55.1697140159373; Thu, 12 Oct 2023 12:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697140159; cv=none; d=google.com; s=arc-20160816; b=R8mqQ6cDObro/uPe45VHF7gY4flZOLDT10oSuNYXNpS/TsmWUl4jFicWV1oeNo98aF TTm7nuOH/Z9SQmSY/7cVF2hXGPzYzPJxrXAtu+vRDcfIrwQNYSzXGHrYnZPyM8iyhUPf NOoC2Zd7JLsqa5R8I1UB8x4e80W4ads1g4V1q3Sm0h1cZwLy87tjbfEpuUx+FaDt5ewY 8CnksSFyM6ky51U5HXrKfwK9ewmPkCF+pvfRdUxF0UHktpvaTg/NBnm7tH5Q9OvSjiFO XQSBaeY+uFR9qVVlUwUv/XHk4UzXHLC0TMNHuQwpbLPqaFHfxiAqfaUr+chThCKDzECY cuuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=J26zzzV+rsRrtzvFakAziiZJUnlN/p9jMvjOqrUCer8=; fh=QGhCf3r+qE7UWwRZtmZCY26fJFmBvome5LTRGXByDtc=; b=0IXu+D3D4ElONji5kLlfpCaoobm3EoaPKeRTVSmCe5e0p/bIptgFAeqYYJtebcRhsr hvQKBndyGEWbW75OqqRRrFwZCFat3nNyJ25Z4Wi9pxDKSxuR5vvpIpjgmmUrgz40DePG 0ULCgOQzJNV/0MT7lnMwrbS1f49t99gyulB2qGTNTVlZyhey/rUHmwTfYg7RDJxg4Ryq 9KmQDIx6a1W1Jx+9hSJ7zkLIKhSgc8h1xzsWPU/LYOFtOey/g5XKV1761AfohyY31tEg EKc3NGPhmDxcq8jweKznc+F/FT3p15fTLq872IgpwnAG1R3jkjFLXgj4lBKfQt5zhAd5 c6/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="fTJ/q4xR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id jo6-20020a170903054600b001b89551a392si2688580plb.113.2023.10.12.12.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:49:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="fTJ/q4xR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A2017826EB9F; Thu, 12 Oct 2023 12:49:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442875AbjJLTtJ (ORCPT + 99 others); Thu, 12 Oct 2023 15:49:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442688AbjJLTs7 (ORCPT ); Thu, 12 Oct 2023 15:48:59 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34978D51 for ; Thu, 12 Oct 2023 12:48:37 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7a2bfd584f0so57765939f.0 for ; Thu, 12 Oct 2023 12:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697140117; x=1697744917; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=J26zzzV+rsRrtzvFakAziiZJUnlN/p9jMvjOqrUCer8=; b=fTJ/q4xRGHi7Ahddn7liWlR7kh+mhyqH2V/UszGwYP3cxm50Fea2HWtOeukq1SR+Q6 x9A0vk9JtJIj7Qbe+WAtBuw8LYUIMm4kaP2HmYN01/OIcY2Tdx0xRUVj4G8NzjHCW0GP WHfN6eP2ZNYT00cCyi/uCKLYCrlr7WKRKpHeWYCYw0jhnPJ6E/H3+mCHHcrjJHNEbq9O +Vq09zM3/KjBTTk481FX+xMJU0TX2rbP4HzNVgdNSeCs7zl8Pu4Ndv1wZZbA1D1zuQ6j pBDqC7F4o6+0y4IxQEkE1qQyAd3ztM9t1drfiSLS1FCwvk3Jcb98pdZeRDSPniMGtLsD JZ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697140117; x=1697744917; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=J26zzzV+rsRrtzvFakAziiZJUnlN/p9jMvjOqrUCer8=; b=E8CI+EWp4KN0bi6OayLNtsxtrFObqWB+IL4QXVXfwgVQ6JRX44cC5jQD1MY0vfsFGl 5K2LFbypKS5pCGVxdQNeUHSS/M44tQ/hTkDYLXnlu5JM/PZ+0GNBpT2EAwlpaXDuxI2s py6E/Ca/Y9RCKTaozYVOXjWj1DOZG+4xXlHwKAwaswtDN9Pi3EvmW9vlO96GdKyjlA+e 7GXD3BnhzXMxVjWirqzJV8E1R+vezWAI8yYcqOFJqyvH8yHFfhj9to2Z8lZar5qxfTwK vXVhBbmU4MjOK5CbEDc8cAim8Bsueqae3BWu82ydO9z/KiTjh7gwlx7jN0vUzc6b80Zu M/Nw== X-Gm-Message-State: AOJu0YygxWNRf246ltEwf1mdp2iw+bNE+GarZ1dZA0lDx3jM1H0T+l9X 88o47410jcrpFSdAHC2kTSA6T6AOOTznMQ== X-Received: by 2002:a5e:a916:0:b0:794:eaef:f43e with SMTP id c22-20020a5ea916000000b00794eaeff43emr25695573iod.1.1697140117074; Thu, 12 Oct 2023 12:48:37 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id h6-20020a5d9e06000000b007a25540c49bsm4307891ioh.27.2023.10.12.12.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:48:36 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: david@redhat.com, lb@semihalf.com, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Liam.Howlett@Oracle.com, linux-mm@kvack.org, Jim Cromie Subject: [RFC PATCH 00/10] how to reclaim unneeded vmlinux memory ? Date: Thu, 12 Oct 2023 13:48:24 -0600 Message-ID: <20231012194834.3288085-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Thu, 12 Oct 2023 12:49:16 -0700 (PDT) For builtin modules, dynamic-debug allocates blocks of memory into DATA, via vmlinux.lds.h. dyndbg's struct _ddebug has fields: modname, filename, function, which keeps the the code's structural/organizational info used to enable & prefix prdbg callsites. The linker packs the callsites in-order, which means the repetition in those 3 columns can be compactly encoded in non-overlapping intervals. So this saves each unique column-val and its interval into a maple-tree per column, and retrieves them as needed with accessors. It also splits out _ddebug_site and __dyndbg_sites section, and no longer needs the section, so that block is ready to reclaim. Somethings wrong with patch-9, but it seems worth showing around. Jim Cromie (10): dyndbg: prep to isolate 3 repetetive fields dyndbg: split __dyndbg_sites section out from __dyndbg dyndbg: add 2nd cursor pair to init-fn dyndbg: save _ddebug_site mod,file,func fields into maple-trees dyndbg: avoid _ddebug.site in ddebug_condense_sites dyndbg: add site_*() macros to avoid using _ddebug.site dyndbg: wire in __desc_*() functions dyndbg: drop _ddebug.site member dyndbg: add dd_clear_range to prune mtrees dyndbg: cache the dynamically generated prefixes per callsite include/asm-generic/vmlinux.lds.h | 1 + include/linux/dynamic_debug.h | 40 +++-- kernel/module/main.c | 3 + lib/dynamic_debug.c | 238 +++++++++++++++++++++++++++--- 4 files changed, 252 insertions(+), 30 deletions(-) -- 2.41.0