From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 693D5C4167B for ; Thu, 2 Nov 2023 09:29:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D63B28001B; Thu, 2 Nov 2023 05:29:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D13DD8D0026; Thu, 2 Nov 2023 05:29:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C02F28001B; Thu, 2 Nov 2023 05:29:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id AFBFF8D0026 for ; Thu, 2 Nov 2023 05:29:04 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 722DA40789 for ; Thu, 2 Nov 2023 09:29:04 +0000 (UTC) X-FDA: 81412490208.03.446418A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 89FFD18001F for ; Thu, 2 Nov 2023 09:29:02 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ynm2KXsL; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf24.hostedemail.com: domain of mpatocka@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mpatocka@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698917342; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=X1JjT78ESQHu9+RVUysRtBfcjHinR8ppQOAAQBOcIyM=; b=Kg0w6i5QhgbOMZEXEjNgzYGk8IuDdMBphbREKujgdcDZwlnlalQWYb4cVU06ghj7QhH6DG g35hi7khAXvoy5OZ+Y58Y4kYMvLKpRWM92EL/UuAVEN9ec945WiQC38CztPEa7O/uyvnKw q8KS/xNxSJD5oro34P217jQa278hoN8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ynm2KXsL; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf24.hostedemail.com: domain of mpatocka@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mpatocka@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698917342; a=rsa-sha256; cv=none; b=WqB91NtTBYBiBYL7WlcMz9tTClRenmH6cqBlkSGckcixHWUErre1vExK/QC2vTMODAaV0j /k7CejYALItfWM18Lz6f9Gyl+JZBQFbUDESMlPoqRPDoBfbD/PU6vN59DjFuY1YGy32NUT il7iQG3nAh9E9AGSVEk9KVoFX96LOB4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698917341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X1JjT78ESQHu9+RVUysRtBfcjHinR8ppQOAAQBOcIyM=; b=Ynm2KXsLX2MZM6AVhTI29iXWdy009+lYdSeFLVU5YGJPmQFJMpb5lQCIghsJItx9nh3ZSb aT7BrtjTkWXTJDAlzbpbb0fmFrGy/heFSHoXVqzHhsXAl9iqa8tz7u+j/whhMzMnn4D6J8 jgsvMouZyJZAZp4dQuTXIO7JermjsRY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-156-UaLZFHJ7PIu_aYZZTZ7-Iw-1; Thu, 02 Nov 2023 05:28:58 -0400 X-MC-Unique: UaLZFHJ7PIu_aYZZTZ7-Iw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8F89E810FC0; Thu, 2 Nov 2023 09:28:57 +0000 (UTC) Received: from file1-rdu.file-001.prod.rdu2.dc.redhat.com (unknown [10.11.5.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77264502B; Thu, 2 Nov 2023 09:28:57 +0000 (UTC) Received: by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix, from userid 12668) id 6304D30C72B0; Thu, 2 Nov 2023 09:28:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix) with ESMTP id 5E29F3FD16; Thu, 2 Nov 2023 10:28:57 +0100 (CET) Date: Thu, 2 Nov 2023 10:28:57 +0100 (CET) From: Mikulas Patocka To: =?ISO-8859-15?Q?Marek_Marczykowski-G=F3recki?= , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg cc: Jan Kara , Vlastimil Babka , Andrew Morton , Matthew Wilcox , Michal Hocko , stable@vger.kernel.org, regressions@lists.linux.dev, Alasdair Kergon , Mike Snitzer , dm-devel@lists.linux.dev, linux-mm@kvack.org Subject: Re: Intermittent storage (dm-crypt?) freeze - regression 6.4->6.5 In-Reply-To: Message-ID: References: <20231030155603.k3kejytq2e4vnp7z@quack3> <98aefaa9-1ac-a0e4-fb9a-89ded456750@redhat.com> <20231031140136.25bio5wajc5pmdtl@quack3> <8a35cdea-3a1a-e859-1f7c-55d1c864a48@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="185210117-2130454234-1698916941=:474267" Content-ID: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Rspamd-Queue-Id: 89FFD18001F X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: hnnfpzi9c4b5epoije5ei1pizhqug14o X-HE-Tag: 1698917342-419021 X-HE-Meta: U2FsdGVkX1+JtAfKmK3vBinwRWMGVjMjR/0tp6xPsfAM74E+/4czWwRQV75mBbGG16Z6BvxBmMh0O49mnPgidSVX+tbKKrww2gLqdiDi4DEscrO4tVX+g8jHxesoVSUWNxq3duigIXswMGSGkKKE8JtS5LNN5tHa8j/eSOv9SC8B4lVD4ZnaDnWTT397bCbF4STH6pzqI5qqc2nZKIh8/RLufsNg2rJKyxK01WYEncXq7nF4AUl3cKoJLxsgdT4HEmz9Xmq+DLURzPBUYmBHbbKInb9BdsIfFzbL+7IoFNesfKhW2Zv/5vssYQk2ydhy2BDxI5ArJwQ+KHIJqK/0wum81EFrcQI01RAkYOk/Uw0eKAfL68JaR1SNgeISPG883mAFMoUudT/uYDwQ5bh3wAlS5TtZ+IRwFZYT75a7En4VCz1JgYOyXw8sVtoIEQJ1z8ytm0nxQUM6pycHV/LQcPIfNwtJ+WOZb66IcWSGyU79bEA4bm25E2cvphP6VQBpyC21R6NZ1L0NNQZtOiBGoTt77jxdp0vfRgqM5UYO+VdCXGREIkJhGY9Wj7NdB770w+90hxcd7utn4d31jakaGsWLKAyIQdWAMqlpBirw+ELju+WwKRsZPAn3sQ/Eod8Xdczv0F+fjJf/GTZP/4yA3bGSBqfdqc2UcMEEOlBwia7XC+iJTGKosrsVqZ3GWQNG+sGPAqJ/ZJdQEkRbtcwa4062G35sLFLgpn7Bwp5CtbBAIMn8jrTDHnGoxXQ8PuO8xtm9a7IUevtufsSbf9zudwjl4QeOJfmJWmPFo42SpPKzt6PVcRvdD7IbU6IwVPDGhJCzNQ+8NZiJAB9zN5qvgN57K75xFLiLkFkXG4NAfnF3rX6FdWZJjDS+w40zxzKz1hmZD5HGZXfyDNfswKELeSR2h8XATfCQZlwIJC6aNOADY3eX/4ffgshS2AZ4ltCPYNLte4E+8NDAQxdo2Hh pPwGdfIG UKdJEgRiKMQK96MoHfY6ZjcTaPfdi+D6Rqr6fIGj3s88m0b3LbaoyGgHf2oBHlG6bjN3QFqi5Orm4rrz6vgokxnPBZUWoHI2cr96PLj9t1qR9Nbm7gNsXt9wLx+i/jnFD8bRB9iaqqi4tOif/UtFFVl75NYc1SOIFiMlztl5NalEwhsFT6UaDyZr0bUJpCP2IuxDmb4O9ViSRhSTl//i1URcU9Ru3ToR/uP467m/SOPPj4o7PgLTzK2df9Mr9bq0GeGUB8mgessKn28B+UI/utG26SrcuCi6sNHRq/6k/1/1lUcTSmx9yaPxolnlTPsE83DkTvOACDS5CgKk2aUrGI/Y5Ng== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --185210117-2130454234-1698916941=:474267 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: On Thu, 2 Nov 2023, Marek Marczykowski-Górecki wrote: > On Tue, Oct 31, 2023 at 06:24:19PM +0100, Mikulas Patocka wrote: > > > > Hi > > > > > > I would like to ask you to try this patch. Revert the changes to "order" > > > and "PAGE_ALLOC_COSTLY_ORDER" back to normal and apply this patch on a > > > clean upstream kernel. > > > > > > Does it deadlock? > > > > > > There is a bug in dm-crypt that it doesn't account large pages in > > > cc->n_allocated_pages, this patch fixes the bug. > > This patch did not help. > > > If the previous patch didn't fix it, try this patch (on a clean upstream > > kernel). > > > > This patch allocates large pages, but it breaks them up into single-page > > entries when adding them to the bio. > > But this does help. Thanks. So we can stop blaming the memory allocator and start blaming the NVMe subsystem. I added NVMe maintainers to this thread - the summary of the problem is: In dm-crypt, we allocate a large compound page and add this compound page to the bio as a single big vector entry. Marek reports that on his system it causes deadlocks, the deadlocks look like a lost bio that was never completed. When I chop the large compound page to individual pages in dm-crypt and add bio vector for each of them, Marek reports that there are no longer any deadlocks. So, we have a problem (either hardware or software) that the NVMe subsystem doesn't like bio vectors with large bv_len. This is the original bug report: https://lore.kernel.org/stable/ZTNH0qtmint%2FzLJZ@mail-itl/ Marek, what NVMe devices do you use? Do you use the same device on all 3 machines where you hit this bug? In the directory /sys/block/nvme0n1/queue: what is the value of dma_alignment, max_hw_sectors_kb, max_sectors_kb, max_segment_size, max_segments, virt_boundary_mask? Try lowring /sys/block/nvme0n1/queue/max_sectors_kb to some small value (for example 64) and test if it helps. Mikulas --185210117-2130454234-1698916941=:474267--