From patchwork Fri May 18 07:49:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 10408375 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 0A5FB601F9 for ; Fri, 18 May 2018 07:50:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEA232887D for ; Fri, 18 May 2018 07:50:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0AFD28899; Fri, 18 May 2018 07:50:03 +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 6BADA2887D for ; Fri, 18 May 2018 07:50:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A29056B058A; Fri, 18 May 2018 03:50:01 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9D6AB6B058B; Fri, 18 May 2018 03:50:01 -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 89EA26B058C; Fri, 18 May 2018 03:50:01 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f198.google.com (mail-qk0-f198.google.com [209.85.220.198]) by kanga.kvack.org (Postfix) with ESMTP id 5BE576B058A for ; Fri, 18 May 2018 03:50:01 -0400 (EDT) Received: by mail-qk0-f198.google.com with SMTP id a125-v6so6245554qkd.4 for ; Fri, 18 May 2018 00:50:01 -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=ZVY+a62hZeKbQF3AR9V9qdYnX3kO+P70JylMVWS1We4GxTZcHeZBwLLYnwHmhwmBuj JSjjaRicVK6TKgK/36jGzbJRvUVRb98lrqkyPkY+werGNUta4oF9P7gwUAKFsoEFGRtX CcX/Sn4JDsMLOWWSrKVQhjdDyiDgEXIjIn3dev+l7JZlcSP6A1NRjF/heYxPYAXhQcFE ABRWYaU7xzDXuRcYZxhuJZIkhaH+03xmCysVowTUZNMr0vb/AAdEg9E2LbxezLhkGDEz r8g2MXNV8zSU1XRgNHgFrcJqOEVvlrnhyQbRl0s6UN0cjYUveN5jmsuaYPy7e+DiQsIl Y4HA== X-Gm-Message-State: ALKqPwfosq9mpuEEGFAAh+VoN3QWBxPIq3McN3SoDgXAcYCM9uJgWLB7 IbFnN8rwVc+srSR87bSQonJOj+p5M5xFkQDu4UsJF2LJVkcUkqSgNSFWHJYn8DGWG1gsalYIc3x 1odkgnGeE4/V/kHByvUQhb8vqTqEwSPCTZWZaUv4QNPc5huly+0Or/L10beIWyAm/zYSPk2jCFU a8hb4ec0WV/zHdMscckst4BoXUzf36HBfHmUfe7LTJfsbBjPCRbSgXA6FljgD+4P+DnPHj0x6Zg TPCvyjZLI9V9CdyH4NBmkGDWXdGUjzEODULgT8KxOJ9B4LbjPLUhPn/IJQH20sNAA5qt0OZjzJZ g4se053T2BJC65ucH5dxUYYtCKctjMBYGnnLy1eWvBHcktPlDyVk9F7flIRxNv4nl7cY6U7qbvB m X-Received: by 2002:aed:3dcb:: with SMTP id j11-v6mr7835010qtf.404.1526629801182; Fri, 18 May 2018 00:50:01 -0700 (PDT) X-Received: by 2002:aed:3dcb:: with SMTP id j11-v6mr7834999qtf.404.1526629800670; Fri, 18 May 2018 00:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526629800; cv=none; d=google.com; s=arc-20160816; b=zS/wXfERiJ3dtA9rJp+q0d0qgLyrohZBcdjc/hiaCBoMhTBT5PAlfEOIOkR5i0C668 gZ00ODtKyyuEpE570OtQLEmc/EepsQDMB3OCQiUZoYnDPdI5pV9PhkDZMRRDuRAbOBUT 0D5GaYSz1Nq4Tnq96VTCYfB8Dl5qpY9vc0hfnznmJoe/L6PdMpuWhlwln1roBrYYRCdl 2GuUb/8bGlQql45L65vLTNQa0YOp0hS7t+BtOf6ko4wDvmJeFkepxzgcmetPLZTILgti 9Kwk394KVXmMq9CRwHeyYNnpRWmMTmM1geq/JhvkaC37oAkoQPZO7EOfG0OPy+XhRROV OfVw== 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=JpZ099CyYRUwKd5ZOmy89NrGkar+llKIeogrei2wXuOSe/+gkpeiuc10vvTrqXdyou Om3HLPz1/ctFbfZZkgcFt91PB1ebeefHHAi3sJBH2Fphp4o7+C5au/uSFekhu0fKk7ST Mjts0Uy5d8/hipOQ7/9eM0GMS1H8EWU67k3LSRi5Upre/dtJv+1f2sJUviHAaxTfZ+Ev Yz2/PY5qowCATCh8g2fyMc6cxkYQNc7/8F0BhCB6Q/7qTK5GLFAQGWL3WCm8U9JgdcS5 gcu1EzeT4ugcEg9NFLQId5PaRi3tc5Q6pXhj3ZHmvLFrqIGSs0mjlWK1AlcFqc0A+WAW 1xLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YQ8yPA75; 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 e16-v6sor5700485qtk.102.2018.05.18.00.50.00 for (Google Transport Security); Fri, 18 May 2018 00:50:00 -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=YQ8yPA75; 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=YQ8yPA757yu/xkQHFGUQRY4886a0QN9u0Ro+aeT97p6jbqxprmv5UboZLoVn9rdLgL SLg0pPNsamq6gUWgDULqsX7jEyvi4IMGBF7ZPwvTRQGBlcAe6S1s91DhQ5q8rYIrUUnr ll2++btFencHtwFfwsMKB9wrJFr8qBtM3Ogwsivs+LuqIIbriVB/vSyzdzr3ip9WEi4W nUC+YTNIP3tIEg7mExvm2A+4AOsiS70zJiMGSMAQdSLuSuy54DLzkjwTLXTZ8qcf9ijy QMqEuD4I9mYcTBSi67lNO7DHldUy8YhtOw/pWrYL8HrHUOLMa6JozXYV+WHBeE7Q2KyF xRxw== X-Google-Smtp-Source: AB8JxZpEd+UXIW6vItkMQ9XmQB3pk5Vr4Q0OEExw1U5f9yHn+eW+QQBDAv7SiPtH+NB/KSPAeqweLg== 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> 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)