From owner-freebsd-current@FreeBSD.ORG Sun Apr 4 13:20:59 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1104816A4CE for ; Sun, 4 Apr 2004 13:20:59 -0700 (PDT) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC49543D39 for ; Sun, 4 Apr 2004 13:20:57 -0700 (PDT) (envelope-from sos@DeepCore.dk) Received: from DeepCore.dk (sos.deepcore.dk [194.192.25.130]) by spider.deepcore.dk (8.12.11/8.12.10) with ESMTP id i34KKha8054744; Sun, 4 Apr 2004 22:20:48 +0200 (CEST) (envelope-from sos@DeepCore.dk) Message-ID: <40706E1B.4010004@DeepCore.dk> Date: Sun, 04 Apr 2004 22:20:43 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla Thunderbird 0.5 (X11/20040329) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Poul-Henning Kamp References: <1839.1081109842@critter.freebsd.dk> In-Reply-To: <1839.1081109842@critter.freebsd.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-mail-scanned: by DeepCore Virus & Spam killer v1.4 cc: current@freebsd.org Subject: Re: Intel SATA ICH5/5R 6300ESB support patches X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2004 20:20:59 -0000 Poul-Henning Kamp wrote: > In message <200404042002.i34K2nop038808@ambrisko.com>, Doug Ambrisko writes: > >>Søren Schmidt writes: > > >>| > I put in a patch for geom for bio_taskqueue_remove. Since ata code >>| > schedules bio_task it need to be cancelled when we abort and call >>| > biodone. If we don't cancel this task then when the task is >>| > run later we get a double free in UMA since we have cleaned up >>| > twice and called biodone twice for the same request. > > > Sos@ forwarded that patch and it won't fly, it has no chance of > working reliably on multi-cpu machines: > > There is no guarantee that the task is still on the queue by the > time you try to remove it, and if is not, it is likely to be because > another CPU is already waiting for a lock in the ata driver in the > bio_taskqueue handler function, so we have no way to cancel that > other CPU's activity. > > The correct solution is to not do the biodone when you cancel, but > let the already scheduled bio_taskqueue event to do so. Actually I've solved this very differently by now, the problem was the handling of the "in flight" request, that could cause bidone to be called twice (which is plain wrong)... -- -Søren