From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6B82CA9EC5 for ; Wed, 30 Oct 2019 13:54:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DD012087E for ; Wed, 30 Oct 2019 13:54:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FdHA0ymc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbfJ3Ny1 (ORCPT ); Wed, 30 Oct 2019 09:54:27 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41520 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726284AbfJ3Ny1 (ORCPT ); Wed, 30 Oct 2019 09:54:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Utihgzs6H+LFi2n+mj7RWlsvBJPK1GO6rym7XoHXdXE=; b=FdHA0ymcBQE/5UwLEdX15pSF1M 9j/JS2kVvK1xTC8JeIq4iJoKeVyPD1CHLF0vJLJcs9RgeLsQO/L8YpfgHTo9xtK8Rp34BkV0L41eo EI18VlQt9JZHN0nHfdc2kEj0aZ/mt68246qsHVV4zArzZm6HjOKPxMku6hhNUQHf9KdNg7QB4cs/1 9Cki42lehQKKIe7svw4sW2QUK4hFwfDBKZWVQStnOVO0JPfr1BTW5xb/jUbtoy+bzSeicDwBJGBWJ vNzN2YtWYbmf4weoKv9u55N7UF2UTMnkw37VgJWmUnq9q4wic6blfmV/KDrxqVEmEu7R2jQ0ywuli AYMb3FDg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPoQc-0006Y0-1R; Wed, 30 Oct 2019 13:54:26 +0000 Date: Wed, 30 Oct 2019 06:54:26 -0700 From: Christoph Hellwig To: Ming Lei Cc: Christoph Hellwig , Jens Axboe , linux-block@vger.kernel.org, Coly Li , Keith Busch , linux-bcache@vger.kernel.org Subject: Re: [PATCH V3] block: optimize for small block size IO Message-ID: <20191030135426.GA24655@infradead.org> References: <20191029105125.12928-1-ming.lei@redhat.com> <20191029110425.GA4382@infradead.org> <20191030002126.GA14423@ming.t460p> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191030002126.GA14423@ming.t460p> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Wed, Oct 30, 2019 at 08:21:26AM +0800, Ming Lei wrote: > > + if ((*bio)->bi_vcnt == 1 && > > + (*bio)->bi_io_vec[0].bv_len <= PAGE_SIZE) { > > + *nr_segs = 1; > > + return; > > + } > > split = blk_bio_segment_split(q, *bio, &q->bio_split, nr_segs); > > break; > > } > > This bio(*bio) may be a fast-cloned bio from somewhere(DM, MD, ...), so the above > check can't work sometime. Please explain how it doesn't work. In the worse case it will give us a false negastive, that is we don't take the fast path when in theory we could, but then again fast cloneѕ bios will have so much overhead that it should not matter.