Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp533633rdg; Thu, 12 Oct 2023 12:47:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFO4KHzp0KAx6jQlRxfrvljndSe90iEjispfybWaXHnnGMfuKKSW4lwjDZ914NayQjW5wMm X-Received: by 2002:a05:6358:7e49:b0:135:5ede:f352 with SMTP id p9-20020a0563587e4900b001355edef352mr28140380rwm.8.1697140064298; Thu, 12 Oct 2023 12:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697140064; cv=none; d=google.com; s=arc-20160816; b=mt0dPVwURKG2R7U96yCDad5ujlg7RaMgBxB8ZVsJFQWNNinSCdgWBtqi2eueRaTUoZ JJjFo2lGt4VMYWj0JzoSwCDtQ2NXiru4d47fV9NoswjdLP+n9xhAvKk9B0gWAw2cNX6M MjqBjBpxDUdYV6y8kcHVaQTEYdECjA7Pt0QQs+CakZlknNOLP2mGDII1pJB7E3AguLhf 6uK1rTn3OnesNqWLPDyU1+6fXAf7U9HVXxpqOOHtDdXNm7fzFlK+MNUfc7GSk/WxGL4o YiMVLmKSBamnL37V3UItLr2zPYcHPAElq1wPEsfBK37Hd0jB0annCuTQbhAutWYTTi6G V3ow== 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=7ljCN0LusJ7JrIo0b2q68gdLb7KZwh2dqCYB6NR0RGQ=; b=i0hyY836N6+z7THjAgfm7tj0XVp1HJmu7Xt7dRIylJMsshrbHRNRQ4v1jKnZ54FbG5 W1Lt1Hl/L9MR8ExP+HfUPqvt+qWccDCFZQWbLGvjzW4NqvNthxQZPQWyhx/AOKcTVBKf NwYVvz+exb2dkQeXjQeUH/1j6lwZNK4ljWWttljsJCAzlAPXiEiRwNeUyHrE5myt9ulV 60nGosVxn5dGHjnnvEB+ChB60jDlopiDdXYF9lsHWsd/11GkjSBeNv0jPpNIcSCcDpQ2 os4rrwKoCpRrworKY6WvYqEndfk1FQg1CEosU+dqWjHWrh9oPbg7jukaQnVrAxBw4Sm9 ZR5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VCQgbvcy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id d4-20020a056a00244400b0068fea8a6169si15142940pfj.404.2023.10.12.12.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:47:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VCQgbvcy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 9D318846831F; Thu, 12 Oct 2023 12:47:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442211AbjJLTr0 (ORCPT + 99 others); Thu, 12 Oct 2023 15:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442434AbjJLTrY (ORCPT ); Thu, 12 Oct 2023 15:47:24 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA3B0CF for ; Thu, 12 Oct 2023 12:47:21 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-79fa891b645so51172139f.0 for ; Thu, 12 Oct 2023 12:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697140041; x=1697744841; 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=VCQgbvcyVH7DIMhFK5ynoP3ivVP/wKu41taviH3CPirvxCZGa0kitdYRuTTLAeaMdG 6R79PhOWe+hBL1BiJcI1ITNq7bcqB2E6u92Mwyq2Mds98ONVx4xQrIQBpXIioBrVaiSK vYFOyVKUndQbMefAbLdJJ1/ZXg5T0AmdHcibaLbPMXfrHIDvg4WZfTe1BSk3j/VPnE+3 ReJ6q9AzR/tv9NWBOsls7b3et1BMyY4PNPcSaRUTMHHW4Epcmdy+UDAFPdkgFACpJRho eBLYWjNuBK22KvxK0yty6oiAKhckVPbcUsUZUVl2YlcEGjy0ueI9fZhKoFZS/eCNiLA3 Xwcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697140041; x=1697744841; 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=qUyP57bMHrplPsUJ3YxAcQ3mW6xkllhQgDY4hKpe34dOWMzJWDW2h+KsTL7vm+/NG6 rYtN9219Yr64iXSOACL3CDVCioMjCh13C2bWORbQ9y5D70wE+ampgL3e5fb+SjSYrrqR FwIlFSrPdE/qUz5hV6pg3AA4uTJLNKV9Ned0YOit2oCjdoF8s8/fNUlo0uKELHA+uSTE UTvPK0W4GFfUoLJBN1SgZirIj/GMrAQwxgo9fykDr2s8gf1YpVUYNaP/zTrewOs55m+Y TfRi7Qtg0SL4ugDZKtppX61G5QTBazFLq10imDEhYNGATCwZYzuF6E9FgFJ6MvlAVRmk WngQ== X-Gm-Message-State: AOJu0Ywwh/YV4stTc3uBkP/jrOTZk4x+Eu/YZWS/JfcP/xQrB1qA8VaF x03dt24g06Ry8ISBvCIaN2fw+F1P9u+Qgw== X-Received: by 2002:a05:6602:2012:b0:7a2:ac5a:89c3 with SMTP id y18-20020a056602201200b007a2ac5a89c3mr27212332iod.1.1697140040910; Thu, 12 Oct 2023 12:47:20 -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 z7-20020a5ec907000000b0079fbb834232sm4351002iol.19.2023.10.12.12.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:47:20 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org Cc: david@redhat.com, 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:47:01 -0600 Message-ID: <20231012194711.3288031-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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 12 Oct 2023 12:47:37 -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