From patchwork Thu Oct 18 21:24:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10648289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D16FC14E2 for ; Thu, 18 Oct 2018 21:24:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C20B428D50 for ; Thu, 18 Oct 2018 21:24:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5F2728D58; Thu, 18 Oct 2018 21:24:51 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 3025F28D53 for ; Thu, 18 Oct 2018 21:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbeJSF1o (ORCPT ); Fri, 19 Oct 2018 01:27:44 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:55628 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725735AbeJSF1o (ORCPT ); Fri, 19 Oct 2018 01:27:44 -0400 Received: by mail-it1-f194.google.com with SMTP id c23-v6so2090221itd.5 for ; Thu, 18 Oct 2018 14:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=0B9mEC0wI9+MU3qDtK1iKJkm1DOreRH4iod2Q5FEym8=; b=fLA8cg9KApyJUI1YIT0P3qk+pZJuXq06YQDw+W1h7LWNmTAnDufkzF3DRiQlmsp6am 3k/n6crZ3nerOO+5p5lq8sDf868R6iStf3DezX0wP8d7y7CaVMUg1tEsxRg18kMfpD36 baogqpcSN2/xPLlMIgwYEzSwMQFGk5wfSF236GkaaaTVK7it0rnyFp6C2+9T+qYuRk6r uENIIq6qJOBNn85ITY9U4Bsiva6d3SdOfsANngUZPO/Qff49NwvZO6kLtCRQUABruFsJ tTg2XMjerrqI+dkwjK4x268ByMjlhS9MKzAssttWpEB8Pb/IbSruOtPqTLTz/Ynywux1 pO1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=0B9mEC0wI9+MU3qDtK1iKJkm1DOreRH4iod2Q5FEym8=; b=DAFQ9aLCusBp/2OvrHDiu5o3NgbyjJCl0bgrvMhdl4u7lsL1itCW1C/7/SCAwrMXbt YKuQ1QhTaLq8CYPwoPVA6HG5uDmFGk94ei8RIvZDfbJz6kfttbDQE3TzoONqGjy8sjHz 6DL87+jPL4hRYDkMTKwelNW9LfKZb0IbUtHIY7ISYVoRxEjVK4vgfwlvsJ7C+10auVgn cD97FLg5qjfGV4axNg8/E5kXNyty4ppX/MoTf4hLn8WeEtriXXUJX4vPS80Dwc8859fT FnvQZA9ROYh8U08j/XG4DQM5oSssPFrnIHMmZsisljZ+zQCZQs4hkhMRbjuWYmHshB8X IarQ== X-Gm-Message-State: ABuFfohLNSSDqC61OMVIJnh3kPSbTjSYx5G8TinjrIVSl2Ua0U2NxFpW /Y3nhRhmbZX1xtHQSyivJa0oh6bk2L0= X-Google-Smtp-Source: ACcGV61asSoQ0D1QKPXIGpe3izUpIHIUnEo3dh0rjb13fqWBXUP5kuov0I/EW8v1lDOFfq9Hr9Jn9g== X-Received: by 2002:a05:660c:706:: with SMTP id l6mr1588265itk.21.1539897889592; Thu, 18 Oct 2018 14:24:49 -0700 (PDT) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id g73-v6sm1232247itg.37.2018.10.18.14.24.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 14:24:48 -0700 (PDT) To: "linux-block@vger.kernel.org" Cc: Ondrej Zary From: Jens Axboe Subject: [PATCH] block: setup bounce bio_sets properly Message-ID: <34e24d47-12e4-230c-4088-1d3f2ffa6b79@kernel.dk> Date: Thu, 18 Oct 2018 15:24:47 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Language: en-US 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 We're only setting up the bounce bio sets if we happen to need bouncing for regular HIGHMEM, not if we only need it for ISA devices. Reported-by: Ondrej Zary Tested-by: Ondrej Zary Signed-off-by: Jens Axboe diff --git a/block/bounce.c b/block/bounce.c index b30071ac4ec6..1356a2f4aae2 100644 --- a/block/bounce.c +++ b/block/bounce.c @@ -31,6 +31,24 @@ static struct bio_set bounce_bio_set, bounce_bio_split; static mempool_t page_pool, isa_page_pool; +static void init_bounce_bioset(void) +{ + static bool bounce_bs_setup; + int ret; + + if (bounce_bs_setup) + return; + + ret = bioset_init(&bounce_bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); + BUG_ON(ret); + if (bioset_integrity_create(&bounce_bio_set, BIO_POOL_SIZE)) + BUG_ON(1); + + ret = bioset_init(&bounce_bio_split, BIO_POOL_SIZE, 0, 0); + BUG_ON(ret); + bounce_bs_setup = true; +} + #if defined(CONFIG_HIGHMEM) static __init int init_emergency_pool(void) { @@ -44,14 +62,7 @@ static __init int init_emergency_pool(void) BUG_ON(ret); pr_info("pool size: %d pages\n", POOL_SIZE); - ret = bioset_init(&bounce_bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS); - BUG_ON(ret); - if (bioset_integrity_create(&bounce_bio_set, BIO_POOL_SIZE)) - BUG_ON(1); - - ret = bioset_init(&bounce_bio_split, BIO_POOL_SIZE, 0, 0); - BUG_ON(ret); - + init_bounce_bioset(); return 0; } @@ -102,6 +113,7 @@ int init_emergency_isa_pool(void) BUG_ON(ret); pr_info("isa pool size: %d pages\n", ISA_POOL_SIZE); + init_bounce_bioset(); return 0; }