From owner-freebsd-current@FreeBSD.ORG Sat Jul 16 12:04:58 2011 Return-Path: Delivered-To: current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id D84C91065672; Sat, 16 Jul 2011 12:04:58 +0000 (UTC) Date: Sat, 16 Jul 2011 12:04:58 +0000 From: Alexander Best To: Pan Tsu Message-ID: <20110716120458.GA30855@freebsd.org> References: <201107151343.40065.jhb@freebsd.org> <20110716093445.GA15357@freebsd.org> <864o2mfpbv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <864o2mfpbv.fsf@gmail.com> Cc: current@freebsd.org Subject: Re: [PATCH] Export per-thread resource usage via sysctl X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2011 12:04:58 -0000 On Sat Jul 16 11, Pan Tsu wrote: > Alexander Best writes: > > > On Fri Jul 15 11, John Baldwin wrote: > >> This change exports each individual thread's resource usage via sysctl when > >> individual threads are requested via KERN_PROC_INC_THREAD. This generally > >> works correctly with 'top -m io' after the previous change to revert top(1) > >> back to using KERN_PROC_PROC when threads are not enabled. There is one issue > >> in that top doesn't necessarily DTRT when disabling/enabling threads via 'H' > >> at runtime while in io mode. I may do some further work to clean that up. > >> However, for just top run it will now show per-thread stats instead of > >> duplicating the per-process stats for each thread. > > > > i'm not sure, if i understand what the patch is supposed to do. however after > > applying it, and recompiling/reinstalling the kernel, 'top -mio' displays the > > same stats for each thread of a process. if i understood you correctly, each > > thread should have individual stats. > > > > i'm running r224068 on amd64 and just reinstalled 'top'. anything i am missing? > > FWIW, I see different numbers for a few threads of firefox-bin with top-3.8b1. > > http://img233.imageshack.us/img233/1570/81482202.png > > Which is an improvement compared to how all threads showed same numbers > before applying the patch. hmmm...not here. i did the following: 'top -mio -b -H -d2 999999' and had a look at the second output, where if found these lines: [...] 2015 1001 61 8 0 0 1 1 3.70% chromium-browser: (chrome) 2015 1001 61 8 0 0 1 1 3.70% chromium-browser: (chrome) 2015 1001 61 8 0 0 1 1 3.70% chromium-browser: (chrome) 2015 1001 61 8 0 0 1 1 3.70% chromium-browser: (chrome) 2015 1001 61 8 0 0 1 1 3.70% chromium-browser: (chrome) 2015 1001 61 8 0 0 1 1 3.70% chromium-browser: (chrome) 2015 1001 61 8 0 0 1 1 3.70% chromium-browser: (chrome) 2015 1001 61 8 0 0 1 1 3.70% chromium-browser: (chrome) [...] 2068 1001 383 137 0 0 0 0 0.00% /usr/local/jdk1.6.0/bin/java -Xmx512m -jar JDownloader.jar 2068 1001 383 137 0 0 0 0 0.00% /usr/local/jdk1.6.0/bin/java -Xmx512m -jar JDownloader.jar [...] the first output seems to behave similar: [...] 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon 1881 0 656 68 15 0 41 56 0.00% /usr/local/sbin/console-kit-daemon --no-daemon [...] cheers. alex