Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3539877imd; Mon, 29 Oct 2018 08:36:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5csX0OILP0jLdjEB5PfYNIZi8+6DbIfh173aE911T6/cDFb+wogLSBzh6K+K3lbEYM0cbUF X-Received: by 2002:a17:902:544:: with SMTP id 62-v6mr2913268plf.73.1540827366662; Mon, 29 Oct 2018 08:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540827366; cv=none; d=google.com; s=arc-20160816; b=xxPvwLI73BFM+jIBpSMEtPBeh7hSDZbOdIP2VfA0pp9I/e0Fdm4J+lPHcgRQFcc5/v DJO/C9xTUkQ9D5AePk0W2dDbnU5/WO97jtIFgRJGFb0o/dgFL9z9oJH2fGduWWo/IP9R VX2Ee1LmhA6DsdidUggp6NmhJP/GlgzIU1IHoz2/jTbqNieMClM9bL6o65X8Kfduf2Br fxPUFxJt8HrcAgoCb1YniCl/QG3cb4D3Hs6KdAmNyxB8Lu9tcaXmSeqhldXysa9lJJD6 xpbr8OEaoXBs/IjKjcsCGM7DZsJeEYHVAiz4Prk4zqOq36GrCBrz7cCb/oT4IjEAT2mo gN7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=dfGgbrC4b0WyXjkop9aK6GQ7n5vgXjd3j09BRRY1IcM=; b=q6Muu2IsJIdgAJd0KjCteFepmn4VSmtFytnMaNylSGzvvQzxPohdg8UgEyx7rQpcY+ hjQRGGAOhvs009RcCNN3iRYsUA26Pyn2dwtbM+qlhOBjtr4uDmhw99sBNg0xchjZqKRk 5d9yM3h45HlXw6xzf/Ris+Zo8On4TbJW9W6uN8JHFlUmQCiZROk35KbunTYjE/9qAqQI O1s7f/1hT1DjApJaE5vfi67HsWLWgXiVW1P3a8v0Tzu3HOrgRkK+hFdz48CFBzCEslkS uUlr8IiKQ+6SK1QCYRMA6/3IEfBuz6nyu+JmMF5QyIwKuLqaGJplZq0O6ZRiN6vVJPnp zN2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=SkD4CyF6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7-v6si21518990pgb.466.2018.10.29.08.35.44; Mon, 29 Oct 2018 08:36:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=SkD4CyF6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727583AbeJ3AW3 (ORCPT + 99 others); Mon, 29 Oct 2018 20:22:29 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:38985 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727456AbeJ3AW3 (ORCPT ); Mon, 29 Oct 2018 20:22:29 -0400 Received: by mail-io1-f65.google.com with SMTP id n11-v6so5217997iob.6 for ; Mon, 29 Oct 2018 08:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dfGgbrC4b0WyXjkop9aK6GQ7n5vgXjd3j09BRRY1IcM=; b=SkD4CyF65IGCUEobBzvE2g2TCuhbh5mOOtYDpo2lg/rAgA95brGcL/CXi1JC6rlFlJ CL1tctOwxzoFjoPJwjWvfzaSbU2lF5hMRu+hR82TC5LZjLJ/e7iT90idJzU6wsLuSHWO P4FVqCfEdYzhbnDaU82O6mvxB/6mxtekAj66mcaDqPBJfVca0AF9WXXXH0yE1xJgmLz+ FYcbwBv2uv6b4u64Me1q8ZQRqIwlu1vfOsMWyyfcXMKzeDVVimJy+ntSSOvoOgdY+6v+ lX/PV76SMYw8Qw/rcEAWJLw6U6EHysO6wdVtS5UAVmOJYRf6Cc1XK+9/xqyAhUyJ8Jg6 gANQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dfGgbrC4b0WyXjkop9aK6GQ7n5vgXjd3j09BRRY1IcM=; b=GeGjNsxdkkDSy3/Zn54S2PtjdahqMCGsdmlB/o+wOCbo8c1GzxBd9LtACrrfktJ18Y 3Nik2xT1EXp5sYbX7hhNB0Pj7PBbDkuFwU6uptXszA13V9KA5bo/slFjhXHFLiuEO292 VD3GhQ3oSsCeEjcGvWjva/2XPujG9GK02S2r8QjYL31pooGRxThLa6syWVqblXyIOqmG WTM90MCgCG1UHqb06MGx5doEDhYWHk0Qm+qxbc4PcilFvEZRN+iDa+X7RVUOTrVwL6Cl I4Bc5BMnlfh4EeLGbnCVyrSmaWTcc88/DsMd32IHyDZowJx1XZ6wmAr0mZY9vVyjE4iO D1+Q== X-Gm-Message-State: AGRZ1gI+EkbpiCpncAEj2EDnR60KZsPk9BTGON+Zrs5VDu2x9U8zQ7qj WEiinOimQcgE/dN4tkFCGCVDOJfJftY= X-Received: by 2002:a6b:1506:: with SMTP id 6-v6mr7895104iov.50.1540827201588; Mon, 29 Oct 2018 08:33:21 -0700 (PDT) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id n202-v6sm1891252itn.34.2018.10.29.08.33.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 08:33:20 -0700 (PDT) Subject: Re: [PATCH V5] block: fix the DISCARD request merge To: Jianchao Wang Cc: martin.petersen@oracle.com, tom.leiming@gmail.com, hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1540641134-21485-1-git-send-email-jianchao.w.wang@oracle.com> From: Jens Axboe Message-ID: <610adbc6-24ba-e6ed-a98a-f3faeef8bd51@kernel.dk> Date: Mon, 29 Oct 2018 09:33:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1540641134-21485-1-git-send-email-jianchao.w.wang@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/27/18 5:52 AM, Jianchao Wang wrote: > There are two cases when handle DISCARD merge. > If max_discard_segments == 1, the bios/requests need to be contiguous > to merge. If max_discard_segments > 1, it takes every bio as a range > and different range needn't to be contiguous. > > But now, attempt_merge screws this up. It always consider contiguity > for DISCARD for the case max_discard_segments > 1 and cannot merge > contiguous DISCARD for the case max_discard_segments == 1, because > rq_attempt_discard_merge always returns false in this case. > This patch fixes both of the two cases above. Applied, thanks. -- Jens Axboe