lkml.org 
[lkml]   [2013]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Improving AIO cancellation
> The draft implementation will look like this. struct bio should have
> some way to get current status of kiocb that generated bio. So we add
> a pointer to bool flag.
>
> struct bio {
> bool *cancelled;
> }
>
> in async DIO codepath this pointer will be initialized with bool at
> "struct kiocb"
> bio->cancelled = &kiocb->cancelled;

Hmm. I suppose. It sure looks disgusting, but the iocb has forgotten
all of the dio state and bios that lead up to the operation once
submission has completed. It's easy enough to match the lifetime rules
of this reference with end_io's using the iocb.

This method also lets one cancelled iocb flag many submitted bios as
cancelled, so that's nice.

> So to cancel kiocb we do
> kiocb->cancelled = true;
> and all bio created from the request will not be send to device anymore.

(With lots of comments to let us know that it being racey is fine.)

> If the proposal is fine then I start implementing it.

For a teeny hack like this the best proposal is a working prototype
patch. Don't wait for acks just dive in.

- z


\
 
 \ /
  Last update: 2013-02-08 19:21    [W:0.067 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site