Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1985652imm; Thu, 21 Jun 2018 05:34:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLlaES1Hg5LixcOd04NcnM1zB3id1Zi2P+Ex/7ytDE19U+fdNCnhhLhSlan0x5AisCJunH4 X-Received: by 2002:a17:902:8d86:: with SMTP id v6-v6mr24733498plo.325.1529584488943; Thu, 21 Jun 2018 05:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529584488; cv=none; d=google.com; s=arc-20160816; b=oOcUBOeaQv7UyBkXsrWIDnbwi+DHD0Eb8FbVG4Txu7MVa7rz87GbyxHpwxsxy8yv5n Z39VLaAw7k5KrtFZpBPiqybTdG1TstPlV+RheoznEYU06vaUMtZOotCqhi9MZl/5Nhwu T+4nwDv/9Ih6NqxHRfZ+hKE/tjTcQiEjnmsgY8gwGLFx2QeHfJXsM8wZNDM7PyBA8k18 ccj60SzT2D8Rdx7ddJPNSWkoNcFf0NvCFqmNuVriEA/xtJH0GPzT1fOyazNFQfcWTeDB f+6DCJvdh8pQGTH/V7tyPkf2UH1OTA8llGQxIegl+AAuH9D8Mn1ZYsDBCbyimDbr9/hF NCmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=ksWf7PO1RkuCKYAkyFetbv7366xS9mHzoZ3UYDMiqGo=; b=NNDSaqA/LoWqfYApWGY4zRRU8Ua9iHjbr+W/b+G8BUhDrXFy9iYpiot7lvaUJVPEyW e7szGAMIQmcp/Q2d/Gwe2L6v4xqc7ZsIBdXPCvFxB/6fGBhrFLQnVE8ie3AfSZ7msMPX 0t5jO3ufs46I/h3DiksqmTSKcnIkEm2PzkhgsP4NHXqqx+9ytU10p9MmkMLfd0HLg/Au Beom+Gd5W1DgVYU0Lceik7Ng52o+8mIcYmA0KDytSPwMu+eVzJMLOr+7Y0OnsuaEkQi4 MlFJvqyzvDkS+5Fp9kK8RXFzw3hSWXINPfjubDtwYAekkByW6mgY5SBQ0M/xjaXSAjIE HnLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nAO7j46w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i83-v6si4702635pfj.190.2018.06.21.05.34.34; Thu, 21 Jun 2018 05:34:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nAO7j46w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933787AbeFUMcw (ORCPT + 99 others); Thu, 21 Jun 2018 08:32:52 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:33563 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933675AbeFUMcu (ORCPT ); Thu, 21 Jun 2018 08:32:50 -0400 Received: by mail-oi0-f68.google.com with SMTP id c6-v6so2768653oiy.0 for ; Thu, 21 Jun 2018 05:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ksWf7PO1RkuCKYAkyFetbv7366xS9mHzoZ3UYDMiqGo=; b=nAO7j46wDT97FFbwz0iUbYJLznH0RsaSCnQRNulZIW8regsLoaKtqB3f5p8Y0ju8ly /8NE/1gEGZlXgCfSOtFFalo2l3PyCcOoxg7Py6mQkkmoub6TplTVVLCdrlcKQ6X1OARB YrcqjYBk19FpLnWdyWKkwEyRpeeER42wdmdUCeMLmizFt0uBdFs0qj0PegOyDy0ryT5t JR+jsXYDW1JS9u3e86YsXQZnvlISukK1CqI0SEOJl/WoG4bKAGR32EQqhVtsdQMFli3l vso1c3G1xtG+eN4lEPEvrCT4UvVHfaiyqQssXKudpY9A7IyPiG7A4aHI5jIUN0jOeAsN VhCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ksWf7PO1RkuCKYAkyFetbv7366xS9mHzoZ3UYDMiqGo=; b=lRrutSFXul09O4vFYpx6tnnN48p3gOIjEOxTT9O9btNHnFtMqmdRCeAnST7nECO4rS ytjjEFrIgFYlJ13BRjPTwwFYKPtMuIix6S8+wZ5p87U4kurqp02HLNtsxBSlAeRIMUwF G+q+pfxeJHEVlnYD14E1GV+hE5iU5zXuRif7Gkez3J2KHF7ley+KzUkfuJLuWCMrgGvE gJy/Ju9OJfpkbdY67r7h4POKhsBwZkivt0a2h2TrTfoccTenZ2WgpYQXeBQlcgjZqTyk RiAytuJQ6KKSTBQ9F9SNSGfpEn4gczSQnFqoRu/SN0YMLFyIAXRa1BfUekuS2P68HPiY zJDQ== X-Gm-Message-State: APt69E3XdyH3wQDmWTNHi2cnRt4LDLGyjf2j3Qnp5r0BKv7Rky/1vLDX q5C+GeoLAGKj84zetxAcx4WCCdat3fcEzX1dTE/Vrw== X-Received: by 2002:aca:ab15:: with SMTP id u21-v6mr14683858oie.272.1529584369880; Thu, 21 Jun 2018 05:32:49 -0700 (PDT) MIME-Version: 1.0 References: <1529532570-21765-1-git-send-email-rick.p.edgecombe@intel.com> <1529532570-21765-4-git-send-email-rick.p.edgecombe@intel.com> In-Reply-To: <1529532570-21765-4-git-send-email-rick.p.edgecombe@intel.com> From: Jann Horn Date: Thu, 21 Jun 2018 14:32:38 +0200 Message-ID: Subject: Re: [PATCH 3/3] vmalloc: Add debugfs modfraginfo To: rick.p.edgecombe@intel.com Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , "the arch/x86 maintainers" , kernel list , Linux-MM , Kernel Hardening , kristen.c.accardi@intel.com, Dave Hansen , arjan.van.de.ven@intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 21, 2018 at 12:12 AM Rick Edgecombe wrote: > Add debugfs file "modfraginfo" for providing info on module space > fragmentation. This can be used for determining if loadable module > randomization is causing any problems for extreme module loading situations, > like huge numbers of modules or extremely large modules. > > Sample output when RANDOMIZE_BASE and X86_64 is configured: > Largest free space: 847253504 > External Memory Fragementation: 20% > Allocations in backup area: 0 > > Sample output otherwise: > Largest free space: 847253504 > External Memory Fragementation: 20% [...] > + seq_printf(m, "Largest free space:\t\t%lu\n", largest_free); > + if (total_free) > + seq_printf(m, "External Memory Fragementation:\t%lu%%\n", "Fragmentation" > + 100-(100*largest_free/total_free)); > + else > + seq_puts(m, "External Memory Fragementation:\t0%%\n"); "Fragmentation" [...] > +static const struct file_operations debug_module_frag_operations = { > + .open = proc_module_frag_debug_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > +}; > > +static void debug_modfrag_init(void) > +{ > + debugfs_create_file("modfraginfo", 0x0400, NULL, NULL, > + &debug_module_frag_operations); 0x0400 is 02000, which is the setgid bit. I think you meant to type 0400?