From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 20:29:04 2009 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 BAFFB106568D for ; Tue, 20 Oct 2009 20:29:04 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by mx1.freebsd.org (Postfix) with ESMTP id 1FDB78FC0C for ; Tue, 20 Oct 2009 20:29:03 +0000 (UTC) Received: by ewy5 with SMTP id 5so2548391ewy.36 for ; Tue, 20 Oct 2009 13:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type; bh=t5b2o84XMMARxASgDXPiuwUhcm32GWhAm+Qm9QN3xpQ=; b=qLn9Cefo5ihMB1agbNG9boQ46i2ja0CgQbsegug8eLcz+OKBWAarR2+6MvM+nS/0+W MQpeW8ya+yXxnTb9K+smt3/B9P4U1z35wIuKiOauukIru59Etv82WJO772XrfYtaGgqY zo8Y0i1W3yZFSLTSVjwGMgFS2+yqMZdlPzIW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=LBoPhlz0ENsVo7whkXTSX7j5bPwtTDXp/gZs5H6vtbU1apL1A+xhPrYBcmrIQfAXo0 0JIrMfoHKAP2q9JnGJgg0Qtc/5arGKMmJ87GJGOhXgDPLHXbrlScW3T0LCyu3LzZjp0S Dml+Ods+YD4geGW08OFAQuKbIXnT0i2N1XNZk= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.86.137 with SMTP id w9mr2438269wee.104.1256070542946; Tue, 20 Oct 2009 13:29:02 -0700 (PDT) In-Reply-To: <20091020171354.GA92192@freebsd.org> References: <20091020122432.GA50817@ravenloft.kiev.ua> <20091020171354.GA92192@freebsd.org> From: Ivan Voras Date: Tue, 20 Oct 2009 22:27:36 +0200 X-Google-Sender-Auth: c1b6e9855ef68ced Message-ID: <9bbcef730910201327h3bbcc526ja7a8283addfe2667@mail.gmail.com> To: Roman Divacky Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete 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: Tue, 20 Oct 2009 20:29:04 -0000 2009/10/20 Roman Divacky : > On Tue, Oct 20, 2009 at 02:42:17PM +0200, Ivan Voras wrote: >> Alex Kozlov wrote: >> >> >Of course ps or top output much more convenient, but if setproctitle so >> >expencive and will be called so often, then SIGINFO may be good >> >compromise. >> >> Regarding speed of setproctitle(), here are some microbenchmark results >> from the attached test source: >> >> getpid: 3661124.75 iterations/s >> setproctitle: 591357.56 iterations/s >> >> Meaning, setprocitle() is around 6 times more expensive than getpid(), >> meaning it can only be pulled off nearly 600,000 calls/s on a 2.3 GHz >> Core 2 CPU. > > what about contention? setproctitle() is an sysctl so it will prevent > other sysctl's from working when being executed.. Others sysctls... for that particular process (since it modifies process-global data) which happens to be single-threaded :P