From owner-freebsd-net@FreeBSD.ORG Wed Mar 18 20:57:59 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC4E93CB; Wed, 18 Mar 2015 20:57:59 +0000 (UTC) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) (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 83A08A2D; Wed, 18 Mar 2015 20:57:59 +0000 (UTC) Received: by iegc3 with SMTP id c3so49939330ieg.3; Wed, 18 Mar 2015 13:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=Ia1N5MFcFNMrIzL7i2KgVoi8va/CxbGU8AtEv4aliR4=; b=PfM0urc/+qOk46A3LTaZd8KDcZvSGhqgNqi2qL7z8tSdORE2ewUleVVo9eiMxYG87t oW0TL73pmrMeWX21dbKOfpWvtSAqZR14PJY3HEEiANHmv5dJ2FgAUVObxepsNVh+nD7g M1aSY3rvn8bQOMZBmxAwO887tJxwYXC/bHaAVZO16188DMEju1DaFeBJkbGEBZL3LfbN /t0q6QTdjbIW+Bw97RsCBjn030iiIoW/7BvvO8Y7rP1jRvS71aPUVHXMQ3fndz4mwL4y +WwJc4nwshDbYSPqCQBvyyazBAB+gn0rnfXVGO/3EaIlMJiIIpK/W8Bb+Un2ULIfhMy4 k4QQ== MIME-Version: 1.0 X-Received: by 10.50.43.201 with SMTP id y9mr10642372igl.6.1426712278878; Wed, 18 Mar 2015 13:57:58 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Wed, 18 Mar 2015 13:57:58 -0700 (PDT) Date: Wed, 18 Mar 2015 13:57:58 -0700 X-Google-Sender-Auth: WJWsGTk-ZZnWpL6Gj9l95rWNTto Message-ID: Subject: RFT: break out IPv4 fragment reassembly locking into per-bucket locks From: Adrian Chadd To: "freebsd-arch@freebsd.org" , FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2015 20:57:59 -0000 Hi, I've created a review for this: https://reviews.freebsd.org/D2095 It does a couple things: * The IPv4 reassembly locking is now per-bucket, rather than global * If space needs to be made, it's made /after/ the reassembly queue manipulation is done. This way it's done without the queue lock held, rather than trying to grab a lock for bucket X whilst doing work in bucket Y. This dramatically reduces the lock contention when doing IPv4 fragment reassembly. I'd prefer this to be done along RSS bucket lines so there's /no/ lock contention during RSS based IPv4 fragment reassembly, but this is a good first step and applies even if RSS isn't being done. I'd appreciate any testing/reviews people may have. Thanks, -adrian