Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2128425ybl; Sat, 14 Dec 2019 06:32:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxfbVnRYlwHzNWOjO4TDFOo9PJPq9hDhxBFD1CGxbSSc4UluoIKRAQNZYoLcsGp/u5ttuQB X-Received: by 2002:a05:6830:2142:: with SMTP id r2mr21668252otd.334.1576333927819; Sat, 14 Dec 2019 06:32:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576333927; cv=none; d=google.com; s=arc-20160816; b=FGxmJW2sp6SeOjxttNpX6bRC6UOwDaPb8OTx0OFhc1LWyIvPCRp0tAP8hgserpjTZV zhiViHZ6orqgeBD7GzanSMrKZSTAcqp/WEtfQoh8xCAO7P+lUO5742ZhS/t7GD5+Ocwr QIS7Tjr+zrMViSYyXRpPpnHZDbPamwOyESKrXjrRSwcA04kffUf8dw7KOxb5M0iuSfTv GX9kRs3TGCDvR8XGkEBXIwYZQSgAJ8jrvaGt9pSk21r//tQOVDOTSl2iyWJf1NI6eUML tW8pBjPQDSqGZd5o3ZO1ETWnxemXzHBCjaNaLvckIJrE8lzP2kr2thwsZz/KrdM+8Fod 0uYQ== 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; bh=cqCj1ZKAy8qAGC4siED741TFPKgnxrkYwpoB9H0Yu2I=; b=HdCkrhO8JLiiCrqgUjSDZKzu6DirW496raSbq/by0paermzqExSvCi6GBWxb7MIQP0 HqUFbBX5wamT7wtVWAL+7mVAaYVClZGGKHLl+EDCrjDwTIAZI9VgRXONRpRBFgJnW7yW KiWrN+FsFRmoLWEwkL0SPx0ub7Y8dAtJxfXVKbbuOh8Zr6UyBpVwoWP7oxJjUpS5VCcL Nia22cXDG9oOahlKEreCuevp9uOtZIe4Orj+bAO6aCDWckt5m4uDKraDgpblhz0ggNLi gIAWK0rWZ2c6h/WCKjxzJgKXqYcJiiyVOkCv/E62XIwXzfNkIYt10SgmnPq5FpG3IkBW bGEA== ARC-Authentication-Results: i=1; mx.google.com; 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 d68si7027355oib.194.2019.12.14.06.31.21; Sat, 14 Dec 2019 06:32:07 -0800 (PST) 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; 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 S1726103AbfLNOXs (ORCPT + 99 others); Sat, 14 Dec 2019 09:23:48 -0500 Received: from mail1.ugh.no ([178.79.162.34]:46762 "EHLO mail1.ugh.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbfLNOXr (ORCPT ); Sat, 14 Dec 2019 09:23:47 -0500 X-Greylist: delayed 586 seconds by postgrey-1.27 at vger.kernel.org; Sat, 14 Dec 2019 09:23:47 EST Received: from localhost (localhost [127.0.0.1]) by mail1.ugh.no (Postfix) with ESMTP id 3659C24E2B6; Sat, 14 Dec 2019 15:13:59 +0100 (CET) Received: from mail1.ugh.no ([127.0.0.1]) by localhost (catastrophix.ugh.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5pqLAV_NdfjM; Sat, 14 Dec 2019 15:13:58 +0100 (CET) Received: from [10.255.64.11] (unknown [185.176.245.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: andre@tomt.net) by mail.ugh.no (Postfix) with ESMTPSA id 7912724E282; Sat, 14 Dec 2019 15:13:58 +0100 (CET) Subject: Re: [PATCH 4.19 153/306] block: fix the DISCARD request merge (4.19.87+ crash) To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Christoph Hellwig , Ming Lei , Jianchao Wang , Jens Axboe , Sasha Levin References: <20191127203114.766709977@linuxfoundation.org> <20191127203126.845809286@linuxfoundation.org> From: Andre Tomt Message-ID: Date: Sat, 14 Dec 2019 15:13:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191127203126.845809286@linuxfoundation.org> Content-Type: text/plain; charset=utf-8; format=flowed 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 27.11.2019 21:30, Greg Kroah-Hartman wrote: > From: Jianchao Wang > > [ Upstream commit 69840466086d2248898020a08dda52732686c4e6 ] > > 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. > > Reviewed-by: Christoph Hellwig > Reviewed-by: Ming Lei > Signed-off-by: Jianchao Wang > Signed-off-by: Jens Axboe > Signed-off-by: Sasha Levin 4.19.87, 4.19.88, 4.19.89 all lock up frequently on some of my systems. The same systems run 5.4.3 fine, so the newer trees are probably OK. Reverting this commit on top of 4.19.87 makes everything stable. To trigger it all I have to do is re-rsyncing a directory tree with some changed files churn, it will usually crash in 10 to 30 minutes. The systems crashing has ext4 filesystem on a two ssd md raid1 mounted with the mount option discard. If mounting it without discard, the crashes no longer seem to occur. No oops/panic made it to the ipmi console. I suspect the console is just misbehaving and it didnt really livelock. At one point one line of the crash made it to the console (kernel BUG at block/blk-core.c:1776), and it was enough to pinpoint this commit. Note that the line number might be off, as I was attempting a bisect at the time. This commit also made it to 4.14.x, but I have not tested it.