Re: [PATCH linux-2.6.1-rc1-mm1] aiodio_fallback_bio_count.patch

From: Suparna Bhattacharya (suparna_at_in.ibm.com)
Date: 01/05/04

  • Next message: John Goerzen: "Re: SYM53c8xx Panic on Boot: 2.6.1rc1 (Alpha)"
    Date:	Mon, 5 Jan 2004 10:58:46 +0530
    To: Andrew Morton <akpm@osdl.org>
    
    

    On Sun, Jan 04, 2004 at 09:06:42PM -0800, Andrew Morton wrote:
    > Suparna Bhattacharya <suparna@in.ibm.com> wrote:
    > >
    > > > What is the significance of `written > count' in there, and of `dio->result
    > > > > dio->size' in finished_one_bio()? How can these states come about?
    > > >
    > >
    > > Both of these are checks to determine whether all or only a part of
    > > the request was serviced by DIO, leaving the rest to be serviced by
    > > falling back to buffered I/O.
    > >
    > > Earlier, we would decide this based on whether dio->result == -ENOTBLK
    > > and written == -ENOTBLK respectively. However, now that we also need the
    > > result to indicate how much actually got written even in -ENOTBLK case,
    > > so that we can issue buffered i/o only for the remaining part of the request,
    > > dio->result and written had to be modified to reflect the number of bytes
    > > transferred by DIO even for the fallback to buffered i/o case.
    > > So we need checks like this to find out whether there is some i/o left
    > > to be issued via buffered i/o.
    >
    > Sure. But the generic_file_aio_write_nolock() code is doing this:
    >
    > if (written >= count && !is_sync_kiocb(iocb))
    > written = -EIOCBQUEUED;
    > if (written < 0 || written >= count)
    > goto out_status;
    >
    >
    > Under what circumstances can `written' (the amount which was written) be
    > greater than `count' (the amount to write)?

    None. The '>' situation should never occur.

    This is just being explicit about covering the "not less than" case
    as a whole, and making sure we do not fall through to buffered i/o in
    that case, i.e its the same as:
    if (!(written < count) && !is_sync_kiocb(iocb))

    Is that any less confusing ? Or would you rather just replace the '>=" by
    "=='.

    Regards
    Suparna

    -- 
    Suparna Bhattacharya (suparna@in.ibm.com)
    Linux Technology Center
    IBM Software Lab, India
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: John Goerzen: "Re: SYM53c8xx Panic on Boot: 2.6.1rc1 (Alpha)"

    Relevant Pages

    • Re: [PATCH linux-2.6.1-rc1-mm1] aiodio_fallback_bio_count.patch
      ... > so that we can issue buffered i/o only for the remaining part of the request, ... > transferred by DIO even for the fallback to buffered i/o case. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH linux-2.6.1-rc1-mm1] aiodio_fallback_bio_count.patch
      ... so that we can issue buffered i/o only for the remaining part of the request, ... transferred by DIO even for the fallback to buffered i/o case. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.6.14-rc1] sym scsi boot hang
      ... it's probably a double down of the host scan ... the queue a request with REQ_DONTPREP set. ... Here is a patch that addresses the first problem and fixes up a few other ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] __block_write_full_page bug
      ... >> It seems that more than one request would be submitted for a given bh ... the bug is that end_buffer_async_write first does ... Or did you mean *how* is it being run twice? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.0-test6-mm4 - oops in __aio_run_iocbs()
      ... > The race I was suspecting is a different one - a case where the dio code ... AIO-DIO fix: Don't call aio_complete if we are falling back to buffered i/o ... reflect the number of to-be-processed BIOs. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)