Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Sep 2011 01:49:15 +0200
From:      "Ronald Klop" <ronald-freebsd8@klop.yi.org>
To:        "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>
Subject:   /usr/bin/script eating 100% cpu with portupgrade and xargs
Message-ID:  <op.v1y8gdtf8527sy@pinky>

next in thread | raw e-mail | index | archive | help
Hi,

I'm running portupgrade in screen to update all the ports for  
9-BETA2/9-CURRENT on amd64. While doing this script eats 100% cpu.
Because portupgrade -fa crashed I'm running this command to update the  
remaining non-updates ports.
find /var/db/pkg -name +DESC -mtime +2 |cut -d / -f 5 | xargs time nice -n  
20 portupgrade -f

The output of truss -p `pgrep script` is this:
clock_gettime(13,{1316301104.000000000 })        = 0 (0x0)
select(5,{0 4},0x0,0x0,{30.000000 })             = 1 (0x1)
read(0,0x7fffffffcdf0,1024)                      = 0 (0x0)
write(4,0x7fffffffcdf0,0)                        = 0 (0x0)
clock_gettime(13,{1316301104.000000000 })        = 0 (0x0)
select(5,{0 4},0x0,0x0,{30.000000 })             = 1 (0x1)
read(0,0x7fffffffcdf0,1024)                      = 0 (0x0)
write(4,0x7fffffffcdf0,0)                        = 0 (0x0)
clock_gettime(13,{1316301104.000000000 })        = 0 (0x0)
select(5,{0 4},0x0,0x0,{30.000000 })             = 1 (0x1)
read(0,0x7fffffffcdf0,1024)                      = 0 (0x0)
write(4,0x7fffffffcdf0,0)                        = 0 (0x0)
clock_gettime(13,{1316301104.000000000 })        = 0 (0x0)
select(5,{0 4},0x0,0x0,{30.000000 })             = 1 (0x1)
read(0,0x7fffffffcdf0,1024)                      = 0 (0x0)
write(4,0x7fffffffcdf0,0)                        = 0 (0x0)

So it is really fast in reading and writing 0 bytes most of the time.

I also found http://web.archiveorange.com/archive/v/6ETvLvjo60Gj9geAUAb6  
and I think I am better of by rewriting my command so stdin/stdout is  
still the terminal. Although the link is a couple of years old.

Is this known? Can somebody explain me why my xargs command is not working  
well?

Ronald.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.v1y8gdtf8527sy>