From owner-freebsd-current@FreeBSD.ORG Sun Apr 4 13:21:50 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 D828216A4CE for ; Sun, 4 Apr 2004 13:21:50 -0700 (PDT) Received: from www.ambrisko.com (adsl-64-174-51-42.dsl.snfc21.pacbell.net [64.174.51.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82C6143D48 for ; Sun, 4 Apr 2004 13:21:50 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.12.9p2/8.12.9) with ESMTP id i34KLcCf039831; Sun, 4 Apr 2004 13:21:38 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.12.9p2/8.12.9/Submit) id i34KLcVT039830; Sun, 4 Apr 2004 13:21:38 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200404042021.i34KLcVT039830@ambrisko.com> In-Reply-To: <1839.1081109842@critter.freebsd.dk> To: Poul-Henning Kamp Date: Sun, 4 Apr 2004 13:21:38 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UNKNOWN-8BIT cc: current@freebsd.org cc: =?ISO-8859-1?Q?S=F8ren_Schmidt?= 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:21:51 -0000 Poul-Henning Kamp writes: | 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. Okay, I'll look at the ata code so that it only does it once. Thanks, Doug A.