From patchwork Wed Jun 27 12:45:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10491357 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 E1641602B3 for ; Wed, 27 Jun 2018 12:46:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE8C828D7A for ; Wed, 27 Jun 2018 12:46:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C25E728D80; Wed, 27 Jun 2018 12:46:38 +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=-2.9 required=2.0 tests=BAYES_00, 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 29E1B28D7A for ; Wed, 27 Jun 2018 12:46:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 441AF6B026B; Wed, 27 Jun 2018 08:46:37 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3F1F26B026C; Wed, 27 Jun 2018 08:46:37 -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 2BB4F6B026D; Wed, 27 Jun 2018 08:46:37 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f198.google.com (mail-qt0-f198.google.com [209.85.216.198]) by kanga.kvack.org (Postfix) with ESMTP id F381C6B026B for ; Wed, 27 Jun 2018 08:46:36 -0400 (EDT) Received: by mail-qt0-f198.google.com with SMTP id i7-v6so1883645qtp.4 for ; Wed, 27 Jun 2018 05:46:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=X+hx6fj+Z+55qJs6hIp0wcJpXzqzJB5qm8vGewlIOOg=; b=nYw/XLsKJ42MCqsOhqIviaYfsMAhb8HXXJ0ZSpsVnNPKGhh+Nd4xsqLsSnR1DReFaE /S0vERRDAAg6YI3Aa3vkdDSqtmZRG6m4bBm9JvE/3XlL9tT4Xhlxhjsrwasu5oF2B3sZ BmXezNeoQI7yMHfQ6a0ixzdgocQl209a878yRm0mKRX4UH8EBwqtRMMSNebJow+HsAH2 3ZFJWxlpBVhgc1vw29IVg8dLo3cFGOYU6HklqqySJ+W+trgLPuoRSpq1hbB09fvvbSIi 0OcZg7t23A3KrNhXlNRoX9Jz308z7a0q/KoNDo/T3ijLsZkBA5/C8mI+f91h4qk/l4w1 VOvw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: APt69E1cQaHxyW2B1lWflvNZmDsYmPc+0C1G1KTlUC8qZfWMaZlqSEIV 8GAOCAQxA0qztLR5sbilmld1FoW6KronDVuS7Bji6pKchKm+tOovURFnWAyWdtvz8YSHPWbebfv LLoUVQhvld92Zo1uV9l0b3HMwWJt5S91UZbNtwG76DIQ3vkcWgJnfdWwEP2xR4KZxFg== X-Received: by 2002:ac8:4703:: with SMTP id f3-v6mr5261043qtp.176.1530103596804; Wed, 27 Jun 2018 05:46:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcEF2DCUhxINJh6jpHUX0evqbbSFMtFOheU+4CdyDICnaXija0DpvxVuacEV7Jjw39dtRYr X-Received: by 2002:ac8:4703:: with SMTP id f3-v6mr5261008qtp.176.1530103596219; Wed, 27 Jun 2018 05:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530103596; cv=none; d=google.com; s=arc-20160816; b=CRCOMrImhKi2E9Ql6vWFfE+Nxzb4cq6NDD2HO9TQlRHmIdOIWvt8wMDmGbgIl7G+Ri 0JWkjrINLeFf6ZnmS4H+jGyEc158hGyJjla29cqIX6ykZ7PKVYnId5TxfVFNUGsH2HiB hG70aG6uLmEmkZ1otYpiE8RdAlGKTTZ+BCHTlva0lgGzk7UkrTWAEjrcaRWIE4YEpkXI Tx1O1oThbYXdT/qeRBGonKuGU7p3OaVcYX6DSlyrRr5AjpNHYmKB0y/+qi36naYnz+Yh ftu5TrHESec7dV8gUu/QJmYWVnOkcoac2eaBgOYxuGnhTKOuCN3XdqNex+JJenU/z2HI 69vQ== 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 :arc-authentication-results; bh=X+hx6fj+Z+55qJs6hIp0wcJpXzqzJB5qm8vGewlIOOg=; b=jaMBAQJmKmbM3CY9cU/LxisVI76F4ruHeZ9YrNpyIrTSES5nnQ8M+te+1Unmqz2Ap5 t8cAl6KLUj16w166JXaka8QSrFkyUDrru8A9aTK+KGN0AFB+ecXJKhmf6iE4TDqHAUrd Rpmmq3zO7vhtO5Fi3TSqcsQABc2fThxIy5GyXWYWOG0vYbKzTBTJ0GzOWJGdWaZaeiHp iLljZ57P44DRW0UvDrpwvVVikezxEwK9Hnd/xuIMzRXXAaf/NlrVLX97AjSRCqeoG3tq 2wEe1W+wixd2R/4G04fnYJmhnmj3syHP8TDuAVXJNwGICGmdl/+Ky5fEid+dLS2A2Bjs KWJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id z124-v6si3980924qke.27.2018.06.27.05.46.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 05:46:36 -0700 (PDT) Received-SPF: pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D0133401EF04; Wed, 27 Jun 2018 12:46:35 +0000 (UTC) Received: from localhost (ovpn-12-44.pek2.redhat.com [10.72.12.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8B2D2156888; Wed, 27 Jun 2018 12:46:27 +0000 (UTC) From: Ming Lei To: Jens Axboe , Christoph Hellwig , Kent Overstreet Cc: David Sterba , Huang Ying , Mike Snitzer , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , "Darrick J . Wong" , Coly Li , Filipe Manana , Randy Dunlap , Christoph Hellwig Subject: [PATCH V7 03/24] exofs: use bio_clone_fast in _write_mirror Date: Wed, 27 Jun 2018 20:45:27 +0800 Message-Id: <20180627124548.3456-4-ming.lei@redhat.com> In-Reply-To: <20180627124548.3456-1-ming.lei@redhat.com> References: <20180627124548.3456-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 27 Jun 2018 12:46:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 27 Jun 2018 12:46:35 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' 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 From: Christoph Hellwig The mirroring code never changes the bio data or biovecs. This means we can reuse the biovec allocation easily instead of duplicating it. Acked-by: Boaz Harrosh Reviewed-by: Ming Lei Signed-off-by: Christoph Hellwig --- fs/exofs/ore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c index 1b8b44637e70..5331a15a61f1 100644 --- a/fs/exofs/ore.c +++ b/fs/exofs/ore.c @@ -873,8 +873,8 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp) struct bio *bio; if (per_dev != master_dev) { - bio = bio_clone_kmalloc(master_dev->bio, - GFP_KERNEL); + bio = bio_clone_fast(master_dev->bio, + GFP_KERNEL, NULL); if (unlikely(!bio)) { ORE_DBGMSG( "Failed to allocate BIO size=%u\n",