From owner-freebsd-current@FreeBSD.ORG Tue May 27 14:43:58 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B13F546; Tue, 27 May 2014 14:43:58 +0000 (UTC) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19A53215C; Tue, 27 May 2014 14:43:58 +0000 (UTC) Received: by mail-qg0-f42.google.com with SMTP id q107so14113442qgd.15 for ; Tue, 27 May 2014 07:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=1T1GKcQX1WFhphp8UQd/mnoqOQ/jsHjElpgV+6VbfHc=; b=ZZatOsATHr9WpLDiqTeutdyCKif9W7mZiPV6MSQEV1cbaIwm+V1nYQfk38lWhMy/o5 1ScJRZfAC5J0KmwMf9rsrBGn0z4H3V5YHyQEqXW7fO3FJwEiEL3CsGk/jTectYzvZ6ha 02ql08v93gOAxxLImIrK4/rbiAwmk5pPAxyTacOTTdXYyiQ6E4hOddCIDTjTS2MMdi82 dwF4d/hgIjyq6dVewO6o7tVyuohxrPAJx3aRaHyS52O23BaXQok4nXnkc3czSi35HQss FJbOZMGHYbI70oDqC8EXdorVnJZUJ6h2k2gwx0yaDpBlqSLGLMS/qLT8bhpq9aFBuSdK qEYQ== MIME-Version: 1.0 X-Received: by 10.140.26.179 with SMTP id 48mr41574958qgv.51.1401201837074; Tue, 27 May 2014 07:43:57 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.140.49.239 with HTTP; Tue, 27 May 2014 07:43:56 -0700 (PDT) In-Reply-To: References: <201405231605.26312.jhb@freebsd.org> <537FBC1F.6030408@freebsd.org> <53819789.8030304@FreeBSD.org> Date: Tue, 27 May 2014 10:43:56 -0400 X-Google-Sender-Auth: AOJU50g1VAZakOAln1Ei9HAxz-0 Message-ID: Subject: Re: Change top's notion of idle processes / threads From: Ed Maste To: FreeBSD Current , John Baldwin Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 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: Tue, 27 May 2014 14:43:58 -0000 On 26 May 2014 11:51, Ed Maste wrote: > > The change in the patch is good, the new behaviour is much more > usable. Note that we don't currently define "idle" in top(8); for > this change maybe we should just state that non-idle processes may > report 0% CPU due to rounding. That said, I've discovered an issue with the change after using it a bit more, when using -I on the command line. (Previously I only tried it by pressing I in interactive mode.) With the change top -I lists all processes at first (which is a little annoying), but it renders -I ineffective when used with -b (batch mode). What do you think about this additional change, so that we use the previous 0% idleness test for the first iteration of the list: if (oldp == NULL) - return (pp->ki_runtime != 0); + return (pp->ki_pctcpu != 0); -Ed