lkml.org 
[lkml]   [2000]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: modutils-2.3.21: modprobe looping
On Wed, Nov 29, 2000 at 07:33:53AM +1100, Keith Owens wrote:
> On Tue, 28 Nov 2000 20:22:59 +0100,
> Kurt Garloff <garloff@suse.de> wrote:
> >Find attached the modules.dep that caused this: There is a circular
> >dependency of pppoe on pppox on pppoe on ....
>
> The kernel code is broken. Circular dependencies make no sense, the
> pppoe maintainer agrees and I thought that bug was fixed.

No question that circular dependencies are a bug in the kernel/modules.
I just thought, that it would be nice if modprobe would not run crazy and
end up in an endless loop, possible risking the machine to run out of mem
with all the nice side effects this has on Linux. This is especially bad,
because modprobe is called invisibly by kmod.
Here's what happened on the test machine (2.4.0-test9 on Dual Power3):
Swapping like crazy; getting unresponsive; ...
Here's the last output top was able to produce:
10:12pm up 5:56, 3 users, load average: 1.57, 0.41, 0.16
65 processes: 63 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 36.9% user, 19.0% system, 0.0% nice, 44.0% idle
Mem: 509320K av, 508272K used, 1048K free, 28172K shrd, 76K buff
Swap: 131064K av, 107388K used, 23676K free 7048K cached

PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
23543 root 15 0 574M 472M 328 R 0 85.8 95.0 0:55 modprobe
2 root 11 0 0 0 0 DW 0 26.3 0.0 0:06 kswapd
23544 root 14 0 568 428 328 R 0 2.1 0.0 0:01 top
[...]
(10 mins later)
I'm afraid I can't wait until the machine recovers, if it ever will.
[2.2 with AA VM would have started to kill processes (which is bad)
till it would have finally killed modprobe (which is good);
but I'm afraid that 2.4 will just not survive at all :-( ]

> Circular dependencies are not supported, nor are they correrctly
> detected. The existing code to walk the inter module relationships,
> including dependencies, alias, probe, probeall, before and after
> statements is a mess. It just grew over the years with special cases
> being added and is not robust.

This is a pity, because I think the current behaviour is not acceptable,
as it can kill the machine by just being invoked by kmod.
I will try to make sense out of the code and make sure that modprobe
will not go crazy, by either detecting loops (if I can do that in a way
wihtout breaking things) or by limiting the recursion depth. I'll send
you a patch.

> In modutils 2.5 the entire code will be discarded and replaced with a
> standard graph walking algorithm with loop detection and back tracking
> instead of special case code. That might change some modutils
> behaviour in rare cases and I do not want to change its behaviour just
> before kernel 2.4 is released. I have a list of changes that might
> break backwards compatibility waiting for modutils 2.5, this is just
> one of them.

Looking forward to it.

Regards,
--
Kurt Garloff <garloff@suse.de> Eindhoven, NL
GPG key: See mail header, key servers Linux kernel development
SuSE GmbH, Nuernberg, FRG SCSI, Security
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 12:47    [W:0.051 / U:9.208 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site