From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changli Gao Subject: Re: [PATCH 3/3] nfnetlink_queue: use hash table to speed up entry finding. Date: Thu, 15 Apr 2010 22:35:25 +0800 Message-ID: References: <4BBEA97A.5020303@gmail.com> <4BC442E5.8020001@trash.net> <1271162669.16881.301.camel@edumazet-laptop> <1271164991.16881.346.camel@edumazet-laptop> <4BC470B3.4030007@trash.net> <4BC6EC15.4070205@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Eric Dumazet , netfilter-devel@vger.kernel.org To: Patrick McHardy Return-path: Received: from mail-pv0-f174.google.com ([74.125.83.174]:58918 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749Ab0DOOfq convert rfc822-to-8bit (ORCPT ); Thu, 15 Apr 2010 10:35:46 -0400 Received: by pva18 with SMTP id 18so840506pva.19 for ; Thu, 15 Apr 2010 07:35:45 -0700 (PDT) In-Reply-To: <4BC6EC15.4070205@trash.net> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Thu, Apr 15, 2010 at 6:36 PM, Patrick McHardy wrot= e: > Changli Gao wrote: >> On Tue, Apr 13, 2010 at 9:25 PM, Patrick McHardy w= rote: >>>> Yes, that is why vmalloc() is perfect for this case. No extra memo= ry for >>>> management, but one pointer for each page of memory. >>> I agree, if it works for conntrack, it certainly also works for >>> nfnetlink_queue. >>> >> >> I need to allocate memory in atomic section, so vmalloc() can't be u= sed. :( > > Why? > instance_create() is called in rcu read-side critical section, and the whole body of this function is protected by the spinlock instances_lock. All these make memory allocation for queue instances should be atomic. --=20 Regards=EF=BC=8C Changli Gao(xiaosuo@gmail.com) -- To unsubscribe from this list: send the line "unsubscribe netfilter-dev= el" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html