Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4209296imm; Fri, 18 May 2018 00:55:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqdFirYLyNXh7hff5wHaZoVTjnAHs/AChUwwvFpFEbzDYZBJnS6767jMHtNR9GupioB6mLj X-Received: by 2002:a62:1a4e:: with SMTP id a75-v6mr8337434pfa.84.1526630109654; Fri, 18 May 2018 00:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526630109; cv=none; d=google.com; s=arc-20160816; b=N+KNf31wPvBH9orvHaKuTIVvCIviGGhQZXOLdKH315qaJ5HaiKJwEYzx04BF5aG4Qk WBu0ulAwE+1QBZGwnnoWCAgHI6p7+4+hzS8q8DLshAoIlTcvoGeVOWT4qbwOrb51C0AU Fu/2N3XkBQTmDkNB1k1agmBbuE2Lgi+liVgsJmqRU+Z3BclqmE6LmVvNr6rb3L0GFiZF uZuPQK7JEbiPTK7P1G5Zv+SF1Po3oxPN5/OxdDHtWU/5CqNZdJI3qZYld5bLuosVaoKU cGlZQAuMYH/Kd7kAzsgetFwMsg2f2hBotXi0nfJQ79h9SEBCTY03rnvYt1ic3zd3c/Yd Co5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=082D6fl4jnpWcLDn3aqLAByCiMCFTeMFbF7D74xpw+g=; b=a/w/Fn4Tnqk6OtUkI+Frtow8fVopkmhOG7Qp/B1CTGJzm68cP7u6sVPw5ciEGGzmOq WDi8Aihpg+Pr32ACZnBmgu3X/bw3jlbS0UTpCubUbQJ5oGUOemCdh91clazNphV67AkT cOuyRlSU+zIXQiyKWnFgqvHm7YFV9Nged0J3p3DPCniCVJU9PV3MSEGPUMhRgmj5LD7p 6JJ5rlb/vRbmXkPOwA7NhaBtJhevS4fC8iqluau0EKRMpm6Y/zZSSawiFT9bm20QaPOM MzqAFkocmTYkBerP4fOZzFTTJkRzVVrZQF5195R8AyL7lvkv0c+bRpEpYvp9PSGnsgud kQtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YQ8yPA75; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o17-v6si5352159pge.198.2018.05.18.00.54.55; Fri, 18 May 2018 00:55:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YQ8yPA75; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbeERHyR (ORCPT + 99 others); Fri, 18 May 2018 03:54:17 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:35997 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752199AbeERHuB (ORCPT ); Fri, 18 May 2018 03:50:01 -0400 Received: by mail-qt0-f195.google.com with SMTP id q6-v6so9157927qtn.3; Fri, 18 May 2018 00:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=082D6fl4jnpWcLDn3aqLAByCiMCFTeMFbF7D74xpw+g=; b=YQ8yPA757yu/xkQHFGUQRY4886a0QN9u0Ro+aeT97p6jbqxprmv5UboZLoVn9rdLgL SLg0pPNsamq6gUWgDULqsX7jEyvi4IMGBF7ZPwvTRQGBlcAe6S1s91DhQ5q8rYIrUUnr ll2++btFencHtwFfwsMKB9wrJFr8qBtM3Ogwsivs+LuqIIbriVB/vSyzdzr3ip9WEi4W nUC+YTNIP3tIEg7mExvm2A+4AOsiS70zJiMGSMAQdSLuSuy54DLzkjwTLXTZ8qcf9ijy QMqEuD4I9mYcTBSi67lNO7DHldUy8YhtOw/pWrYL8HrHUOLMa6JozXYV+WHBeE7Q2KyF xRxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=082D6fl4jnpWcLDn3aqLAByCiMCFTeMFbF7D74xpw+g=; b=o+nC5srn8FBbDGcyc8xalRcFP0navzWtwwMmnutE7yraeZIAeUW5EqCu3BBsnMF8JM ObmAxek0DiIQvqfEuyOl84Eh11Hk3OZIrIFJzR10frdg7ABYUGMWcl+j1HbkMj3PbRgi pVgA4ckp5O5zxcvBlIWJOpIRApFXXRHgURJSX3urPlnE5jAESdMAcZPh3+G7Ts1B+qgk U74EXC41SKJYxospcJvHz2PvFaXTKkIKUCg60Cbwy61zc9FGETZyESkobxJS5XhorFpb Lc4jp38+ZfNXzPD3gmAzAJUptOpszZgOrSjS8y3WtWEDvPXJ4tDfF2xEGeAnKCYtTrC1 1pBg== X-Gm-Message-State: ALKqPwe1YMcrTniJ6DxqQJ1B8QsroqhiETlZtPO/sr1kZ0AJJ8VBy52o Le/Peg1PuXXUh+AHxFdtoASXIg8FSA== X-Received: by 2002:ac8:181c:: with SMTP id q28-v6mr8078795qtj.309.1526629800406; Fri, 18 May 2018 00:50:00 -0700 (PDT) Received: from localhost.localdomain (c-71-234-172-214.hsd1.vt.comcast.net. [71.234.172.214]) by smtp.gmail.com with ESMTPSA id s64-v6sm5443004qkl.85.2018.05.18.00.49.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 00:49:59 -0700 (PDT) From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, Jens Axboe , Ingo Molnar Cc: Kent Overstreet Subject: [PATCH 04/10] block: Use bioset_init() for fs_bio_set Date: Fri, 18 May 2018 03:49:05 -0400 Message-Id: <20180518074918.13816-8-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518074918.13816-1-kent.overstreet@gmail.com> References: <20180518074918.13816-1-kent.overstreet@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Minor optimization - remove a pointer indirection when using fs_bio_set. Signed-off-by: Kent Overstreet --- block/bio.c | 7 +++---- block/blk-core.c | 2 +- drivers/target/target_core_iblock.c | 2 +- include/linux/bio.h | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/block/bio.c b/block/bio.c index 980befd919..b7cdad6fc4 100644 --- a/block/bio.c +++ b/block/bio.c @@ -53,7 +53,7 @@ static struct biovec_slab bvec_slabs[BVEC_POOL_NR] __read_mostly = { * fs_bio_set is the bio_set containing bio and iovec memory pools used by * IO code that does not need private memory pools. */ -struct bio_set *fs_bio_set; +struct bio_set fs_bio_set; EXPORT_SYMBOL(fs_bio_set); /* @@ -2055,11 +2055,10 @@ static int __init init_bio(void) bio_integrity_init(); biovec_init_slabs(); - fs_bio_set = bioset_create(BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); - if (!fs_bio_set) + if (bioset_init(&fs_bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS)) panic("bio: can't allocate bios\n"); - if (bioset_integrity_create(fs_bio_set, BIO_POOL_SIZE)) + if (bioset_integrity_create(&fs_bio_set, BIO_POOL_SIZE)) panic("bio: can't create integrity pool\n"); return 0; diff --git a/block/blk-core.c b/block/blk-core.c index 6d82c4f7fa..66f24798ef 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -3409,7 +3409,7 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src, struct bio *bio, *bio_src; if (!bs) - bs = fs_bio_set; + bs = &fs_bio_set; __rq_for_each_bio(bio_src, rq_src) { bio = bio_clone_fast(bio_src, gfp_mask, bs); diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 07c814c426..c969c01c7c 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -164,7 +164,7 @@ static int iblock_configure_device(struct se_device *dev) goto out_blkdev_put; } pr_debug("IBLOCK setup BIP bs->bio_integrity_pool: %p\n", - bs->bio_integrity_pool); + &bs->bio_integrity_pool); } dev->dev_attrib.hw_pi_prot_type = dev->dev_attrib.pi_prot_type; } diff --git a/include/linux/bio.h b/include/linux/bio.h index fa3cf94a50..91b02520e2 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -423,11 +423,11 @@ extern void __bio_clone_fast(struct bio *, struct bio *); extern struct bio *bio_clone_fast(struct bio *, gfp_t, struct bio_set *); extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs); -extern struct bio_set *fs_bio_set; +extern struct bio_set fs_bio_set; static inline struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs) { - return bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set); + return bio_alloc_bioset(gfp_mask, nr_iovecs, &fs_bio_set); } static inline struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned int nr_iovecs) -- 2.17.0