netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ed W <lists@wildgooses.com>
To: unlisted-recipients:; (no To-header on input)
Cc: netfilter-devel@vger.kernel.org
Subject: Re: Performance issue due to constant "modprobes"
Date: Fri, 08 Apr 2011 18:11:09 +0100	[thread overview]
Message-ID: <4D9F41AD.5000503@wildgooses.com> (raw)
In-Reply-To: <alpine.LNX.2.01.1104080212310.8883@obet.zrqbmnf.qr>

On 08/04/2011 01:18, Jan Engelhardt wrote:

>> I have my kernel compiled without modules.  My modprobe takes a little
>> under 1ms to execute.  "iptables" appears to try and modprobe some 21
>> match/target modules.
> 
> This is your kernel calling modprobe through

I think not, or that you mean in a more roundabout fashion than I do?


>> I have dug through the code a bit and the first thing I notice is that
>> there is no --modprobe option actually parsed for, and the undocumented
>> "-M" option doesn't appear to pass through to xtables.c? (I thought
>> about simply lying about the modprobe binary name)
> 
> ip6tables.c:do_command6, near case 'M'.

I see the code, but "iptables -M /dev/null -h" still runs /sbin/modprobe
(lots)



>> The final thought is whether it's possible to notice that a module is
>> already loaded and skip the modprobe call altogether? (/proc/modules is
>> not enough because the module could be built into the kernel)
> 
> If ip_tables.ko is already loaded, iptc_init will not fail (per the 
> command above xtables_load_ko(xtables_modprobe_program, false), and 
> thus, modprobe will not be called - at least not by iptables.

Sure, but everything derived from xtables.c calls modprobe?

I'm sorry if I'm misunderstanding "who" calls modprobe, but the point is
that you can do a simple strace on "iptables -h" and without Maciej'
patch you will see a boatload of modprobe's...

Even with his patch then I still seem to get a load of modprobe's where
extra xtable matches are needed, and in my case (500Mhz processor),
modprobe is slow and also unnecessary because (nearly) everything is
compiled into the kernel

Avoiding modprobe would be very desirable in my case.  Any ideas?  (For
the moment I have just patched out the xtables.c insmod function, but
it's not very neat)

Thanks all

Ed W

  reply	other threads:[~2011-04-08 17:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 23:16 Performance issue due to constant "modprobes" Ed W
2011-04-08  0:18 ` Jan Engelhardt
2011-04-08 17:11   ` Ed W [this message]
2011-04-08  0:47 ` Maciej Żenczykowski
2011-04-08 17:11   ` Ed W
2011-04-08 19:54     ` Jan Engelhardt
2011-04-08 23:22       ` Ed W
2011-04-08 23:42         ` Jan Engelhardt
2011-04-09 20:39           ` Ed W
2011-04-09 22:30             ` Jan Engelhardt
2011-04-12 21:03               ` Ed W
2011-04-12 22:05                 ` Jan Engelhardt
2011-04-13 11:08                   ` Ed W
2011-04-13 12:06                     ` Jan Engelhardt
2011-04-13  9:10               ` Maciej Żenczykowski
2011-04-13 11:35                 ` Ed W
2011-04-13 12:13                   ` Jan Engelhardt
2011-04-13 12:35                     ` Ed W
2011-04-13 12:45                       ` Jan Engelhardt
2011-04-13 16:45                         ` Ed W
2011-04-13 19:20                           ` Mr Dash Four
2011-04-14  7:07                           ` Maciej Żenczykowski
2011-04-14  7:13                             ` Maciej Żenczykowski
2011-04-14  7:19                               ` Jan Engelhardt
2011-04-18 13:38                                 ` Patrick McHardy
2011-04-18 16:33                               ` Ed W
2011-04-19  1:12                                 ` Maciej Żenczykowski
2011-04-19  9:03                                   ` Maciej Żenczykowski
2011-04-19 16:10                                     ` Ed W
2011-04-20  1:26                                       ` Maciej Żenczykowski
2011-04-20  6:41                                         ` Maciej Żenczykowski
2011-04-20  7:31                                           ` Jozsef Kadlecsik
2011-04-20  8:54                                             ` Ed W

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=4D9F41AD.5000503@wildgooses.com \
    --to=lists@wildgooses.com \
    --cc=netfilter-devel@vger.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).