[lkml]   [2017]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/3] module: minor allocation optimization
Long ago I was debugging kernel/module.c and kernel/kmod.c and had
implemented a sanity check to avoid allocating much of the needed struct
module from what user passes on finit_module() too early, ie, before
checking if the module was actually loaded.

I had disregarded this work as I had bundled it up with some aliasing
work I had done, so incorrectly thought this depended on the alias work.
Upon a second look it does not. The module name set on userspace on
info->name is not the alias but the proper module name, as such using
finished_loading() should suffice once to avoid allocating the module
if its already present.

I've tested this with and found no regressions, the few minor
enhancements are documented in patch 3 in detail. I'll let 0-day hammer
on it as we review the patches [0] [1] but no build issues so far.


Luis R. Rodriguez (3):
module: add an early early_mod_check()
module: move finished_loading()
module: avoid allocation if module is already present and ready

kernel/module.c | 81 ++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 49 insertions(+), 32 deletions(-)


 \ /
  Last update: 2017-12-08 01:16    [W:0.048 / U:6.172 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site