From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753762AbbJSPqV (ORCPT ); Mon, 19 Oct 2015 11:46:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55592 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752827AbbJSPqU (ORCPT ); Mon, 19 Oct 2015 11:46:20 -0400 From: Jeff Moyer To: Ming Lei Cc: Jens Axboe , Linux Kernel Mailing List , Ming Lin , Kent Overstreet , Christoph Hellwig Subject: Re: [PATCH v1 4/6] block: check bio_mergeable() early before merging References: <1445097154-18229-1-git-send-email-ming.lei@canonical.com> <1445097154-18229-5-git-send-email-ming.lei@canonical.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Mon, 19 Oct 2015 11:46:18 -0400 In-Reply-To: (Ming Lei's message of "Mon, 19 Oct 2015 23:32:01 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ming Lei writes: > On Mon, Oct 19, 2015 at 11:27 PM, Jeff Moyer wrote: >> Ming Lei writes: >> >>> After bio splitting is introduced, one bio can be splitted >>> and it is marked as NOMERGE because it is too fat to be merged, >>> so check bio_mergeable() earlier to avoid to try to merge it >>> unnecessarily. >>> >>> Signed-off-by: Ming Lei >> >> Reviewed-by: Jeff Moyer >> >> Ming, do you think we should also add a check in blk_attempt_plug_merge? > > No, because 'request_count' need to be figured out for automatic flush plug. Interesting. See my follow-up to patch 5. :) -Jeff > > Thanks, > >> >> -Jeff >> >>> --- >>> block/elevator.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/block/elevator.c b/block/elevator.c >>> index 84d6394..c3555c9 100644 >>> --- a/block/elevator.c >>> +++ b/block/elevator.c >>> @@ -420,7 +420,7 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio) >>> * noxmerges: Only simple one-hit cache try >>> * merges: All merge tries attempted >>> */ >>> - if (blk_queue_nomerges(q)) >>> + if (blk_queue_nomerges(q) || !bio_mergeable(bio)) >>> return ELEVATOR_NO_MERGE; >>> >>> /* >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> Please read the FAQ at http://www.tux.org/lkml/