From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263679AbUANGkq (ORCPT ); Wed, 14 Jan 2004 01:40:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263895AbUANGkq (ORCPT ); Wed, 14 Jan 2004 01:40:46 -0500 Received: from brain.sedal.usyd.edu.au ([129.78.24.68]:38801 "EHLO brain.sedal.usyd.edu.au") by vger.kernel.org with ESMTP id S263679AbUANGkm (ORCPT ); Wed, 14 Jan 2004 01:40:42 -0500 Message-ID: <40057E9E.1000705@sedal.usyd.edu.au> Date: Thu, 15 Jan 2004 04:38:38 +1100 From: sena User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830 X-Accept-Language: en-us, en MIME-Version: 1.0 To: linux-kernel , Rusty Russell , Linus Torvalds , Nuno Silva , Robin Holt Subject: The Difference in Load Average calculations in linux 2.4.19 and 2.6 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi, Please can anyone who has written/define Load Average confirm the following statement. "If there is only 1 CPU in the box, then the Load Average Calculations are going to be almost same in 2.6 and 2.4" In 2.6 Linux kernel static unsigned long count_active_tasks (void) { return (nr_running () + nr_uninterruptible ()) * FIXED_1 ; } In 2.4 linux kernel static unsigned long count_active_tasks (void) { struct task_struct *p ; unsigned long nr = 0; read_lock (&tasklist_lock ); for_each_task (p ) { if ((p ->state == TASK_RUNNING || (p ->state & TASK_UNINTERRUPTIBLE ))) nr += FIXED_1 ; } read_unlock (&tasklist_lock ); return nr ; } Thanks Sena Seneviratne Computer Engineering Lab Sydney University