From owner-freebsd-net@FreeBSD.ORG Wed Sep 14 13:15:39 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 824E2106564A; Wed, 14 Sep 2011 13:15:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2DF138FC16; Wed, 14 Sep 2011 13:15:39 +0000 (UTC) Received: by yib19 with SMTP id 19so1654042yib.13 for ; Wed, 14 Sep 2011 06:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=C9E+1QW7ze6MeONvyoHuBJI71V7X0ackCmNjN22fV/s=; b=DgH2zfnAhRcmzXLp9cUtr29JxugidRMsR59BYQMX8HoXx+OevrFkW/dUCofuc3vTRZ 58YT0RZppoyDDyJGUNsyOQqAZCZMMFtk0Mxgn+VLO+L0LWrMQRJrQcXaG53QH6b7CxyR QFWCfKvjr3Dg7upOTeWRWvo9AV6YWgvy1yybc= MIME-Version: 1.0 Received: by 10.236.75.227 with SMTP id z63mr40610154yhd.55.1316006138415; Wed, 14 Sep 2011 06:15:38 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.111.42 with HTTP; Wed, 14 Sep 2011 06:15:38 -0700 (PDT) In-Reply-To: <201109140740.17319.jhb@freebsd.org> References: <201109140740.17319.jhb@freebsd.org> Date: Wed, 14 Sep 2011 21:15:38 +0800 X-Google-Sender-Auth: g5kZe14bLOI-McdC6pLNPVP1F2A Message-ID: From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, Ryan Stone , Jack Vogel , Arnaud Lacombe Subject: Re: FreeBSD 7-STABLE mbuf corruption X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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, 14 Sep 2011 13:15:39 -0000 On 14 September 2011 19:40, John Baldwin wrote: > You should probably commit that. =A0I wonder if it should be a KASSERT() = also so > that it outright panics on a kernel with INVARIANTS enabled so developers= will > go fix their code as it seems to me to likely be a bug to enqueue a task = that > many times. Or maybe warn? If it's used per-interrupt (like say it is under ath, but for a 10GE NIC doing a high packet rate) then you may end up enqueuing the taskqueue quite often before it next gets a chance to run. Otherwise the code will have to add some more locking and tracking of its own to only enqueue the task once. As I said, I'm just worried that some of the taskqueue users are doing some kind of poor mans refcounting where n(taskqueue_enqueue) references has to equal the npending field in the taskqueue callback. Adrian