Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755896Ab0BBLf3 (ORCPT ); Tue, 2 Feb 2010 06:35:29 -0500 Received: from dallas.jonmasters.org ([72.29.103.172]:49517 "EHLO dallas.jonmasters.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752029Ab0BBLfX convert rfc822-to-8bit (ORCPT ); Tue, 2 Feb 2010 06:35:23 -0500 Subject: Re: [PATCH] netfilter: per netns nf_conntrack_cachep From: Jon Masters To: Eric Dumazet Cc: Alexey Dobriyan , Patrick McHardy , linux-kernel , netdev , netfilter-devel , "Paul E. McKenney" In-Reply-To: <1265108690.2861.118.camel@tonnant> References: <1264813832.2793.446.camel@tonnant> <1264816634.2793.505.camel@tonnant> <1264816777.2793.510.camel@tonnant> <1264834704.2919.3.camel@edumazet-laptop> <1265016745.7499.144.camel@tonnant> <1265019160.2848.14.camel@edumazet-laptop> <1265023437.2848.30.camel@edumazet-laptop> <1265035970.2848.50.camel@edumazet-laptop> <1265036548.2848.55.camel@edumazet-laptop> <1265108690.2861.118.camel@tonnant> Content-Type: text/plain; charset="UTF-8" Organization: World Organi[sz]ation of Broken Dreams Date: Tue, 02 Feb 2010 06:35:04 -0500 Message-Id: <1265110504.2861.135.camel@tonnant> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 8BIT X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: jonathan@jonmasters.org X-SA-Exim-Scanned: No (on dallas.jonmasters.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6907 Lines: 135 On Tue, 2010-02-02 at 06:04 -0500, Jon Masters wrote: > On Mon, 2010-02-01 at 16:02 +0100, Eric Dumazet wrote: > > Le lundi 01 février 2010 à 16:58 +0200, Alexey Dobriyan a écrit : > > > On Mon, Feb 1, 2010 at 4:52 PM, Eric Dumazet wrote: > > > > + net->ct.nf_conntrack_cachep = kmem_cache_create("nf_conntrack", > > > > + sizeof(struct nf_conn), 0, > > > > + SLAB_DESTROY_BY_RCU, NULL); > > > > > > Duplicate slab name detected. > > > > > > > OK, need to build an unique name I guess... "nf_conntrack-%d", net->id > > I shoved in an kasprintf but of course there isn't a per-namespace "id". > We probably should have one (or, a nice "name"), but meanwhile I am > using the address of the net struct like "nf_ct-%p". -ENOBANANA Applying just this patch (without the per-ns hashtable metadata, but with a trivial fix to name using nf_ct-%p for now), we still fall over in the conntrack lookup code every single time: [ 210.697337] device vnet2 entered promiscuous mode [ 210.703868] br0: port 4(vnet2) entering forwarding state [ 220.766146] vnet2: no IPv6 routers present [ 236.216957] BUG: unable to handle kernel paging request at ffff88037e613588 [ 236.217638] IP: [] __nf_conntrack_find+0x53/0xb1 [ 236.217638] PGD 1a3c063 PUD 0 [ 236.217638] Oops: 0000 [#1] SMP [ 236.217638] last sysfs file: /sys/devices/virtual/block/md0/md/sync_speed Entering kdb (current=0xffff8801f32e8000, pid 3214) on processor 1 Oops: (null) due to oops @ 0xffffffff813d47cc CPU 1 Pid: 3214, comm: qemu-kvm Not tainted 2.6.33-rc5 #25 0F9382/Precision WorkStation 490 RIP: 0010:[] [] __nf_conntrack_find+0x53/0xb1 RSP: 0018:ffff8801d41a3758 EFLAGS: 00010286 RAX: ffff88037e613588 RBX: ffff8801d41a3868 RCX: 000000004d1bab3a RDX: ffff8801f32e8000 RSI: 0000000081b04540 RDI: 0000000000000246 RBP: ffff8801d41a3798 R08: 0000000045f1b45f R09: 000000005e5ffada R10: 00000000501b6d3f R11: ffff8801d41a388c R12: ffffffff8288ef70 R13: ffff8801d41a3868 R14: ffffffffffffffb8 R15: 000000002bfc66b1 FS: 00007f0059b01780(0000) GS:ffff88002fa00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: ffff88037e613588 CR3: 00000001f05ed000 CR4: 00000000000026e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process qemu-kvm (pid: 3214, threadinfo ffff8801d41a2000, task ffff8801f32e8000) <0>Stack: ffff8802206302e0 000000015fe33588 ffffffffffffffb8 ffffffff8288ef70 <0> ffff8802206302e0 ffff8801d41a3868 ffffffffffffffb8 ffffffff8288ef70 <0> ffff8801d41a37e8 ffffffff813d485d ffff8802206302e0 ffff8802206302e0 <0>Call Trace: [1]more> <0> [] nf_conntrack_find_get+0x33/0xb7 [1]more> <0> [] nf_conntrack_in+0x209/0x7b4 [1]more> <0> [] ipv4_conntrack_local+0x40/0x49 [1]more> <0> [] nf_iterate+0x46/0x89 [1]more> <0> [] ? dst_output+0x0/0x12 [1]more> <0> [] nf_hook_slow+0x78/0xe0 [1]more> <0> [] ? dst_output+0x0/0x12 [1]more> <0> [] nf_hook_thresh.clone.0+0x41/0x4a [1]more> <0> [] ? poll_freewait+0x32/0x70 [1]more> <0> [] __ip_local_out+0x7e/0x80 [1]more> <0> [] ip_local_out+0x16/0x27 [1]more> <0> [] ip_queue_xmit+0x30e/0x36e [1]more> <0> [] tcp_transmit_skb+0x707/0x745 [1]more> <0> [] tcp_write_xmit+0x7cb/0x8ba [1]more> <0> [] __tcp_push_pending_frames+0x2f/0x5d [1]more> <0> [] tcp_push+0x88/0x8a [1]more> <0> [] tcp_sendmsg+0x760/0x85b [1]more> <0> [] __sock_sendmsg+0x5e/0x69 [1]more> <0> [] sock_sendmsg+0xa8/0xc1 [1]more> <0> [] ? fget_light+0x57/0xf2 [1]more> <0> [] ? rcu_read_unlock+0x21/0x23 [1]more> <0> [] ? fget_light+0x57/0xf2 [1]more> <0> [] ? eventfd_write+0x94/0x186 [1]more> <0> [] ? sockfd_lookup_light+0x20/0x58 [1]more> <0> [] sys_sendto+0x110/0x152 [1]more> <0> [] ? fsnotify_modify+0x6c/0x74 [1]more> <0> [] ? vfs_write+0xd3/0x10b [1]more> <0> [] ? trace_hardirqs_on_thunk+0x3a/0x3f [1]more> <0> [] system_call_fastpath+0x16/0x1b [1]more> <0>Code: 48 89 df e8 21 f5 ff ff 41 89 c7 45 89 ff e8 e7 fb c7 ff 4a 8d 04 fd 00 00 00 00 48 89 45 c8 48 8b 45 c8 49 03 84 24 98 06 00 00 <4c> 8b 28 eb 14 65 83 40 04 01 e8 bc fc c7 ff eb 3b 65 83 00 01 [1]more> Call Trace: [1]more> [] ? __nf_conntrack_find+0x3b/0xb1 [1]more> [] nf_conntrack_find_get+0x33/0xb7 [1]more> [] nf_conntrack_in+0x209/0x7b4 [1]more> [] ipv4_conntrack_local+0x40/0x49 [1]more> [] nf_iterate+0x46/0x89 [1]more> [] ? dst_output+0x0/0x12 [1]more> [] nf_hook_slow+0x78/0xe0 [1]more> [] ? dst_output+0x0/0x12 [1]more> [] nf_hook_thresh.clone.0+0x41/0x4a [1]more> [] ? poll_freewait+0x32/0x70 [1]more> [] __ip_local_out+0x7e/0x80 [1]more> [] ip_local_out+0x16/0x27 [1]more> [] ip_queue_xmit+0x30e/0x36e [1]more> [] tcp_transmit_skb+0x707/0x745 [1]more> [] tcp_write_xmit+0x7cb/0x8ba [1]more> [] __tcp_push_pending_frames+0x2f/0x5d [1]more> [] tcp_push+0x88/0x8a [1]more> [] tcp_sendmsg+0x760/0x85b [1]more> [] __sock_sendmsg+0x5e/0x69 [1]more> [] sock_sendmsg+0xa8/0xc1 [1]more> [] ? fget_light+0x57/0xf2 [1]more> [] ? rcu_read_unlock+0x21/0x23 [1]more> [] ? fget_light+0x57/0xf2 [1]more> [] ? eventfd_write+0x94/0x186 [1]more> [] ? sockfd_lookup_light+0x20/0x58 [1]more> [] sys_sendto+0x110/0x152 [1]more> [] ? fsnotify_modify+0x6c/0x74 [1]more> [] ? vfs_write+0xd3/0x10b [1]more> [] ? trace_hardirqs_on_thunk+0x3a/0x3f [1]more> [] system_call_fastpath+0x16/0x1b I think there's something more fundamental going on here. Jon. -- 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/