Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754068AbZKCPwM (ORCPT ); Tue, 3 Nov 2009 10:52:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751573AbZKCPwL (ORCPT ); Tue, 3 Nov 2009 10:52:11 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:59069 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751165AbZKCPwK (ORCPT ); Tue, 3 Nov 2009 10:52:10 -0500 Date: Tue, 3 Nov 2009 07:51:25 -0800 (PST) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Ian Campbell cc: Andrew Morton , Rusty Russell , linux-kernel Subject: Re: [PATCH] Correct nr_processes() when CPUs have been unplugged In-Reply-To: <1257243074.23110.779.camel@zakaz.uk.xensource.com> Message-ID: References: <1257243074.23110.779.camel@zakaz.uk.xensource.com> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1004 Lines: 27 On Tue, 3 Nov 2009, Ian Campbell wrote: > > Therefore calculating the sum of process_counts over only the online > CPUs omits the processes which were started or stopped on any CPU which > has since been unplugged. Only the sum of process_counts across all > possible CPUs has meaning. I think your patch is fine, but I also suspect that we could/should instead fix it by doing something like per_cpu(process_counts, this_cpu) += per_cpu(process_counts, down_cpu); per_cpu(process_counts, down_cpu) = 0; in the CPU off-lining case after having quieted 'down_cpu'. That way we could always use online CPU's rather than possible CPU's. I think that just sounds nicer. So I'll apply the patch, but I get the feeling it could be done better. Linus -- 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/