From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751972AbcBUSig (ORCPT ); Sun, 21 Feb 2016 13:38:36 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35569 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbcBUSif (ORCPT ); Sun, 21 Feb 2016 13:38:35 -0500 Subject: Re: [PATCH v1 0/4] block: fix bio_will_gap() To: Ming Lei , Jens Axboe , linux-kernel@vger.kernel.org References: <1455852022-14188-1-git-send-email-ming.lei@canonical.com> Cc: linux-block@vger.kernel.org, Christoph Hellwig , Kent Overstreet , Keith Busch , Elliott Robert From: Sagi Grimberg Message-ID: <56C9862C.70908@dev.mellanox.co.il> Date: Sun, 21 Feb 2016 11:41:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1455852022-14188-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi Guys, > > The bio passed to bio_will_gap() may be fast cloned from upper > layer(dm, md, bcache, fs, ...), or from bio splitting in block > core. Unfortunately bio_will_gap() just figures out the last > bvec via 'bi_io_vec[prev->bi_vcnt - 1]' directly, and this way > is obviously wrong in case of fast-cloned bio. > > It is observed that lots of BIOs are still merged even if > the virt boundary limit is violated by the merge, and the issue > was reported from Sagi Grimberg. > > This patch introduces two helpers for getting the first and last > bvec of one bio and applys them to fix the issue. Sagi tested > the last patchset and confirmed the fix. > > V1: > - get bvec directly for non-cloned bio > - implement bio_get_last_bvec() with single bio_advance_iter(), > and avoid to use bio_for_each_segment() which looks a bit inefficient > - avoid to double check queue_virt_boundary() in bio_will_gap() Thanks Ming, Jens, can this make the next 4.5-rc since this regression was detected in 4.5? Thanks, Sagi.