linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: jeyu@kernel.org, willy@infradead.org, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	kernel-hardening@lists.openwall.com, daniel@iogearbox.net,
	jannh@google.com, keescook@chromium.org, kristen@linux.intel.com,
	dave.hansen@intel.com, arjan@linux.intel.com
Subject: Re: [PATCH v8 4/4] Kselftest for module text allocation benchmarking
Date: Tue, 6 Nov 2018 13:05:57 -0800	[thread overview]
Message-ID: <20181106130557.11bfeddafe103bb609352aba@linux-foundation.org> (raw)
In-Reply-To: <20181102192520.4522-5-rick.p.edgecombe@intel.com>

On Fri,  2 Nov 2018 12:25:20 -0700 Rick Edgecombe <rick.p.edgecombe@intel.com> wrote:

> This adds a test module in lib/, and a script in kselftest that does
> benchmarking on the allocation of memory in the module space. Performance here
> would have some small impact on kernel module insertions, BPF JIT insertions
> and kprobes. In the case of KASLR features for the module space, this module
> can be used to measure the allocation performance of different configurations.
> This module needs to be compiled into the kernel because module_alloc is not
> exported.

Well, we could export module_alloc().  Would that be helpful at all?

> With some modification to the code, as explained in the comments, it can be
> enabled to measure TLB flushes as well.
> 
> There are two tests in the module. One allocates until failure in order to
> test module capacity and the other times allocating space in the module area.
> They both use module sizes that roughly approximate the distribution of in-tree
> X86_64 modules.
> 
> You can control the number of modules used in the tests like this:
> echo m1000>/dev/mod_alloc_test
> 
> Run the test for module capacity like:
> echo t1>/dev/mod_alloc_test
> 
> The other test will measure the allocation time, and for CONFG_X86_64 and
> CONFIG_RANDOMIZE_BASE, also give data on how often the a??backup area" is used.
> 
> Run the test for allocation time and backup area usage like:
> echo t2>/dev/mod_alloc_test
> The output will be something like this:
> num		all(ns)		last(ns)
> 1000		1083		1099
> Last module in backup count = 0
> Total modules in backup     = 0
> >1 module in backup count   = 0

Are the above usage instructions captured in the kernel code somewhere?
I can't see it, and expecting people to trawl git changelogs isn't
very friendly.

  reply	other threads:[~2018-11-06 21:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02 19:25 [PATCH v8 0/4] KASLR feature to randomize each loadable module Rick Edgecombe
2018-11-02 19:25 ` [PATCH v8 1/4] vmalloc: Add __vmalloc_node_try_addr function Rick Edgecombe
2018-11-06 21:05   ` Andrew Morton
2018-11-07 20:03     ` Edgecombe, Rick P
2018-11-02 19:25 ` [PATCH v8 2/4] x86/modules: Increase randomization for modules Rick Edgecombe
2018-11-06 21:05   ` Andrew Morton
2018-11-07 20:03     ` Edgecombe, Rick P
2018-11-02 19:25 ` [PATCH v8 3/4] vmalloc: Add debugfs modfraginfo Rick Edgecombe
2018-11-02 19:25 ` [PATCH v8 4/4] Kselftest for module text allocation benchmarking Rick Edgecombe
2018-11-06 21:05   ` Andrew Morton [this message]
2018-11-07 20:03     ` Edgecombe, Rick P
2018-11-06 21:04 ` [PATCH v8 0/4] KASLR feature to randomize each loadable module Andrew Morton
2018-11-07 20:03   ` Edgecombe, Rick P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181106130557.11bfeddafe103bb609352aba@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=jeyu@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kristen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).