Very high CPU usage running growisofs

Steve O'Hara-Smith steve at sohara.org
Mon Sep 18 08:41:41 PDT 2006


On Sat, 8 Jul 2006 13:34:56 +0100
"Steve O'Hara-Smith" <steve at xxxxxxxxxx> wrote:

> 	Hi,
> 
> 	On 1.5.4-Preview using an up to date pkgsrc the growisofs program
> is eating CPU (it's CPU bound on an AMD64 and burning very slowly ~
> 1.5MB/s instead of ~10MB/s which is usual for the media I have to hand).
> Pointing truss at the running process reveals over 10k calls per second to
> sys_set_tls_area - all identical viz:
> 
> sys_set_tls_area(0x0,0x28262f98,0x8)             = 123 (0x7b)

	I finally got fed up enough with this to try things I don't really
understand. I found that adding a usleep(10000); before the only call to
__thread_yield() - which just calls sched_yield() restored the performance
of growisofs to normal (and yes the DVDs burnt with it still work fine). In
more detail I turned this loop:

        while (!reader_exit && (off == highest_ecc_block))
            __thread_yield();

into this loop:

        while (!reader_exit && (off == highest_ecc_block))
        {
            usleep (10000);
            __thread_yield();
        }

	Can anyone comment on the sanity or otherwise of this change ?
Presumably this form of loop - similar to those mentioned in the
"Threadding issue" thread in July - does not cause similar problems in
FreeBSD or Linux does anyone understand what the difference is in DragonFly
that causes it to cause problems here.

-- 
C:>WIN                                      |   Directable Mirror Arrays
The computer obeys and wins.                | A better way to focus the sun
You lose and Bill collects.                 |    licences available see
                                            |    http://www.sohara.org/





More information about the Bugs mailing list