From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966098AbbD1Vcd (ORCPT ); Tue, 28 Apr 2015 17:32:33 -0400 Received: from mail-qk0-f175.google.com ([209.85.220.175]:34670 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965999AbbD1Vcb (ORCPT ); Tue, 28 Apr 2015 17:32:31 -0400 Message-ID: <553FFC6B.3080302@gmail.com> Date: Tue, 28 Apr 2015 17:32:27 -0400 From: Rob Harris User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: linux-kernel@vger.kernel.org Subject: custom block device driver with 6k block size... Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Greetings. I've been working on developing a custom block device that (unfortunately) uses 6k block sizes. I've been trying to deal directly with the BIO's (make_request_fn) and even though I've configured the request_queue as follows... blk_queue_io_min( smc_dev->req_queue, SIX_KB ); blk_queue_io_opt( smc_dev->req_queue, TWELVE_KB ); blk_queue_max_segments( smc_dev->req_queue, SIX_KB * 100 / TWELVE_KB ); blk_queue_max_segment_size( smc_dev->req_queue, SIX_KB * 100 ); blk_queue_max_hw_sectors( smc_dev->req_queue, SIX_KB * 100 / 512 ); blk_queue_logical_block_size( smc_dev->req_queue, SIX_KB ); blk_queue_physical_block_size( smc_dev->req_queue, SIX_KB ); blk_queue_segment_boundary( smc_dev->req_queue, SIX_KB-1 ); queue_flag_set_unlocked( QUEUE_FLAG_NONROT, smc_dev->req_queue ); queue_flag_clear_unlocked( QUEUE_FLAG_ADD_RANDOM, smc_dev->req_queue ); ... I still seem to always get handed BIO's with PAGE_SIZE(4k) segment_sizes in the bio_vec and I never seem to get any sort of bio_vec coalescing when trying a blk_bio_map_sg. Everything returned is always small (if at all) multiples of PAGE_SIZE. I would love to DMA large buffers directly back and forth to the controller, but offsetting the delta between the 4k and 6k offset is a pain. Is there something simple that I'm missing or doing wrong? Thanks, -Rob Harris