From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 15 22:48:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9769E1065676 for ; Wed, 15 Jun 2011 22:48:39 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 51C9A8FC26 for ; Wed, 15 Jun 2011 22:48:38 +0000 (UTC) Received: by gyg13 with SMTP id 13so131195gyg.13 for ; Wed, 15 Jun 2011 15:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=0g4aZaLchzU5ZydUB9kMksGm1jVOt3UubKcFLK3n8dA=; b=BMvwTedzuYqHvZfS7wf+p+jZmjWF6Ri2zrS1KbUq9YtjWx41mdhq1EXrSV0+qSYUFk yVLJRg8tnKpTLBfGzNkul8U7Fa/Gpg4CSaWlUE8oj5z/BLBFygNnY4vmra373OIXDnif 3tYwpWTeWgH8brIB30dhYivBLoLbyQHwnKjj0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=UTh8MDJBts5EQLtMy74b9wECojkDUCuGlkUwPUn9U3xjB1jT3kfsrWbeoPY0psaLaK +nQoLx3m0Cn1lyo/++5AEGDEtwgNV2le9wuQC4GIe7BOXCff3OfmttuU+K3x+/VJpQWL krJi6KceY2z2B04lnwCKBXngORqkT278yufSw= MIME-Version: 1.0 Received: by 10.236.186.65 with SMTP id v41mr136580yhm.1.1308178118304; Wed, 15 Jun 2011 15:48:38 -0700 (PDT) Sender: artemb@gmail.com Received: by 10.236.61.73 with HTTP; Wed, 15 Jun 2011 15:48:38 -0700 (PDT) In-Reply-To: <20110615215515.GA6889@dan.emsphone.com> References: <4DF91458.8010508@rawbw.com> <20110615215515.GA6889@dan.emsphone.com> Date: Wed, 15 Jun 2011 15:48:38 -0700 X-Google-Sender-Auth: 9a27QiNIrHqnPw7WXVUOeJV-k2o Message-ID: From: Artem Belevich To: Dan Nelson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Yuri , freebsd-hackers@freebsd.org Subject: Re: Why user time of the process depends on machine load? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 22:48:39 -0000 Hi, On Wed, Jun 15, 2011 at 2:55 PM, Dan Nelson wrote= : > In the last episode (Jun 15), Yuri said: >> When I test performance of the code, I always observe dependency of CPU >> user time on the presence of other CPU intense processes. =A0Same CPU-on= ly >> deterministic process that on the quiet machine completes in 220 user >> seconds in the presence of, for example, kde rebuild would complete in >> 261, 266 or even 379 user seconds. =A0I am talking about times shown by >> time(1), not actual an execution time. =A0It's the same time as getrusag= e(2) >> returns in ru_utime field. >> >> Why time that process takes in user seconds depends on what other >> processes are running? >> >> FreeBSD-8.2 STABLE on i7 CPU @ 9200 @ 2.67GHz. > > Some possible factors: > > o Intel Turbo Boost, which raises the clock rate of a single core if the > =A0other cores are idle. =A0A single process on an idle system will run f= aster. > > o i7 chips have a shared L3 cache across all cores, so a single process o= n > =A0an idle system will tend to have more of its data in cache compared to= a > =A0system with multiple processes, so it spends less time waiting for slo= wer > =A0physical memory lookups. > > o Process accounting isn't exact. =A0I may be wrong, but I don't think > =A0timestamps are taken every time a syscall is invoked and returns. =A0S= ome > =A0time marked as "user" may actually be "system" time, in which case you= may > =A0be seeing the effect of contention in the kernel as more processes are > =A0run. I would add hyper-threading to the list. Once you don't have enough real cores available to do the job, things do tend to slow down, unless your process is heavily i/o bound. The time process spends on a hyper-thread when it's not active still counts towards total time consumed by the process. --Artem > > You may be able to disable Turbo Boot in your BIOS, which you can use to > determine how much of the single-process speedup is due to that. > > Unrelated but still interesting note on your particular CPU: > http://www.passmark.com/forum/showthread.php?t=3D2256 > > -- > =A0 =A0 =A0 =A0Dan Nelson > =A0 =A0 =A0 =A0dnelson@allantgroup.com > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >