Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751438AbWA0IyN (ORCPT ); Fri, 27 Jan 2006 03:54:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751436AbWA0IyN (ORCPT ); Fri, 27 Jan 2006 03:54:13 -0500 Received: from gw1.cosmosbay.com ([62.23.185.226]:1756 "EHLO gw1.cosmosbay.com") by vger.kernel.org with ESMTP id S1750752AbWA0IyM (ORCPT ); Fri, 27 Jan 2006 03:54:12 -0500 Message-ID: <43D9DFA1.9070802@cosmosbay.com> Date: Fri, 27 Jan 2006 09:53:53 +0100 From: Eric Dumazet User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Ravikiran G Thirumalai CC: Andrew Morton , davem@davemloft.net, linux-kernel@vger.kernel.org, shai@scalex86.org, netdev@vger.kernel.org, pravins@calsoftinc.com Subject: Re: [patch 3/4] net: Percpufy frequently used variables -- proto.sockets_allocated References: <20060126185649.GB3651@localhost.localdomain> <20060126190357.GE3651@localhost.localdomain> In-Reply-To: <20060126190357.GE3651@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (gw1.cosmosbay.com [172.16.8.80]); Fri, 27 Jan 2006 09:53:54 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1110 Lines: 33 Ravikiran G Thirumalai a ?crit : > Change the atomic_t sockets_allocated member of struct proto to a > per-cpu counter. > > Signed-off-by: Pravin B. Shelar > Signed-off-by: Ravikiran Thirumalai > Signed-off-by: Shai Fultheim > Hi Ravikiran If I correctly read this patch, I think there is a scalability problem. On a big SMP machine, read_sockets_allocated() is going to be a real killer. Say we have 128 Opterons CPUS in a box. You'll need to bring 128 cache lines (plus 8*128 bytes to read the 128 pointers inside percpu structure) I think a solution 'a la percpu_counter' is preferable, or even better a dedicated per_cpu with a threshold management (see mm/swap.c , function vm_acct_memory() to see how vm_committed_space is updated without too bad SMP scalability) Thank you Eric - 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/