Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Apr 2004 13:22:30 -0700 (PDT)
From:      Doug Ambrisko <ambrisko@ambrisko.com>
To:        =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@DeepCore.dk>
Cc:        current@freebsd.org
Subject:   Re: Intel SATA ICH5/5R 6300ESB support patches
Message-ID:  <200404042022.i34KMU8C039893@ambrisko.com>
In-Reply-To: <40706E1B.4010004@DeepCore.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Søren Schmidt writes:
| 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)...

Sounds good,

Doug A.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404042022.i34KMU8C039893>