From owner-freebsd-net@FreeBSD.ORG Fri Oct 24 09:33:30 2014 Return-Path: Delivered-To: freebsd-net@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 6717112D for ; Fri, 24 Oct 2014 09:33:30 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C8C1209 for ; Fri, 24 Oct 2014 09:33:30 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XhXFK-000D0J-Nc; Fri, 24 Oct 2014 09:17:06 +0400 Message-ID: <544A1C7C.8090005@FreeBSD.org> Date: Fri, 24 Oct 2014 13:31:40 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Mateusz Guzik , freebsd-net@freebsd.org Subject: Re: nd6_timer vs Giant vs locking in general References: <20141024052656.GG11222@dft-labs.eu> In-Reply-To: <20141024052656.GG11222@dft-labs.eu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Fri, 24 Oct 2014 09:33:30 -0000 On 24.10.2014 09:26, Mateusz Guzik wrote: > Hello there, > > dtrace revealed that the kernel schedules nd6_timer a lot. Not only > that, his callout is not mpsafe so the kernel locks Giant which I > believe is an oversight. > > Also the code looks really suspicious as it walks V_in6_ifaddrhead > without any locking (not to mention there is an interestng comment: > XXXRW: in6_ifaddrhead locking :>) Yes, I'm going to fix some issues there after writing proper API. ND changes are in https://reviews.freebsd.org/D903 . > > Dropping it here in case there is someone interested in fixing this up. >