Skip to content
  • Tejun Heo's avatar
    block: fix queue bounce limit setting · cd0aca2d
    Tejun Heo authored
    
    
    Impact: don't set GFP_DMA in q->bounce_gfp unnecessarily
    
    All DMA address limits are expressed in terms of the last addressable
    unit (byte or page) instead of one plus that.  However, when
    determining bounce_gfp for 64bit machines in blk_queue_bounce_limit(),
    it compares the specified limit against 0x100000000UL to determine
    whether it's below 4G ending up falsely setting GFP_DMA in
    q->bounce_gfp.
    
    As DMA zone is very small on x86_64, this makes larger SG_IO transfers
    very eager to trigger OOM killer.  Fix it.  While at it, rename the
    parameter to @dma_mask for clarity and convert comment to proper
    winged style.
    
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
    cd0aca2d