Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 18880 - 'df -k' consumes 95%+ CPU
Summary: 'df -k' consumes 95%+ CPU
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Brandon Low (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-06 20:56 UTC by David Figueroa
Modified: 2017-10-17 19:04 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Figueroa 2003-04-06 20:56:30 UTC
My system is a dual-proc athlon.  Running 'df -k' causes the CPU utilization to
spike to 95%+.  Measured the CPU utilization by running 'top' at the cli, and
using gkrellm in the GUI.

The df process is unkillable.

Reproducible: Always
Steps to Reproduce:
1.run 'df -k'
2.
3.

Actual Results:  
CPU Utilization climbs to 95%+.  Gkrellm shows both procs at 95%+.

Expected Results:  
Displayed the appropriate disk usage.

dfigueroa@dpc-gt dfigueroa $ emerge info
Portage 2.0.47-r10 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4)
=================================================================
System uname: 2.4.20-gentoo-r2 i686 AMD Athlon(tm) MP Processor 1800+
GENTOO_MIRRORS="http://mirrors.twobit.net/gentoo/ http://gentoo.oregonstate.edu/"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config
/usr/X11R6/lib/X11/xkb:/usr/kde/3.1/share/config:/usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="oss libg++ mikmod mmx pdflib xv gdbm berkdb slang readline guile sdl esd
oggvorbis motif opengl 3dnow aalib alsa apache2 apm arts avi bonobo cdr crypt
cups dga dvd encode ethereal evo gb gbdm gif gnome gphoto2 gpm gtk gtkhtml imap
imlib java jpeg kde libwww mozilla mpeg ncurses nls oav pam perl plotutils png
python qt quicktime samba spell ssl svga tcltk tcpd tiff truetype usb wmf X xml
xml2 xmms sv zlib x86"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O3 -march=athlon-mp"
CXXFLAGS="-O3 -march=athlon-mp"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j3"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"
Comment 1 David Figueroa 2003-04-06 21:04:30 UTC
I forgot to mention that df hangs when reaching my /dev/hda7 partition.

Disk layout:

/dev/hda1, ntfs, 8GB, c:\, WinXP
/dev/hda2, ntfs, 10GB, d:\, WinXP
/dev/hda3, Ext3, 100MB, /boot, Gentoo 1.4_rc3
/dev/hda4, Extended, --, --, Gentoo 1.4_rc3 (gentoo created, not WinXP created)
/dev/hda5, swap (in Extended), 1GB, swap, Gentoo 1.4_rc3
/dev/hda6, ReiserFS, 8GB, /, Gentoo 1.4_rc3
/dev/hda7, ReiserFS, 10GB, /home, Gentoo 1.4_rc3

The system has to be rebooted to stop CPU utilization.

Example Output:
dpc-gt bin # df_bad
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda6             11114840   2925912   8188928  27% /
tmpfs                     2048       188      1860  10% /mnt/.init.d
/dev/hda7              8000212    203916   7796296   3% /home

System hangs at this point, and the df command cannot be Ctrl-C'd, process is unkillable even with kill -9.

Comment 2 Seemant Kulleen (RETIRED) gentoo-dev 2003-04-08 14:45:27 UTC
do me a favour and emerge coreutils, then try the df -k command.
Comment 3 David Figueroa 2003-04-08 18:18:44 UTC
It's masked off.  I tried to do an export KEYWORDS="~x86", but it is still masked.  What do I need to do to get it emerged?  

Thanks!

David Figueroa
Comment 4 Seemant Kulleen (RETIRED) gentoo-dev 2003-04-08 18:43:58 UTC
cd /usr/portage/sys-apps/coreutils
emerge coreutils-5.0.ebuild
Comment 5 David Figueroa 2003-04-09 00:22:32 UTC
Well, I have mixed news about this.  The 5.0 core-utils did not help in any way.

However, on a hunch, I tried the df -t xxxx  for the different types, ext3, tmpfs, etc. like I had before with reiserfs. (I converted the reiserfs partitions to ext3 in an attempt to workaround this.)  

It turns out that the ntfs is linked to the cause.  A df -t ntfs causes the system to hang.  The other fs types did not.  I rebooted, and tested it in each scenario with the ntfs & smbfs unmounted (I have to smbfs shares mounted with a credentials file on my system).  If the ntfs partitions are mounted, then the problem occurs.  If they are not mounted, it does not occur.

Here's a copy of the fstab (the ntfs partititions are commented out for obvious reasons:
# /etc/fstab: static file system information.
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.10 2002/11/18 19:39:22 azarah Exp $
#
# noatime turns of atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs>          	<mountpoint>    <type>  	<opts>      		<dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda3		/boot		ext3		noauto,noatime		1 1
/dev/hda6		/		ext3		noatime			0 0
/dev/hda7		/home		ext3		noatime
/dev/hda5		none		swap		sw			0 0
/dev/cdroms/cdrom0	/mnt/cdrom	iso9660		noauto,ro		0 0
/dev/cdroms/cdrom1	/mnt/cdrom1	iso9660		noauto,ro	0 0
proc			/proc		proc		defaults		0 0
#/dev/hda1		/mnt/C		ntfs		ro,umask=000	0 0
#/dev/hda2		/mnt/D		ntfs		ro,umask=000	0 0

# Network Mounts
//win2ksrv/public	/mnt/public	smbfs		credentials=/etc/win2ksrv.credentials,rw,umask=000	0 0
//win2ksrv/mp3		/mnt/mp3	smbfs		credentials=/etc/win2ksrv.credentials,rw,umask=000	0 0


# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink). Adding the following
# line to /etc/fstab should take care of this:
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will use almost no
#  memory if not populated with files)

tmpfs			/dev/shm	tmpfs		defaults		0 0

/dev/scsi/host0/bus0/target0/lun0/cd	/mnt/cdrom	auto	ro,noauto,user,exec	0 0
/dev/scsi/host0/bus0/target1/lun0/cd	/mnt/cdrom1	auto	ro,noauto,user,exec	0 0

Thanks once again.

David Figueroa
Comment 6 David Figueroa 2003-04-18 22:52:05 UTC
Just wanted to see if there was something else I should do?  Ultimately, I'd like to have the NTFS partitions mounted all the time without this problem.

Has anyone else experienced this?

Thanks, 

David Figueroa
Comment 7 Seemant Kulleen (RETIRED) gentoo-dev 2003-04-23 19:08:22 UTC
I'll report this to the fileutils people.
Comment 8 Andrew Cooks (RETIRED) gentoo-dev 2003-11-19 10:04:33 UTC
This has been a "critical" bug for almost 7 months. Feedback please?
Comment 9 Andrew Cooks (RETIRED) gentoo-dev 2004-02-07 04:35:42 UTC
We're currently standing at coreutils-5.0.91-r4 for x86 and this bug hasn't received any food in the last 10 months or so.

I'm closing this as TEST-REQUEST.
Comment 10 Markus Meier gentoo-dev 2017-10-17 19:04:42 UTC
arm stable, all arches done.