From patchwork Mon Jun 13 14:48:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9173335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FAE860573 for ; Mon, 13 Jun 2016 14:48:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1203C1FF12 for ; Mon, 13 Jun 2016 14:48:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04FDD25EF7; Mon, 13 Jun 2016 14:48:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0C1C1FF12 for ; Mon, 13 Jun 2016 14:48:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424168AbcFMOst (ORCPT ); Mon, 13 Jun 2016 10:48:49 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:58741 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423217AbcFMOst (ORCPT ); Mon, 13 Jun 2016 10:48:49 -0400 Received: from [83.175.99.196] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCTAV-00042q-Os; Mon, 13 Jun 2016 14:48:48 +0000 From: Christoph Hellwig To: axboe@kernel.dk Cc: mchristi@redhat.com, linux-block@vger.kernel.org Subject: [PATCH 3/3] block: shrink bio size again Date: Mon, 13 Jun 2016 16:48:35 +0200 Message-Id: <1465829315-23137-4-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465829315-23137-1-git-send-email-hch@lst.de> References: <1465829315-23137-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The recent ops split grew the bio by adding the new ioprio field. Shrink it again by using a 16-bit field for the bi_flags value and filling the holes near the beginning of the structure. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Mike Christie --- include/linux/blk_types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 4494b6c..f254eb2 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -26,11 +26,11 @@ typedef void (bio_destructor_t) (struct bio *); struct bio { struct bio *bi_next; /* request queue link */ struct block_device *bi_bdev; - unsigned int bi_flags; /* status, command, etc */ int bi_error; unsigned int bi_rw; /* bottom bits req flags, * top bits REQ_OP */ + unsigned short bi_flags; /* status, command, etc */ unsigned short bi_ioprio; struct bvec_iter bi_iter; @@ -116,7 +116,7 @@ struct bio { * Flags starting here get preserved by bio_reset() - this includes * BVEC_POOL_IDX() */ -#define BIO_RESET_BITS 13 +#define BIO_RESET_BITS 10 /* * We support 6 different bvec pools, the last one is magic in that it @@ -131,7 +131,7 @@ struct bio { * freed. */ #define BVEC_POOL_BITS (4) -#define BVEC_POOL_OFFSET (32 - BVEC_POOL_BITS) +#define BVEC_POOL_OFFSET (16 - BVEC_POOL_BITS) #define BVEC_POOL_IDX(bio) ((bio)->bi_flags >> BVEC_POOL_OFFSET) #endif /* CONFIG_BLOCK */