lkml.org 
[lkml]   [2011]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 10/10] fs: make aio plug
    On 2011-01-24 18:59, Jeff Moyer wrote:
    > Jens Axboe <jaxboe@fusionio.com> writes:
    >
    >> From: Shaohua Li <shaohua.li@intel.com>
    >>
    >> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
    >> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
    >> ---
    >> fs/aio.c | 4 ++++
    >> 1 files changed, 4 insertions(+), 0 deletions(-)
    >>
    >> diff --git a/fs/aio.c b/fs/aio.c
    >> index c5ea494..1476bed 100644
    >> --- a/fs/aio.c
    >> +++ b/fs/aio.c
    >> @@ -1660,6 +1660,7 @@ long do_io_submit(aio_context_t ctx_id, long nr,
    >> long ret = 0;
    >> int i;
    >> struct hlist_head batch_hash[AIO_BATCH_HASH_SIZE] = { { 0, }, };
    >> + struct blk_plug plug;
    >>
    >> if (unlikely(nr < 0))
    >> return -EINVAL;
    >> @@ -1676,6 +1677,8 @@ long do_io_submit(aio_context_t ctx_id, long nr,
    >> return -EINVAL;
    >> }
    >>
    >> + blk_start_plug(&plug);
    >> +
    >> /*
    >> * AKPM: should this return a partial result if some of the IOs were
    >> * successfully submitted?
    >> @@ -1698,6 +1701,7 @@ long do_io_submit(aio_context_t ctx_id, long nr,
    >> if (ret)
    >> break;
    >> }
    >> + blk_finish_plug(&plug);
    >> aio_batch_free(batch_hash);
    >
    > I'm pretty sure you want blk_finish_plug to run after aio_batch_free.

    You mean to cover the iput()? That's not a bad idea, if that ends up
    writing it out. I did a few read tests here and confirmed it's sending
    down batches of whatever number is submitted.

    --
    Jens Axboe



    \
     
     \ /
      Last update: 2011-01-24 20:11    [W:0.025 / U:30.484 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site