Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1408289rwb; Sun, 14 Aug 2022 03:12:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR7gs8TeyCWSlsbmJG3DXytiRm9gtKOnCypFubkNhqnkJq6aELZbzpkD1eBctG5BbziEokLz X-Received: by 2002:aa7:c7da:0:b0:440:d482:36b5 with SMTP id o26-20020aa7c7da000000b00440d48236b5mr10547531eds.21.1660471949699; Sun, 14 Aug 2022 03:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660471949; cv=none; d=google.com; s=arc-20160816; b=0ATD/9lSSxJsN0e0D6ywoquXJDGDsmXrYYenBzjZKiZ4D6zfDq1yIGfuVFzsJVzFjv +uXy+TymRPiXWjTOwokupR081dosXxfuFm/XL3m1rtEofRPP7UhgV0KhX6AyL2Qg9/bU /pJzTB3LPk4/+Gc2oW5yUUf44OE5pLxp2YR/iU68Qq/KB+0EXHfsm1JnyhFedKps3mOS Z3+ENvnnoQgoEOah4O8vnaE08eSSXvh5XSIlnRaqEhFmho7jdJVRZLYvyuxpnE3Ae+G4 zndOAbPahZ5sTQYEdPe2E+Xo/JS6yrYth8+W3WqQI3VqKoF1kxgughv9+uZY82Izd1yL Zj5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id; bh=M+RWZDXe4Z+tjMh1f7477wplagodA9SnRShNI80v9Is=; b=JmLkcgZFMpQAxSky0ueDdI1phiSfKvZLNerCQRZy9fQ5RRk8702atVu0/rS1sygmGt BNUek/ZWMNi4T2494S97QdLMmj+Tlv6eOKj8HqgGR44B+e9nvD42z7B5Bv/fFm/68Ynx oBT76OyIjqnAAs+v+UjhfLEsjKTG5NMvtpv7PSYvKoqvDJ5aa/kVzUVGu7FD2anLBtxW Y9ZB0OFdl3fJSYBz1Jqqxbv3vw9m7YDGaJBIuGHAMhkPwL6gnYjR4E8/YKdZ0E7SbHz3 YYEI72pbtdFKUW3Eqn1PUfh+QFi3fMObIVbqDrEYrdGdq2sgz/c5bJ6P/aSju2xk7U+y ep9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h26-20020a17090619da00b0072aef2d3af1si4816311ejd.53.2022.08.14.03.11.58; Sun, 14 Aug 2022 03:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbiHNKH3 (ORCPT + 99 others); Sun, 14 Aug 2022 06:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiHNKH2 (ORCPT ); Sun, 14 Aug 2022 06:07:28 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5433D1EC71; Sun, 14 Aug 2022 03:07:27 -0700 (PDT) Received: from [192.168.1.138] ([37.4.248.80]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M27ep-1oLEZz0ES9-002VzW; Sun, 14 Aug 2022 12:07:10 +0200 Message-ID: <38333b47-6871-00e2-db54-bde96a74bf00@i2se.com> Date: Sun, 14 Aug 2022 12:07:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 From: Stefan Wahren Subject: Re: [Regression] ext4: changes to mb_optimize_scan cause issues on Raspberry Pi To: Jan Kara , kernel-team@lists.ubuntu.com Cc: linux-ext4@vger.kernel.org, Ojaswin Mujoo , Harshad Shirwadkar , Theodore Ts'o , Ritesh Harjani , linux-fsdevel@vger.kernel.org, Linux Kernel Mailing List , Geetika.Moolchandani1@ibm.com, regressions@lists.linux.dev, Florian Fainelli References: <0d81a7c2-46b7-6010-62a4-3e6cfc1628d6@i2se.com> <20220728100055.efbvaudwp3ofolpi@quack3> <76a9b920-0937-7bef-db55-844f0f5f6c1b@i2se.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:n15zq3ZgBlvJQk8mViiXql5BsfLSMYPXCezwwSv3j/K3e6BQl74 HMX197C3BfJHdx8d+zWb9I3Lvq6netg+krFBZUCx596RzIVPhRZXX3Aprm+nF8zNTTSAmPc sEvN2PUp5/tIX0+7dhwNqD1Z7ewUatn+hBVH/W3MSCwsgQGTNeWSdNWyxX6VZ/8dy64E7DX sk9b+GSv3N7logbKAfw3Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:ffnml0wnutQ=:kxPeYMBCzd1V2QuO2Dm5Oz eEVg/y72mTTdpGuFjreonnsHRPFolHZIRK80578nJic9K4ELgZG9wcMAzbDahaQvm+5n8KIvP apxWJJjWi6F+pZmYgoZrj5Orfhqxa61oubTX2ZNNqs+w1KddBXY4QNwsK7zT+etPVEvYTmzd4 BtUQZuf6jW9RQvC4HIf4CzBBNHAqK+VdOq4p9UubdzGePgxVmNponWjNHv2/PpaOKPRwMGOHz inaO7tI+zv4x/i8mW10g11B60+RuIdwziHVUQ1pOuK9jpU7YFDs5dIJwRuL7+Y9pmyIQqdGyz 2xxj+slMeUT2lrvT2YrOlUtSKiVSgS7CQ8fhUzxvyVOO4oA7EMmF5y/r0pThZN378C/GduKRl VyiXEtjRsQD+3voNPseLjMGCCZZJiQLyz6s3EvK5i0j5WAEJsWh+8gMl3+gKObiwaMA6Wi1Y9 yYBl/w/KmXDMTccjH3lvu+XNFC3Pz47hZ1u+9TH5F9ARwnKabS5KTy2eDcs1R494BbKns7Cif tOPPcl+FSxNCF4U6ylWP5CScwAgUXqUIxdfoTYRtTGdBs5Lc82n9OrO3StoWbLSfm/YhLxsv2 FJYLCu0hvi5dpMya/Wrjq6DrETfAw+ggZGOpOrLMLkZ4fprSZQHR+L5mANcLcKajrVK6FPnXo KCQKPmnwzEFuo0I35qrufAB8s1Vv2Zns4DTTBZjPvToFEzVdizbxBcsyI/MqBNZnoO4K1HB/2 gezC/tQLeWbWUT/lCMhcgqX+zxqEdUASpaFtKDQWfCqx+eXbrsNcErmWYiI= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi, Am 06.08.22 um 17:23 schrieb Stefan Wahren: > Hi, > > Am 31.07.22 um 22:42 schrieb Stefan Wahren: >> Hi Jan, >> >> Am 28.07.22 um 12:00 schrieb Jan Kara: >>> >>> Also can get filesystem metadata image of your card like: >>>    e2image -r - | gzip >/tmp/ext4-image.gz >>> >>> and put it somewhere for download? The image will contain only fs >>> metadata, >>> not data so it should be relatively small and we won't have access >>> to your >>> secrets ;). With the image we'd be able to see how the free space looks >>> like and whether it perhaps does not trigger some pathological >>> behavior. >> i've problems with this. If i try store uncompressed the metadata of >> the second SD card partition (/dev/sdb2 = rootfs) the generated image >> file is nearly big as the whole partition. In compressed state it's >> 25 MB. Is this expected? > > This performance regression is also reproducible with 5.19 kernel > (arm64, defconfig) and 64-bit Raspberry Pi OS. Unfortunately the > problem with metadata generation is the same, the generated > uncompressed file is 15 GB. > recently i upgraded my build machine (Intel Core i7-1260P) which now runs Ubuntu 22.04 including a recent 5.15 kernel. On my build machine if i try to install my build kernel modules on the mentioned Industrial Kingston SD card 16 GB (SDCIT) and call "sync" immediately, the process will takes very long with recent LTS kernel (~ 5 minutes) and trigger a hung task warning: [ 1692.880208] INFO: task sync:22272 blocked for more than 120 seconds. [ 1692.880222]       Not tainted 5.15.0-46-generic #49-Ubuntu [ 1692.880225] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 1692.880228] task:sync            state:D stack:    0 pid:22272 ppid:  5238 flags:0x00004002 [ 1692.880237] Call Trace: [ 1692.880240]  [ 1692.880246]  __schedule+0x23d/0x590 [ 1692.880257]  schedule+0x4e/0xc0 [ 1692.880261]  wb_wait_for_completion+0x59/0x90 [ 1692.880269]  ? wait_woken+0x70/0x70 [ 1692.880275]  sync_inodes_sb+0xbe/0x100 [ 1692.880282]  sync_inodes_one_sb+0x19/0x20 [ 1692.880288]  iterate_supers+0xab/0x110 [ 1692.880294]  ? __x64_sys_tee+0xe0/0xe0 [ 1692.880300]  ksys_sync+0x42/0xa0 [ 1692.880304]  __do_sys_sync+0xe/0x20 [ 1692.880307]  do_syscall_64+0x59/0xc0 [ 1692.880312]  ? do_user_addr_fault+0x1e7/0x670 [ 1692.880319]  ? syscall_exit_to_user_mode+0x27/0x50 [ 1692.880324]  ? exit_to_user_mode_prepare+0x37/0xb0 [ 1692.880331]  ? irqentry_exit_to_user_mode+0x9/0x20 [ 1692.880336]  ? irqentry_exit+0x1d/0x30 [ 1692.880340]  ? exc_page_fault+0x89/0x170 [ 1692.880345]  entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 1692.880353] RIP: 0033:0x7fcbda436abb [ 1692.880358] RSP: 002b:00007ffc94923968 EFLAGS: 00000246 ORIG_RAX: 00000000000000a2 [ 1692.880363] RAX: ffffffffffffffda RBX: 00007ffc94923b48 RCX: 00007fcbda436abb [ 1692.880366] RDX: 00007fcbda53c101 RSI: 00007ffc94923b48 RDI: 00007fcbda4f4e29 [ 1692.880369] RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000 [ 1692.880371] R10: 000055ca76fb4340 R11: 0000000000000246 R12: 000055ca752c3bc0 [ 1692.880373] R13: 000055ca752c119f R14: 00007fcbda53442c R15: 000055ca752c1034 [ 1692.880379]  Interestingly if i switch to the older ubuntu kernel version 5.15.25 (which shouldn't have "ext4: make mb_optimize_scan performance mount option work with extents" applied) the write process is much faster (~ 1 minute) and i never saw the hung task. Btw i setup a repo [1] to collect information about this issue. The first file adds a kernel log in regression case. The kernel was 5.19-rc6 with multi_v7_defconfig and ARM_LPAE & EXT4_DEBUG enabled. rpi-update was started before (backup & clean). The actual download started at 11:11:29 and is aborted at 11:14:18. HTH [1] - https://github.com/lategoodbye/mb_optimize_scan_regress [2] - https://github.com/lategoodbye/mb_optimize_scan_regress/commit/6ff14dd4026d8607290b2727f5a2c3522567fb21