From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 0/3] netfilter : 3 patches to boost ip_tables performance Date: Thu, 22 Sep 2005 13:49:41 +0100 Message-ID: <20050922124941.GA26936@infradead.org> References: <43308324.70403@cosmosbay.com> <4331CFA7.50104@cosmosbay.com> <20050921.173408.122945960.davem@davemloft.net> <43329F6E.3030706@cosmosbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Lameter , "David S. Miller" , linux-kernel@vger.kernel.org, netfilter-devel@lists.netfilter.org, netdev@vger.kernel.org, ak@suse.de Return-path: To: Eric Dumazet Content-Disposition: inline In-Reply-To: <43329F6E.3030706@cosmosbay.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Thu, Sep 22, 2005 at 02:11:26PM +0200, Eric Dumazet wrote: > +#ifdef CONFIG_NUMA > +/** > + * vmalloc_node - allocate virtually contiguous memory > + * > + * @size: allocation size > + * @node: preferred node > + * > + * This vmalloc variant try to allocate memory from a preferred node. > + */ > +void *vmalloc_node(unsigned long size, int node) > +{ > + void *result; > + struct mempolicy *oldpol = current->mempolicy; > + mm_segment_t oldfs = get_fs(); > + DECLARE_BITMAP(prefnode, MAX_NUMNODES); > + > + mpol_get(oldpol); > + bitmap_zero(prefnode, MAX_NUMNODES); > + set_bit(node, prefnode); > + > + set_fs(KERNEL_DS); > + sys_set_mempolicy(MPOL_PREFERRED, prefnode, MAX_NUMNODES); > + set_fs(oldfs); > + > + result = vmalloc(size); > + > + mpol_free(current->mempolicy); > + current->mempolicy = oldpol; > + return result; > +} No way, sorry. If you want a vmalloc node do it right.