linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 242-ac3 loop bug
@ 2001-02-24 17:32 Mark Swanson
  2001-02-24 17:59 ` Doug McNaught
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Mark Swanson @ 2001-02-24 17:32 UTC (permalink / raw)
  To: linux-kernel

First, good job on the loop device. It's rock stable for me - except
when I try to load the blowfish module which oops the kernel and
crashes the loop device:-) No problem, I just use another cipher.

The bug I'm reporting is that when a loop device is in use the load of
the machine stays at 1.00 even though nothing is happening. If I umount
the loop filesystem the load goes down to 0.00.

> ps -aux | grep loop
1674 tty1     DW<   0:00 [loop0]

The system is doing nothing to the loop filesystem.
Strange that the process isn't logging any cpu usage time. It's
definately responsible for the 1.00 load.



__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
  2001-02-24 17:32 242-ac3 loop bug Mark Swanson
@ 2001-02-24 17:59 ` Doug McNaught
  2001-02-24 18:11   ` Mark Swanson
  2001-02-24 19:18 ` Arjan van de Ven
  2001-02-24 23:14 ` Jens Axboe
  2 siblings, 1 reply; 10+ messages in thread
From: Doug McNaught @ 2001-02-24 17:59 UTC (permalink / raw)
  To: Mark Swanson; +Cc: linux-kernel

Mark Swanson <swansma@yahoo.com> writes:

> > ps -aux | grep loop
> 1674 tty1     DW<   0:00 [loop0]
> 
> The system is doing nothing to the loop filesystem.
> Strange that the process isn't logging any cpu usage time. It's
> definately responsible for the 1.00 load.

It's just an artifact of the fact that processes in state D
(uninterruptible sleep) are included in the load average calculation.
Since the loop thread apparently sits in state D waiting for events
on its device, you get a load average of 1 for each mounted loop
device. 

I know nothing about the implementation of the loop thread so won't
presume to say whether/how it can be "fixed". 

-Doug

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
  2001-02-24 17:59 ` Doug McNaught
@ 2001-02-24 18:11   ` Mark Swanson
  2001-02-24 18:57     ` Doug McNaught
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Swanson @ 2001-02-24 18:11 UTC (permalink / raw)
  To: Doug McNaught; +Cc: linux-kernel


--- Doug McNaught <doug@wireboard.com> wrote:
> Mark Swanson <swansma@yahoo.com> writes:
> 
> > > ps -aux | grep loop
> > 1674 tty1     DW<   0:00 [loop0]
> > 
> > The system is doing nothing to the loop filesystem.
> > Strange that the process isn't logging any cpu usage time. It's
> > definately responsible for the 1.00 load.
> 
> It's just an artifact of the fact that processes in state D
> (uninterruptible sleep) are included in the load average calculation.
> Since the loop thread apparently sits in state D waiting for events
> on its device, you get a load average of 1 for each mounted loop
> device. 

My thought was that the calculation seems to be misleading. The loop
process isn't taking up any CPU time. My applications are running
faster than ever. I'm guessing that ps (and /proc/loadavg) need to make
the distinction between:
1. uninterruptable sleep - where the process is blocking but taking
0CPU
2. uninterruptable sleep - I/O is happening using CPU

But I may not understand what uninterruptable sleep is supposed to
mean.

Take sendmail for example. Its default configuration for Linux won't
send attachments if the machine's load is too high. If I have 8 loop
devices in use and the load is at least 8, this may affect how sendmail
operates.



__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
  2001-02-24 18:11   ` Mark Swanson
@ 2001-02-24 18:57     ` Doug McNaught
  0 siblings, 0 replies; 10+ messages in thread
From: Doug McNaught @ 2001-02-24 18:57 UTC (permalink / raw)
  To: Mark Swanson; +Cc: linux-kernel

Mark Swanson <swansma@yahoo.com> writes:

> --- Doug McNaught <doug@wireboard.com> wrote:
> > It's just an artifact of the fact that processes in state D
> > (uninterruptible sleep) are included in the load average calculation.
> > Since the loop thread apparently sits in state D waiting for events
> > on its device, you get a load average of 1 for each mounted loop
> > device. 
> 
> My thought was that the calculation seems to be misleading. The loop
> process isn't taking up any CPU time. My applications are running
> faster than ever. I'm guessing that ps (and /proc/loadavg) need to make
> the distinction between:
> 1. uninterruptable sleep - where the process is blocking but taking
> 0CPU
> 2. uninterruptable sleep - I/O is happening using CPU
> 
> But I may not understand what uninterruptable sleep is supposed to
> mean.

Well, "sleep" means we're not using CPU at all; we're waiting for
something.  Remember, "load average" isn't purely a CPU measure.

Historically, state D has meant "fast" i/o--reading from disk or tape,
where the result is supposed to be available very soon and it's not
worth doing the extra housekeeping to sleep interruptibly.  Processes
aren't supposed to sit in state D for more than a fraction of a
second.  This being the case, Unix has always factored state D
processes into the load average.  For your distinction to work, there
would have to be an extra flag somewhere saying "I'm in state D, but
don't factor me into the load average", with corresponding code in the
load average calculation routine to honor the flag.  Doable, but not
useful up to now, and only (possibly) worth doing if we get more
threads like the loop driver that sit in D state for a long time. 

This is the first example I've seen in Linux of something sitting in
state D for a long time on purpose.  I agree that IMHO it's not ideal
(for the reason you outline below, mainly).

> Take sendmail for example. Its default configuration for Linux won't
> send attachments if the machine's load is too high. If I have 8 loop
> devices in use and the load is at least 8, this may affect how sendmail
> operates.

Yup. 

The whole Sendmail/load average thing needs careful thought anyway
when setting up a production system--a load average of 8 on an 8-way
system, for example, is a much lighter load than a load of 8 on a
single-CPU machine.

-Doug

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
  2001-02-24 17:32 242-ac3 loop bug Mark Swanson
  2001-02-24 17:59 ` Doug McNaught
@ 2001-02-24 19:18 ` Arjan van de Ven
  2001-02-24 23:14 ` Jens Axboe
  2 siblings, 0 replies; 10+ messages in thread
From: Arjan van de Ven @ 2001-02-24 19:18 UTC (permalink / raw)
  To: Mark Swanson; +Cc: linux-kernel

In article <20010224173234.14673.qmail@web1301.mail.yahoo.com> you wrote:
> First, good job on the loop device. It's rock stable for me - except
> when I try to load the blowfish module which oops the kernel and
> crashes the loop device:-) No problem, I just use another cipher.

> The bug I'm reporting is that when a loop device is in use the load of
> the machine stays at 1.00 even though nothing is happening. If I umount
> the loop filesystem the load goes down to 0.00.

>> ps -aux | grep loop
> 1674 tty1     DW<   0:00 [loop0]

This is probably easy to fix in the driver, right now it waits for
events in UNINTERRUPTIBLE state, while it should wait in INTERRUPTIBLE
state. The fix isn't as trivial as removing 2 letters though, I'll send Alan
a real patch on monday.

Greetings,
   Arjan van de Ven

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
  2001-02-24 17:32 242-ac3 loop bug Mark Swanson
  2001-02-24 17:59 ` Doug McNaught
  2001-02-24 19:18 ` Arjan van de Ven
@ 2001-02-24 23:14 ` Jens Axboe
  2001-02-25  7:48   ` Mircea Ciocan
  2 siblings, 1 reply; 10+ messages in thread
From: Jens Axboe @ 2001-02-24 23:14 UTC (permalink / raw)
  To: Mark Swanson; +Cc: linux-kernel, Alan Cox

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

On Sat, Feb 24 2001, Mark Swanson wrote:
> First, good job on the loop device. It's rock stable for me - except

thanks, glad to hear it.

> when I try to load the blowfish module which oops the kernel and
> crashes the loop device:-) No problem, I just use another cipher.

cipher bug or? never the less, could you ksymoops that and send
it along?

> The bug I'm reporting is that when a loop device is in use the load of
> the machine stays at 1.00 even though nothing is happening. If I umount
> the loop filesystem the load goes down to 0.00.
> 
> > ps -aux | grep loop
> 1674 tty1     DW<   0:00 [loop0]
> 
> The system is doing nothing to the loop filesystem.
> Strange that the process isn't logging any cpu usage time. It's
> definately responsible for the 1.00 load.

Oops, this slipped by me. Patch should fix it.

-- 
Jens Axboe


[-- Attachment #2: loop_sig-1 --]
[-- Type: text/plain, Size: 546 bytes --]

--- drivers/block/loop.c~	Sat Feb 24 23:08:38 2001
+++ drivers/block/loop.c	Sat Feb 24 23:11:13 2001
@@ -507,7 +507,7 @@
 	sprintf(current->comm, "loop%d", lo->lo_number);
 
 	spin_lock_irq(&current->sigmask_lock);
-	siginitsetinv(&current->blocked, sigmask(SIGKILL));
+	sigfillset(&current->blocked);
 	flush_signals(current);
 	spin_unlock_irq(&current->sigmask_lock);
 
@@ -525,7 +525,7 @@
 	up(&lo->lo_sem);
 
 	for (;;) {
-		down(&lo->lo_bh_mutex);
+		down_interruptible(&lo->lo_bh_mutex);
 		if (!atomic_read(&lo->lo_pending))
 			break;
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
  2001-02-24 23:14 ` Jens Axboe
@ 2001-02-25  7:48   ` Mircea Ciocan
  0 siblings, 0 replies; 10+ messages in thread
From: Mircea Ciocan @ 2001-02-25  7:48 UTC (permalink / raw)
  To: Jens Axboe; +Cc: lk

	Halleluiah ;)!!!

	Finally, it works as is suposed to do :)))), the load on my dual
PIIIx950 is 0.01 three times and I can mount and umonunt ISOs as much I
wish.
	Thank you very much Jens and all that provided usefull feedback, this
patch alone deserves including in an .acX release.
	And Jens if you ever come to Romania give me a call I owe you a lot of
beers and pizzas :).

		Mircea "happy, happy, joy, joy...;)" C.



Jens Axboe wrote:
> 
> On Sat, Feb 24 2001, Mark Swanson wrote:
> > First, good job on the loop device. It's rock stable for me - except
> 
> thanks, glad to hear it.
> 
> > when I try to load the blowfish module which oops the kernel and
> > crashes the loop device:-) No problem, I just use another cipher.
> 
> cipher bug or? never the less, could you ksymoops that and send
> it along?
> 
> > The bug I'm reporting is that when a loop device is in use the load of
> > the machine stays at 1.00 even though nothing is happening. If I umount
> > the loop filesystem the load goes down to 0.00.
> >
> > > ps -aux | grep loop
> > 1674 tty1     DW<   0:00 [loop0]
> >
> > The system is doing nothing to the loop filesystem.
> > Strange that the process isn't logging any cpu usage time. It's
> > definately responsible for the 1.00 load.
> 
> Oops, this slipped by me. Patch should fix it.
> 
> --
> Jens Axboe
> 
>   ------------------------------------------------------------------------
> --- drivers/block/loop.c~       Sat Feb 24 23:08:38 2001
> +++ drivers/block/loop.c        Sat Feb 24 23:11:13 2001
> @@ -507,7 +507,7 @@
>         sprintf(current->comm, "loop%d", lo->lo_number);
> 
>         spin_lock_irq(&current->sigmask_lock);
> -       siginitsetinv(&current->blocked, sigmask(SIGKILL));
> +       sigfillset(&current->blocked);
>         flush_signals(current);
>         spin_unlock_irq(&current->sigmask_lock);
> 
> @@ -525,7 +525,7 @@
>         up(&lo->lo_sem);
> 
>         for (;;) {
> -               down(&lo->lo_bh_mutex);
> +               down_interruptible(&lo->lo_bh_mutex);
>                 if (!atomic_read(&lo->lo_pending))
>                         break;
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
  2001-02-26  0:15 Jonathan Oppenheim
  2001-02-26  0:27 ` Jens Axboe
@ 2001-02-26  1:17 ` Mario Hermann
  1 sibling, 0 replies; 10+ messages in thread
From: Mario Hermann @ 2001-02-26  1:17 UTC (permalink / raw)
  To: Jonathan Oppenheim, linux-kernel

Hi!

Jonathan Oppenheim wrote:

> i have also been having trouble with many cyphers including
> blowfish (although twofish and idea worked).  the error seems to be the
> same in all 2.4.x kernels (i have all the relevant options compiled
> as modules eg. loopback and ciphers))

I had the same problem today with blowfish. Following mini-diff works for
blowfish(apply after patch-int-2.4.0.3):

--- crypto/cipher-blowfish.c~   Sun Feb 25 13:33:42 2001
+++ crypto/cipher-blowfish.c    Sun Feb 25 13:48:23 2001
@@ -404,6 +404,8 @@
     u32 *P = key2->P;
     u32 *S = key2->S;

+    if (keybytes<=0 || keybytes>32) return(-1);
+
     /* Copy the initialization s-boxes */

     for (i = 0, count = 0; i < 256; i++)






^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
  2001-02-26  0:15 Jonathan Oppenheim
@ 2001-02-26  0:27 ` Jens Axboe
  2001-02-26  1:17 ` Mario Hermann
  1 sibling, 0 replies; 10+ messages in thread
From: Jens Axboe @ 2001-02-26  0:27 UTC (permalink / raw)
  To: Jonathan Oppenheim; +Cc: linux-kernel

On Sun, Feb 25 2001, Jonathan Oppenheim wrote:
> i have also been having trouble with many cyphers including
> blowfish (although twofish and idea worked).  the error seems to be the
> same in all 2.4.x kernels (i have all the relevant options compiled
> as modules eg. loopback and ciphers))
> 
> i follow the encryptionhowto, but when i do a 
> losetup -e blah blah blah
> i get a segmentation fault (no core, no other error
> messages as far as i can see)
> 
> then, i can't rmmod the loop module and other modules because
> they are busy.
> 
> so i can't unmount the disk.
> 
> i haven't yet tried things with 2.4.2-ac3, but the problem
> seems to be with particular cyphers not with loopback.

So report the problem to the crypto folks people? I've seen several
of these now, but not one includes ksymoops info etc.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 242-ac3 loop bug
@ 2001-02-26  0:15 Jonathan Oppenheim
  2001-02-26  0:27 ` Jens Axboe
  2001-02-26  1:17 ` Mario Hermann
  0 siblings, 2 replies; 10+ messages in thread
From: Jonathan Oppenheim @ 2001-02-26  0:15 UTC (permalink / raw)
  To: linux-kernel

i have also been having trouble with many cyphers including
blowfish (although twofish and idea worked).  the error seems to be the
same in all 2.4.x kernels (i have all the relevant options compiled
as modules eg. loopback and ciphers))

i follow the encryptionhowto, but when i do a 
losetup -e blah blah blah
i get a segmentation fault (no core, no other error
messages as far as i can see)

then, i can't rmmod the loop module and other modules because
they are busy.

so i can't unmount the disk.

i haven't yet tried things with 2.4.2-ac3, but the problem
seems to be with particular cyphers not with loopback.

let me know what system specs you need (directly -as i'm not
on the kernel list)

(i have an amd athlon running on k7a asus motherboard if that helps).

cheers,
j

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzc5/rwAAAEEALGi/cKupURWMeRs3xKx7+3PHi1hqfswOuM5suJhTEJZiR+p
xYsVYB/B/uNwrr+m+Rzd8sEJlB2D/JkkCHMUplDR2OC0hfUYmQGIXEg9kShudRsO
E+1oVFFevj6MTgIY6c5nSWvz3n+zLHrcHk/k8pLDpI6qcIGqrAEcX2GVzVwNAAUR
tARqb25vtBU8am9ub0BwaHlzaWNzLnViYy5jYT4=
=fDxR
-----END PGP PUBLIC KEY BLOCK-----


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-02-26  1:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-24 17:32 242-ac3 loop bug Mark Swanson
2001-02-24 17:59 ` Doug McNaught
2001-02-24 18:11   ` Mark Swanson
2001-02-24 18:57     ` Doug McNaught
2001-02-24 19:18 ` Arjan van de Ven
2001-02-24 23:14 ` Jens Axboe
2001-02-25  7:48   ` Mircea Ciocan
2001-02-26  0:15 Jonathan Oppenheim
2001-02-26  0:27 ` Jens Axboe
2001-02-26  1:17 ` Mario Hermann

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).