lkml.org 
[lkml]   [2003]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] loop 8/9 copy_bio use highmem
    loop_copy_bio uses one gfp_mask for bio_alloc and alloc_page calls.
    The bio_alloc obviously can't use highmem, but the alloc_page can.
    Yes, the underlying device might be unable to use highmem, and have
    to use one of its bounce buffers, with an extra copy: so be it.

    (Originally I did propagate the underlying device's bounce needs down to
    the loop device, to avoid that possible extra copy; but let's keep this
    simple, the low end doesn't have highmem and the high end can I/O it.)

    --- loop7/drivers/block/loop.c Tue Jun 10 11:40:23 2003
    +++ loop8/drivers/block/loop.c Tue Jun 10 11:55:11 2003
    @@ -432,13 +432,13 @@
    return 0;
    }

    -static struct bio *loop_copy_bio(struct bio *rbh, int gfp_mask)
    +static struct bio *loop_copy_bio(struct bio *rbh)
    {
    struct bio *bio;
    struct bio_vec *bv;
    int i;

    - bio = bio_alloc(gfp_mask, rbh->bi_vcnt);
    + bio = bio_alloc(__GFP_NOWARN, rbh->bi_vcnt);
    if (!bio)
    return NULL;

    @@ -448,7 +448,7 @@
    __bio_for_each_segment(bv, rbh, i, 0) {
    struct bio_vec *bbv = &bio->bi_io_vec[i];

    - bbv->bv_page = alloc_page(gfp_mask);
    + bbv->bv_page = alloc_page(__GFP_NOWARN|__GFP_HIGHMEM);
    if (bbv->bv_page == NULL)
    goto oom;

    @@ -483,8 +483,7 @@
    int flags = current->flags;

    current->flags &= ~PF_MEMALLOC;
    - bio = loop_copy_bio(rbh,
    - (GFP_ATOMIC & ~__GFP_HIGH) | __GFP_NOWARN);
    + bio = loop_copy_bio(rbh);
    current->flags = flags;
    if (bio == NULL)
    blk_congestion_wait(WRITE, HZ/10);
    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:36    [W:0.030 / U:30.628 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site