Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 19 Feb 2002 21:12:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 19 Feb 2002 21:12:11 -0500 Received: from ns1.crl.go.jp ([133.243.3.1]:20210 "EHLO ns1.crl.go.jp") by vger.kernel.org with ESMTP id ; Tue, 19 Feb 2002 21:11:57 -0500 Date: Wed, 20 Feb 2002 11:10:45 +0900 (JST) From: Tom Holroyd X-X-Sender: tomh@holly.crl.go.jp To: Andreas Schwab cc: Tim Schmielau , kernel mailing list Subject: Re: Unknown HZ value! (1908) Assume 1024. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > |> jif * smp_num_cpus - (user + nice + system) > > Changing the line to this: > > jif * smp_num_cpus - user - nice - system > > should avoid the overflow. True. It still might be a good idea to make them longs, though, because they are really totals of all the CPUs, as in: user += kstat.per_cpu_user[cpu]; Now ultimately, kstat.per_cpu_user[cpu] will overflow, and I don't know what to do about that, but making user, nice, and system unsigned long will at least allow SMP systems to last a little while longer. (Actually I don't know why Procps needs these values at all -- the claim in the code is that all of this is just to compute the HZ value, which is presumably needed to be able to interpret jiffies. It'd be a lot simpler just to have /proc/stat export the HZ value directly.) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/