From patchwork Mon Apr 25 23:52:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaohua Li X-Patchwork-Id: 8933581 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C25D69F441 for ; Mon, 25 Apr 2016 23:53:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0196420107 for ; Mon, 25 Apr 2016 23:53:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CC1A200E1 for ; Mon, 25 Apr 2016 23:53:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752454AbcDYXwn (ORCPT ); Mon, 25 Apr 2016 19:52:43 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:59049 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752118AbcDYXwm (ORCPT ); Mon, 25 Apr 2016 19:52:42 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u3PNq8g6006329 for ; Mon, 25 Apr 2016 16:52:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=XDCOb8XUoSSo6m1io3xpYDL2JvhB83kt3Rxjls+TiHg=; b=ATVlxnLagL4sToUNi1FH3bCeUKzklsyFy3pr+Nkz/fdmcnO5I7mx8F6uscXHpCcc+06M utFszJ4hM5vQdJdMyiZdM9W/cSuUBXM42Hc6cy3QiJvV2RGqgsZHF3b4OT0ROzKGT697 Z2xcukvUvUWne5Wv8DP78tJrVUmoTgOzfNw= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 22htg7s4dv-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 25 Apr 2016 16:52:41 -0700 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB07.TheFacebook.com (192.168.16.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 25 Apr 2016 16:52:40 -0700 Received: from facebook.com (2401:db00:11:d0a2:face:0:39:0) by mx-out.facebook.com (10.212.236.89) with ESMTP id cb3fa0a80b4011e689ec0002c95209d8-83dfc50 for ; Mon, 25 Apr 2016 16:52:40 -0700 Received: by devbig084.prn1.facebook.com (Postfix, from userid 11222) id F1D664AA0D36; Mon, 25 Apr 2016 16:52:38 -0700 (PDT) From: Shaohua Li To: , , CC: , , "v4.3+" , Ming Lei , Jens Axboe , Neil Brown Subject: [PATCH] MD: make bio mergeable Date: Mon, 25 Apr 2016 16:52:38 -0700 Message-ID: <384a0e0c7d6f2700aadbcbdef003cece88fa7dd7.1461626533.git.shli@fb.com> X-Mailer: git-send-email 2.8.0.rc2 X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-04-25_12:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP blk_queue_split marks bio unmergeable, which makes sense for normal bio. But if dispatching the bio to underlayer disk, the blk_queue_split checks are invalid, hence it's possible the bio becomes mergeable. In the reported bug, this bug causes trim against raid0 performance slash https://bugzilla.kernel.org/show_bug.cgi?id=117051 Reported-by: Park Ju Hyung Fixes: 6ac45aeb6bca(block: avoid to merge splitted bio) Cc: stable@vger.kernel.org (v4.3+) Cc: Ming Lei Cc: Jens Axboe Cc: Neil Brown Signed-off-by: Shaohua Li --- drivers/md/md.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/md.c b/drivers/md/md.c index 194580f..14d3b37 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -284,6 +284,8 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio) * go away inside make_request */ sectors = bio_sectors(bio); + /* bio could be mergeable after passing to underlayer */ + bio->bi_rw &= ~REQ_NOMERGE; mddev->pers->make_request(mddev, bio); cpu = part_stat_lock();