Skip to contentSkip to conversation

Shut up about the damn modules already...

PATCH In review Rusty Russell 6 participants 6 messages Feb 12, 2004 – Feb 13, 2004 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Shut up about the damn modules already...

Please apply before 2.6.3.

In almost all distributions, the kernel asks for modules which don't exist, such as "net-pf-10" or whatever. Changing "modprobe -q" to "succeed" in this case is hacky and breaks some setups, and also we want to know if it failed for the fallback code for old aliases in fs/char_dev.c, for example.

Just remove the debugging message which fill people's logs: the correct way of debugging module problems is something like this:

echo '#! /bin/sh' > /tmp/modprobe
echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe echo 'exec /sbin/modprobe "$@"' >> /tmp/modprobe chmod a+x /tmp/modprobe
echo /tmp/modprobe > /proc/sys/kernel/modprobe

Thanks!
Rusty.

kernel/kmod.c +0 -10
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.6.3-rc2-bk1/kernel/kmod.c tmp/kernel/kmod.c
@@ -105,16 +105,6 @@ int request_module(const char *fmt, ...)
 	}
 
 	ret = call_usermodehelper(modprobe_path, argv, envp, 1);
-	if (ret != 0) {
-		static unsigned long last;
-		unsigned long now = jiffies;
-		if (now - last > HZ) {
-			last = now;
-			printk(KERN_DEBUG
-			       "request_module: failed %s -- %s. error = %d\n",
-			       modprobe_path, module_name, ret);
-		}
-	}
 	atomic_dec(&kmod_concurrent);
 	return ret;
 }

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

#1 lore raw
Quoted 2 lines · Rusty Russell

Just remove the debugging message which fill people's logs: the correct way of debugging module problems is something like this:

Could you add that to Documentation/ ;)

Signature · 3 lines
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
#2 lore raw

PATCH 1/1 Documentation on how to debug modules

Quoted 6 lines · Rik van Riel
Quoted 2 lines · Rusty Russell

Just remove the debugging message which fill people's logs: the correct way of debugging module problems is something like this:

Could you add that to Documentation/ ;)

I couldn't think of, or find a good place to put this, so I put the information in it's own file. I'm only moderately sure I've generated the patch correctly. However, it does apply with patch -p1 to a clean 2.6.3-rc2-bk2 tree, so it should be fine.

The wording is a slightly changed version of what Rusty said at the start of this thread.

Signature · 2 lines
Alex Goddard
agoddard at purdue dot edu
Documentation/debugging-modules.txt +18 -0
diff -Nurp linux-2.6.3-rc2-bk2/Documentation/debugging-modules.txt personal-2.6.3-rc2-bk2/Documentation/debugging-modules.txt
@@ -0,0 +1,18 @@
+Debugging Modules after 2.6.3
+-----------------------------
+
+In almost all distributions, the kernel asks for modules which don't
+exist, such as "net-pf-10" or whatever.  Changing "modprobe -q" to
+"succeed" in this case is hacky and breaks some setups, and also we
+want to know if it failed for the fallback code for old aliases in
+fs/char_dev.c, for example.
+
+In the past a debugging message which would fill people's logs was 
+emitted.  This debugging message has been removed.  The correct way 
+of debugging module problems is something like this:
+
+echo '#! /bin/sh' > /tmp/modprobe
+echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe
+echo 'exec /sbin/modprobe "$@"' >> /tmp/modprobe
+chmod a+x /tmp/modprobe
+echo /tmp/modprobe > /proc/sys/kernel/modprobe
#3 lore raw
In reply to Rusty Russell
Quoted 9 lines · Rusty Russell

Please apply before 2.6.3.

In almost all distributions, the kernel asks for modules which don't exist, such as "net-pf-10" or whatever. Changing "modprobe -q" to "succeed" in this case is hacky and breaks some setups, and also we want to know if it failed for the fallback code for old aliases in fs/char_dev.c, for example.

Just remove the debugging message which fill people's logs:

Yup, those messages are really annoying.

I'm wondering why it is that the kernel is asking for non-existing modules so often. Is it that userspace applications try to access all kinds of devices too often (autoprobing) or it this (wanted) kernel behaviour?

If it is the former, I think that applications should be fixed in the first place. Maybe userspace and kernel should share knowledge about what devices are there and supported by the kernel(modules).

In the meantime, your patch needs to go in though because fixing this in userspace is not something that will happen on short term.

Regards,

Bas.

#4 lore raw

[trimmed back Cc:]

Quoted 4 lines · * Bas Mevissen ([email protected]) wrote:

I'm wondering why it is that the kernel is asking for non-existing modules so often. Is it that userspace applications try to access all kinds of devices too often (autoprobing) or it this (wanted) kernel behaviour?

The most common and annoying example (the one Rusty used), "net-pf-10," is a result of a userspace app doing simple socket(AF_INET6,...).

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
#5 lore raw
In reply to Bas Mevissen
Quoted 4 lines · Bas Mevissen

I'm wondering why it is that the kernel is asking for non-existing modules so often. Is it that userspace applications try to access all kinds of devices too often (autoprobing) or it this (wanted) kernel behaviour?

Userspace probes the kernel to see if IPv6 is available by trying to create an IPv6 socket.

The correct solution is to fix /etc/modprobe.conf such that it doesn't try to load the module when you don't have it configured:

install net-pf-10 /bin/true

Note that if you alias net-pf-10 to ipv6 before this install line, you need to replace net-pf-10 with ipv6 in the install line.

PS, I notice Arjan's RPM packages don't seem to contain the modprobe.conf manual page... maybe this is what's causing some of the confusion?

PPS, It might also help to either mention in the man page that the above corresponds to the original "alias modulename off" _or_ add "install off /bin/true" into modprobe.conf.dist such that the old alias line works as expected.

Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core