From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 17:36:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 709FC80E; Wed, 8 Apr 2015 17:36:19 +0000 (UTC) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 346AAD1C; Wed, 8 Apr 2015 17:36:19 +0000 (UTC) Received: by iebrs15 with SMTP id rs15so80602729ieb.3; Wed, 08 Apr 2015 10:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=BvPO2tuJR2totEpiMLZM3+o9wDlfs19sDUJTN0lGGuY=; b=d84/LK6cdFKxMhGg3/FwgJ/f+EkPxIbtbKfL3LsWcOPs1CiG/hVBUFIqof9Hrviy2v b18BvpmsoBcpi5qkRB9Dzyay7NGoEZN54GN7S1wjKcEIBgH6pPksZOkprBBt96jlFzRO 57MVyrHQv9RgpP+VPkHFEChPAQzK0J34yXdpJMSMOInaFLZSc9BZZ2g0jctGeBCyC2W7 aXh0/sY2h9KmKu2x3t3ER/aQDkPEfTPTux4E/KMuDVRHBXAFBl1W/C3wAHXHrOGMvhlX z9PiytxyFNFD0VkzkywjR+9Nd9ijc6RcwpazrYveTntmF/Ad0HGZgUsuQtZ5k12syj0r Ugjg== MIME-Version: 1.0 X-Received: by 10.50.143.42 with SMTP id sb10mr13628580igb.49.1428514578654; Wed, 08 Apr 2015 10:36:18 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Wed, 8 Apr 2015 10:36:18 -0700 (PDT) In-Reply-To: <20150408084839.GO64665@FreeBSD.org> References: <201504072309.t37N9Zwf011383@svn.freebsd.org> <20150408084839.GO64665@FreeBSD.org> Date: Wed, 8 Apr 2015 10:36:18 -0700 X-Google-Sender-Auth: yMLH311VNDmqiYV4LX6oJHTtWrk Message-ID: Subject: Re: svn commit: r281239 - head/sys/netinet From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2015 17:36:19 -0000 hi gleb, /* Skip initialization of globals for non-default instances. */ if (!IS_DEFAULT_VNET(curvnet)) return; .. ie, no. It doesn't double-init the mutexes. And the purging from bucket behaviour should have been precisely what the previous behaviour was. /* * drop something from the tail of the current queue * before proceeding further */ .. if you'd like to fix that then cool, but it's orthogonal to what I was trying to do. I didn't want to go and do multiple things in one patch set - this was /just/ to unroll the per-bucket locking. If you'd like to fix the existing potentially risky bucket purging code in the ip reassembly code then cool, let's do it - but in a separate patchset. V_nipq leaking is something we both missed during that review cycle. I'm glad you caught it now. -adrian On 8 April 2015 at 01:48, Gleb Smirnoff wrote: > On Tue, Apr 07, 2015 at 11:09:35PM +0000, Adrian Chadd wrote: > A> Author: adrian > A> Date: Tue Apr 7 23:09:34 2015 > A> New Revision: 281239 > A> URL: https://svnweb.freebsd.org/changeset/base/281239 > A> > A> Log: > A> Move the IPv4 reassembly queue locking from a single lock to be per-bucket (global). > A> > A> This significantly improves performance on multi-core servers where there > A> is any kind of IPv4 reassembly going on. > A> > A> glebius@ would like to see the locking moved to be attached to the reassembly > A> bucket, which would make it per-bucket + per-VNET, instead of being global. > A> I decided to keep it global for now as it's the minimal useful change; > A> if people agree / wish to migrate it to be per-bucket / per-VNET then please > A> do feel free to do so. I won't complain. > A> > A> Thanks to Norse Corp for giving me access to much larger servers > A> to test this at across the 4 core boxes I have at home. > A> > A> Differential Revision: https://reviews.freebsd.org/D2095 > A> Reviewed by: glebius (initial comments incorporated into this patch) > > No, they are not. > > Also, I just noticed another issue with the patch. You initialize the mutexes, > which are global, in the ip_init() which is called for every VNET. That would > lead to panic of initializing already initialized mutex. If you followed my advice, > that would not happen. Now VIMAGE+INVARIANTS is broken instantly, and w/o > INVARIANTS may panic if VIMAGE created under IP traffic. > > My comment that purging from a bucket that is determined by source IP has > security implications was also ignored. > > I will fix this all myself. > > -- > Totus tuus, Glebius.