From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:16856 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727615AbeJRVT2 (ORCPT ); Thu, 18 Oct 2018 17:19:28 -0400 From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, Ming Lei , Vitaly Kuznetsov , Dave Chinner , Linux FS Devel , "Darrick J . Wong" , xfs@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Matthew Wilcox Subject: [PATCH 0/5] block: introduce helpers for allocating io buffer from slab Date: Thu, 18 Oct 2018 21:18:12 +0800 Message-Id: <20181018131817.11813-1-ming.lei@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, Filesystems may allocate io buffer from slab, and use this buffer to submit bio. This way may break storage drivers if they have special requirement on DMA alignment. The patch 1 adds one warning if the io buffer isn't aligned to DMA alignment. The 2nd & 3rd patches make DMA alignment as stacked limit. The 4th patch introduces helpers for allocating io buffer from slab, and DMA alignment is respected on this allocation. The 5th patch converts xfs to use the introduced helpers for allocating io buffer from slab. See previous discussion on this topic: https://marc.info/?t=153734857500004&r=1&w=2 Thanks, Ming Ming Lei (5): block: warn on un-aligned DMA IO buffer block: move .dma_alignment into q->limits block: make dma_alignment as stacked limit block: introduce helpers for allocating IO buffers from slab xfs: use block layer helpers to allocate io buffer from slab block/Makefile | 3 +- block/blk-core.c | 2 + block/blk-merge.c | 2 + block/blk-sec-buf.c | 144 ++++++++++++++++++++++++++++++++++++++++++++ block/blk-settings.c | 89 +++++++++++++++------------ fs/xfs/xfs_buf.c | 28 ++++++++- fs/xfs/xfs_super.c | 13 +++- include/linux/blk-sec-buf.h | 43 +++++++++++++ include/linux/blkdev.h | 9 ++- 9 files changed, 287 insertions(+), 46 deletions(-) create mode 100644 block/blk-sec-buf.c create mode 100644 include/linux/blk-sec-buf.h Cc: Vitaly Kuznetsov Cc: Dave Chinner Cc: Linux FS Devel Cc: Darrick J. Wong Cc: xfs@vger.kernel.org Cc: Dave Chinner Cc: Christoph Hellwig Cc: Bart Van Assche Cc: Matthew Wilcox -- 2.9.5