From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753639Ab1LPKGq (ORCPT ); Fri, 16 Dec 2011 05:06:46 -0500 Received: from mx2.parallels.com ([64.131.90.16]:53476 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143Ab1LPKGj convert rfc822-to-8bit (ORCPT ); Fri, 16 Dec 2011 05:06:39 -0500 Message-ID: <4EEB1807.1000308@parallels.com> Date: Fri, 16 Dec 2011 14:05:59 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: Eric Dumazet CC: , , , , , Stephen Rothwell , Randy Dunlap Subject: Re: [PATCH v2] net: fix sleeping while atomic problem in sock mem_cgroup. References: <1324026582-5214-1-git-send-email-glommer@parallels.com> <1324027869.2273.3.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <4EEB1508.3080405@parallels.com> <1324029886.2273.9.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> In-Reply-To: <1324029886.2273.9.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8BIT X-Originating-IP: [85.26.155.19] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/16/2011 02:04 PM, Eric Dumazet wrote: > Le vendredi 16 décembre 2011 à 13:53 +0400, Glauber Costa a écrit : >> On 12/16/2011 01:31 PM, Eric Dumazet wrote: >>> Le vendredi 16 décembre 2011 à 13:09 +0400, Glauber Costa a écrit : >>>> Since we can't scan the proto_list to initialize sock cgroups, as it >>>> holds a rwlock, and we also want to keep the code generic enough to >>>> avoid calling the initialization functions of protocols directly, >>>> I propose we keep the interested parties in a separate list. This list >>>> is protected by a mutex so we can sleep and do the necessary allocations. >>>> >>>> Also fixes a reference problem found by Randy Dunlap's randconfig. >>>> >>>> Signed-off-by: Glauber Costa >>>> CC: Hiroyouki Kamezawa >>>> CC: David S. Miller >>>> CC: Eric Dumazet >>>> CC: Stephen Rothwell >>>> CC: Randy Dunlap >>>> --- >>> >>> Sorry to come late, but why dont we convert proto_list_lock to a mutex ? >> >> I didn't suggest this, as I imagined there could be some performance >> implications to be drawn from it that may not be obvious to me. >> >> But if it is okay with you net guys, it is certainly okay with me as well. > > This 'lock' is not performance sensitive, its very seldom taken. > > If we really wanted to be fast, it would not be a rwlock anymore ;) > > "cat /proc/net/protocols" could eventually use RCU locking if we want > parallelism. (I dont think its needed) > Well, in this case, I myself think this is a better solution. Do you want to push the patch yourself, or should I do it ?