From patchwork Wed May 9 01:33:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 10387951 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 212206053E for ; Wed, 9 May 2018 01:34:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1FAC28FF5 for ; Wed, 9 May 2018 01:34:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6C4128FF7; Wed, 9 May 2018 01:34:29 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CDE628FF5 for ; Wed, 9 May 2018 01:34:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96CC86B030F; Tue, 8 May 2018 21:34:22 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8F3496B0310; Tue, 8 May 2018 21:34:22 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BB206B0311; Tue, 8 May 2018 21:34:22 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id 4C7836B030F for ; Tue, 8 May 2018 21:34:22 -0400 (EDT) Received: by mail-qt0-f199.google.com with SMTP id t3-v6so25759760qto.14 for ; Tue, 08 May 2018 18:34:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=082D6fl4jnpWcLDn3aqLAByCiMCFTeMFbF7D74xpw+g=; b=eW4WKuH9VjyT05rRDDE8iKO6LdqLzRkwCAlxjhh/Ne9a6sLpSRquOgmJVOLiXw8sbg AEsBqD8zbGOgtJPxzMdowlVjLYsNJzlJAG1qX3KuOsGMJncS9ZqZz2xJWeh+xzamqEVT GIVCU6QYubRgGHxeEudYo96tsMx4NcOyUWTpEpFANh85IHvInjI7pr3sZhE1ABBeK55s krCylBi8PxSpO3uUpOzd/Dy69RxQDPeSwKmxvCcg1/b06WuACv8fabJnSkMGapF1ZF2T /+phep5taAF5c+XOSJPRTA+hXFB2yom7iSZGeGwxsBSEwyrC+kJ3dSOtJ7hVTK52w3NE cQ8g== X-Gm-Message-State: ALQs6tAm8TzbjX1XiXz/aiGt14+RRP7mZmNIJWMZsWyOnBOKz17jUrLF jznHVF/1U3Y5Okz/naXYFJeDJw4lBo6CDZLSffxOci69AlcjGPBf6k7m4hVa0rYtIkYA0Y4EDfx 48JQb+mVioxIalzUQN4qoZByRJVOZVwWoquQB3B4ir8Bjt3b5Yj2IFgNRA7AgH+7COrU0ZrRRff /UXez/35XvesmdrVn2+oy8dpvi767Lzy8as7ARSxmymp+3h7spWjeHLO3J1s7Tm2mvhGfRTETmm AHqSI4z9zMD4YljqFJVK61maLCqcQKsHPpGCSO1a6EjV37cdNGIoms9/db366uBevSrvHpSFAqE uPCPoo/c3hdxG6Ljq6T6sLs+2f5eK7gKZ3TXHxyi2mkRhmBMOtdEXRZ2J8udcSBsUIGxj1t6Or1 L X-Received: by 2002:aed:2785:: with SMTP id a5-v6mr39663578qtd.249.1525829662091; Tue, 08 May 2018 18:34:22 -0700 (PDT) X-Received: by 2002:aed:2785:: with SMTP id a5-v6mr39663548qtd.249.1525829661401; Tue, 08 May 2018 18:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525829661; cv=none; d=google.com; s=arc-20160816; b=0bIumnSfGPJvXJoGAnW9u2BDAUd4IxMulriI11WMNZIuvjqYsFDhW/nBzkHJLdA4RK VDbOcWLHU6vo02M2JLPInZYvOdgHXi2LvNUTgRmjf3Saq8/JhQ7Se3RQnfvdOIOAFN4Y gbSvITobhcRBfxtm4u3tq8uliT1cHzrBo/A/QQ2J0Uy3SLjiBRiaiq77aFnCpCc7kM67 pUGdbmSaS4t2jCoBnrY+3aB2229aNUUUNjs54NKanJEAyIB7/bcobE7gmnoclp5Y8IiS x+AvZmQQUlce49DV1J6eh0xLbC7MkgtE4oGIEm4uSJDA4lYEuNsEcneCAx/ymRCBXYSO XCpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=082D6fl4jnpWcLDn3aqLAByCiMCFTeMFbF7D74xpw+g=; b=kbsO8bsRpuOFs9GJ8X1lySTvmUgUPecmOSX08/zFNczNjAOm2O0PncZDNjD+T94Tv1 n5d/VHzgrZI8X+aPckbqC3XiKOJCYI/FL9gosBSUMRPZ3fULBVQ1/pr0i+YI6NmUxjCE vzglpOJJy9ULMURp8vHrm/d1Q3A8/APw8hkPq6Co9Yx6yi6NP8ATjV/6b0QOFp4TV8FH c//lrRKx/xcp4UbM0vnr5W1Hf+BoJvc5h6Igh1tDUOv4QZZot/BFfmInK6g0vwanvXpb 5/lX6Z8Yr3Q2lhIVX2zbS3TfQGblZ3VFpEnenKs0sg+FPUbLYX0PQjvFcNu2B/nh1PO4 l0sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=asX2pP9D; spf=pass (google.com: domain of kent.overstreet@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id s48-v6sor16487191qtc.121.2018.05.08.18.34.21 for (Google Transport Security); Tue, 08 May 2018 18:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of kent.overstreet@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=asX2pP9D; spf=pass (google.com: domain of kent.overstreet@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kent.overstreet@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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=asX2pP9DebnBa7myhkI94xUDNnqdR/cytDWhkL+9UmewilVxkHF6qO7whj0J3oqci3 FlxW8RMAVP6zvxctmigv7pgpjMXvEgqHxCMTspQPiVS4rpQ+WdY0Es6PTSnkC2Z7afb9 66P9dHI8hfKRIbOesoQnOldRn8x2q65qKGsK0Op8XrIqyY8PMxKCjsLgcASyrMkN8Vf9 9S1EfwPop9tQiLA2cKFQklDHGgTfvSKuxVOeSQedW4csoPf9zI6sjxfPOsEQyivwrI8D TalFbmGQKBfKOvMAFUGHh1YcQ8ZAd0SU906fKrZm1XmIUHIsX9G41OphpSoMBr3WyI0Q 4f1w== X-Google-Smtp-Source: AB8JxZpzcrx3S8i3m6gJ1lG7zVGBhhvIC2fXt0gO+0yTa3yIzlym7R5O2a+QYl3CG6VZt+i7VQjucQ== X-Received: by 2002:ac8:4141:: with SMTP id e1-v6mr38357633qtm.324.1525829661030; Tue, 08 May 2018 18:34:21 -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 x28-v6sm23719003qtx.95.2018.05.08.18.34.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 18:34:20 -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: Tue, 8 May 2018 21:33:52 -0400 Message-Id: <20180509013358.16399-5-kent.overstreet@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509013358.16399-1-kent.overstreet@gmail.com> References: <20180509013358.16399-1-kent.overstreet@gmail.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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)