Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4570AC433E4 for ; Sat, 25 Jul 2020 16:37:13 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DC90206E3 for ; Sat, 25 Jul 2020 16:37:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VV+u/vWo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DC90206E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1jzN9m-0000Lo-Fz; Sat, 25 Jul 2020 12:36:18 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1jzN9i-0000LZ-RY for kernelnewbies@kernelnewbies.org; Sat, 25 Jul 2020 12:36:15 -0400 Received: by mail-ot1-x342.google.com with SMTP id 95so9288446otw.10 for ; Sat, 25 Jul 2020 09:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wTMzIB9G23XfIkDxtPG9cJyyBO0T5HBvECYn4SSQL+8=; b=VV+u/vWoGKYJymJdstAiTLIupGbRv6rS4R0raO5YBJI7mtbCiHB4wg7LpLNFkWPPKL JxYUkPI3mcbaeU9mR/B/A9JNGmpiyGgjzsz61rKoGETcMwa0JbQoEhA3fCoVsJtjWPHd F44Dnipx1yDN5iNAxBJh1TMEnfMIW9oUKXgGmFlhN9Mg8+p3DjI9S2PntuzNryytprRh lKA1/uSlpgwCtvFluL2kkLXn1otfIkd/orGqE3GrRXRhWZ5ljuap1+inZXZAWfL0M1XK E3QoEHuyUWPp4tADFCZ/0lJ4AfQgEknWfNBA/QmDKXuFL12QdJO2knyNEXw4PVfuG04p Fezw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wTMzIB9G23XfIkDxtPG9cJyyBO0T5HBvECYn4SSQL+8=; b=m6qaXGdhUUQeLYZ/hLkxkUn+pDeBbVMSft8R3f132ianD8xjYlc1ekMeTJUJjhcxZo rA9z9lqQG7FbzWeaiyJr/tY1oAczCXT+2gw1HBi28uNdiKX+KKOsJouTXkkAE/PoP7oS 9ZxigNwXzDnQeb3t36a5QIQ0w7lYvO7ouW5Za2W+6tJ24DTElrXkCE8pImhlC99GQJaU 3C/EGlRqvf6dm5twiyMf8RE58Xme8dxxj0wEDFwvn16IwCoWGi6eUiOWlQolhlorysG0 YDrGN7JG4wsnt3PJ5EWJsPYHj6j18EasUHfAYbDJJcUhcatPkhUn429ixhWJMCxIb0W/ M3vA== X-Gm-Message-State: AOAM5309KJ0yQQbdPgfUNhaphVceTdANU7/QfSYTtimMoFt9Nztt3uYV RAoOn+FjFvR0+nKJaQxuwtM= X-Google-Smtp-Source: ABdhPJxeF3Zy9t1E4MGOE+3uloDhVQ3UDm4+YsJsBIoosefYhsLQk3n9KRDX4tf55YMo9sc3l3WPRg== X-Received: by 2002:a05:6830:1e22:: with SMTP id t2mr13686371otr.332.1595694971582; Sat, 25 Jul 2020 09:36:11 -0700 (PDT) Received: from frodo.hsd1.co.comcast.net ([2601:284:8204:6ba0::af38]) by smtp.googlemail.com with ESMTPSA id r1sm953938oij.44.2020.07.25.09.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jul 2020 09:36:10 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com Subject: [PATCH 0/3] dyndbg: WIP semi-viable diet plan ? Date: Sat, 25 Jul 2020 10:35:59 -0600 Message-Id: <20200725163602.2828969-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Cc: Jim Cromie , kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org dynamic-debug metadata is bloated; the __dyndbg linker section, filled by DYNAMIC_DEBUG_METADATA, has 3 fields with 90%, 84%, 45% repeated values, consuming ~150kb on my laptop. Instead of an arduous restructuring of the data, lets stuff it into zram, get whatever compression it gives us for free, and be able to map and unmap individual records on demand. Once map/unmap suffices for internal needs, the whole __dyndbg section can be reclaimed. From this, it seems practical to push it into zswap, and then to keep active/enabled callsites mapped into ram, like a cache. But thats a lot of stuff I can only handwave about. Please fill in details or call BS. This patchset makes a decent start down that path, but theres a boatload of chatter in the commit-logs about options and maybes, and brave projections about whats possible. Blah Blah. Theres almost certainly some subtle/ornot thinkos. Please point them out. I probably have some terminology cleanup to do too. I punted with lazy names a lot & welcome better ones some // comments too - not for submission I'll try to summarize here. - The easiest thing is to stuff whole struct _ddebug contents, into an anonymous struct, along with a new zhandle, into a new zpool. This is done in patch 1. this defers the unionization, so it just enlarges the ram footprint. - patch 2 attempts to distinguish zhandles from pointers, by making zhandles odd, and testing with %2. This works fine before unionization, falls over afterwards. - The unionization is in patch 3, and it works, at least casually. The fix-on-2 is to add an explicit flag; is_zhandle, and drop the %2 test, which fails when it encounters an odd pointer in the __dyndbg section. the structs/unions must be reworked to actually save any ram - for non-JUMP_LABEL builds, putting whole struct _ddebug into zram is problematic; it means pulling out whole record just to check the am-i-printing flag, a horrible cost. - pulling flags into a separate flags vector would solve that, and would be 'tight' on ram; no paholes, good grouping of flags for callsites enabled with module=foo function=bar file=buz etc. But it creates new ones Im stuck on. - an 'opaque' descriptor might be the magic needed, but Im pretty clueless on how to proceed. Anyone got any pointers to good examples in the tree ? This patchset is on top of other dyndbg patches, which are now in gregkh's char-misc git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git in the char-misc-next branch. Jim Cromie (3): dyndbg: WIP replace __dyndbg section with a zs-pool copy. dyndbg: zhandle+1 plus info tweaks, BUG_ONs dyndbg: fixup/correct assumptions re ptr-vals include/linux/dynamic_debug.h | 9 ++ lib/dynamic_debug.c | 172 ++++++++++++++++++++++++++++++++-- 2 files changed, 171 insertions(+), 10 deletions(-) -- 2.26.2 _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies