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.8 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,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 62517C433DF for ; Wed, 5 Aug 2020 18:31:44 +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 0978A22CE3 for ; Wed, 5 Aug 2020 18:31:43 +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="Z07E6lLG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0978A22CE3 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 1k3OBR-0001tk-7O; Wed, 05 Aug 2020 14:30:37 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1k3OBP-0001tf-Dr for kernelnewbies@kernelnewbies.org; Wed, 05 Aug 2020 14:30:35 -0400 Received: by mail-ot1-x344.google.com with SMTP id a65so24954129otc.8 for ; Wed, 05 Aug 2020 11:30:34 -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=9kHcENHfOk0Z7RLdcjY6U9l6EElyJ+hkoNJSPGTLPYs=; b=Z07E6lLGII+uvxMqctUgcRCs44xt4IZ57ceyyzu8pG/apWLZYAqzJ1QlfXvAJnweQB +MM6R8KqirH8ZsvrLAZj8UzDBvIoWGk7nzHoS/nUt8UHoHTp2JI83EIp3pPQ/7cXGh/O 0LbnanEZ2U0MBXU1MlV+3ZQCkzPWLJxuFCP2LAMNSAFZA0UZGKwp/FGgz6/chicrR3/S obk3G1klipTkqD/agDBG+Xpn8wa83VdgL95xH49vPukICk1l1RsMnypJ+P8MCIrUB2Py WEdeXNcTbWACZ09WBvUCTv4pb6b270EBCHtgTvoWEw3ZRYJ6ChIxcTMeZeumSfOrKbhb OZvw== 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=9kHcENHfOk0Z7RLdcjY6U9l6EElyJ+hkoNJSPGTLPYs=; b=j5/BGkcyjW4Y3CQ8SsKQkSoEphr8ORn8VYDIbK30zOLxbtUH56iZi4QQhL8p5gfRHi rI/kG7JucxUCLhs97j54GEK0D7UBvK5oALZr14hKMnlLr+HJ8TiJvipj17DFycvMM4qY dIe46HlpDBKwnk9GcCFfQ4W/MEInyW94UrRrsczyeFGyU4+qsvOaa3P7z6xMSk3PcKxU cKcCD/DqD50hX5WuWwMEUMSVqVCz50RlIBtO9tLgT3CIKntubBkntIa+T77XA27Da09+ cgt4yBiEEzv+BjEEt+aVACortESy49iMjuus0BRZMUjawGKOOhzUp7vPfcKaVA7gfD4Q 9Z3w== X-Gm-Message-State: AOAM530SWCBPYSULdZcdHFkiTx1xrT8QjlrSUFI+GLG/oqBKu0fD2z/D VNWhxPT3KzMoSzjAsHxe0Zg= X-Google-Smtp-Source: ABdhPJx2QbxHMHpJn/tU1mmjhX0CUTeluVnuFLVOM0kfga7lfZWC9s6qD17JxWgVKw26MNtcwvLZew== X-Received: by 2002:a9d:4049:: with SMTP id o9mr3731460oti.112.1596652233470; Wed, 05 Aug 2020 11:30:33 -0700 (PDT) Received: from frodo.hsd1.co.comcast.net ([2601:284:8204:6ba0::1eb0]) by smtp.googlemail.com with ESMTPSA id t83sm596948oot.22.2020.08.05.11.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 11:30:32 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com Subject: [PATCH 0/8] dyndbg: WIP diet plan Date: Wed, 5 Aug 2020 12:30:15 -0600 Message-Id: <20200805183023.586590-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 is effectively an array of struct _ddebugs, its 1st 3 members are highly repetetive, with 90%, 84%, 45% repeats. Total reported usage ~150kb for ~2600 callsites on my laptop config. This patchset is one diet plan. it all holds together nicely until the "cache" commit, when it blows up starting init (or right after freeing unused kernel image, which Im hoping to do...). The following commit tweaks locking in an attempt to recover, but fails. [ 0.737936] Freeing unused kernel image (initmem) memory: 1196K [ 0.740173] Write protecting the kernel read-only data: 22528k [ 0.743555] Freeing unused kernel image (text/rodata gap) memory: 2040K [ 0.744984] Freeing unused kernel image (rodata/data gap) memory: 256K [ 0.757777] Run /bin/sh as init process q[ 1.029548] Kernel panic - not syncing: Requested init /bin/sh failed (error -14). [ 1.034582] CPU: 0 PID: 1 Comm: sh Not tainted 5.8.0-00026-g9a06159192d6 #14 [ 1.036068] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-2.fc32 04/01/2014 [ 1.037885] Call Trace: [ 1.038444] dump_stack+0x5e/0x7a [ 1.039172] ? memcpy_orig+0x100/0x10f [ 1.039917] panic+0xf6/0x2b7 [ 1.040573] ? rest_init+0xa0/0xa0 [ 1.041314] kernel_init+0xaa/0x100 [ 1.041956] ret_from_fork+0x22/0x30 [ 1.042668] Kernel Offset: disabled [ 1.043216] ---[ end Kernel panic - not syncing: Requested init /bin/sh failed (error -14). ]--- QEMU 4.2.1 monitor - type 'help' for more information (qemu) q Im sending to kernelnewbies 1st, to see if theres any low-speed test-crashes I can get post-mortems of, before I take it to the races. Id appreciate any reviews, tests, or opinions you all might offer (in that order). I built for and tested on a virtme instance, 4/5 configs build and test sane as described, the 5th is probly dead from too many hacks. if you use git, and wanna just try it, you can find it here: git remote add .. # u dont need full clone https://github.com/jimc/linux.git dyndbg-diet branch I had good success with virtme, -q=-s -q=-S, and gdb target remote, all newbies should try it. These are on top of 5.8.0 +18 others, which GregKH added to his char-misc-testing &next trees. Jim Cromie (8): dyndbg: give %3u width in pr-format, cosmetic only dyndbg: motivate a diet plan dyndbg: select ZPOOL in Kconfig.debug dyndbg: split struct _ddebug in 2, creating _ddebug_callsite dyndbg: WIP replace __dyndbg_callsite section with a zs-pool copy. dyndbg: ddebug_zpool_remove dyndbg: enable 'cache' of active pr_debug callsites dyndbg: add locking around zpool-add loop in zpool-init include/asm-generic/vmlinux.lds.h | 4 + include/linux/dynamic_debug.h | 39 ++++-- lib/Kconfig.debug | 1 + lib/dynamic_debug.c | 223 +++++++++++++++++++++++++----- 4 files changed, 223 insertions(+), 44 deletions(-) -- 2.26.2 _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies