Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp944475pxf; Wed, 7 Apr 2021 15:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiMrtbKBGS3PIVVVzZEDc0faF7zKbvBWZTs+HUdzWCtLU9j2WfwJQOd4bbaDBuXJGcabZ/ X-Received: by 2002:a17:907:3f10:: with SMTP id hq16mr6544153ejc.181.1617835462590; Wed, 07 Apr 2021 15:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617835462; cv=none; d=google.com; s=arc-20160816; b=ys6tEZ3k/l9v15HesKjVgRCA/raobWXFlaIouof7qI3eUmCvREcULn0NF3neQBlf/b Pm4B2TUTKTKsRTnAWE9ctmnnrNIsDZEomXvRyZQ0uEJJ8uvpti2l2k8021bAx+BzZ/hD D4+9NFvZUaQrdNhTDqjIG5VvSAdmjyyin+5K5kjGccHVbK7vOZzNrF86fAXJyBcDWSj/ D6t1PbfEpCN1S6qU7BEwc6LtwCzbW7cEr0JgqhB/siTVBS2OioMTWfsz4vMTwq6UXZ9e CuNaUufZer3MnYvL22/DsQupwWS2uwU7gPjDefknxW9+pasiRuKf09m8so0DbGX0Oqd1 52vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:to:cc:in-reply-to:date:subject :mime-version:message-id:from:dkim-signature; bh=mtiLq11rvXOypKr5/WiEBWxlkOAL81cGhZEFuqMThGY=; b=vJLbVE2V4dR5o7fefCGtWYs8BPqApbuYWmfD1qV01QMiLKMAeFbcATeNvbC/WmZOEH uUD3IrT6AAeHJf/ISPuWzWXzW3OutJuewfYn/2RmPa5PdGtAsIgJf6XtCoYpCrwOrYTz +fNQ7O+HTN0g7/5M0FF0jBnXKka9fPbSGd76o8y+rtiCtf168fqzb/yVtFTzZRIgt+uf ZJvHHdMUiV/rfDolIdmLyaiX/pn2ZRcYmtvAiJq9sESzOYD1IJZO5qGbTj3UxZ2PulvD jHr9SndSJ94xU6erh6ta1qUuL4IXSBg/zxeugDEEClN1WetcFXblZXUBMla9T41+bHXk wwNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dilger-ca.20150623.gappssmtp.com header.s=20150623 header.b=fEx02NLg; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si21816835ejb.573.2021.04.07.15.43.56; Wed, 07 Apr 2021 15:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@dilger-ca.20150623.gappssmtp.com header.s=20150623 header.b=fEx02NLg; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbhDGWhD (ORCPT + 99 others); Wed, 7 Apr 2021 18:37:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbhDGWhC (ORCPT ); Wed, 7 Apr 2021 18:37:02 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA253C061760 for ; Wed, 7 Apr 2021 15:36:52 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id m11so353928pfc.11 for ; Wed, 07 Apr 2021 15:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dilger-ca.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=mtiLq11rvXOypKr5/WiEBWxlkOAL81cGhZEFuqMThGY=; b=fEx02NLgQrLsbvvpFvZkuvPMwHSGCv4XAOLIRTW9SIx5PQsOt8vKon1/lR7U1XRjD6 stKDqSKs0coBrtFAbS2t+GemSZ6pKhYuZNM+3sir558bv6/9p1C7vZHmmpXRm6xe7Wwm viEuLl4qt+q3iKaj1GYkqsOtBKYbFBnmzi92UbNHIy0EAbpLv/WEUV5V1s/kQmBVGFeK Jz+KbJi0QnbAJFmFByCCt3n7CUcbpC5fN6M0AL/oakvwCS6L6nSQ76ejmByQObmUNujW KSw++qB8ANqobgVmH8QgKnEBBI76188Dma6Vsal1ivogvzrzHBFHvABBPxU79/2tBqwc 4foA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=mtiLq11rvXOypKr5/WiEBWxlkOAL81cGhZEFuqMThGY=; b=sFLRZEnWrxjWKKeKWj6NirizI82RfPdNdD0b+Uio3EDgfZQlXeM+Rb1odcEs3BFs4N QQtYuPuAKgYkiKXkdVFj7gLmwTXS/QoGNfkH2XnZgcvU5sEsmVscAkhnzExoa7/XG96Y Y//X8JtUsGKS2BRGh8zWubsSu0WgFJT8uhncDuR1ITWK7dj6XNs8ZBL/r8U7OZEKBDBn OSaYp8JPAF6V41Tkh2HbVUyQxfjsiPirTfHZ1RC6SmhYnDGwz8cj2ZWblU1IhCQ3hlNo Pki/1LqIsWkVsWnuKjhDDikI+zWcKlWZEAbYCmXMd1PyxUmE4gftgbO7WDCjWkNDK73C DGYA== X-Gm-Message-State: AOAM53097EtH5bG6ixC7ep6iFw2kQIbKK/Q/Fdbh8YtJn8R3ermiIQ5A 2T0emfiNa3dlZEylDkAy7lC/xg== X-Received: by 2002:a62:7f45:0:b029:205:9617:a819 with SMTP id a66-20020a627f450000b02902059617a819mr4703232pfd.17.1617835012173; Wed, 07 Apr 2021 15:36:52 -0700 (PDT) Received: from cabot.adilger.int (S01061cabc081bf83.cg.shawcable.net. [70.77.221.9]) by smtp.gmail.com with ESMTPSA id o13sm22637065pfp.26.2021.04.07.15.36.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Apr 2021 15:36:51 -0700 (PDT) From: Andreas Dilger Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_E8BF602C-24E6-4AB1-92A3-E71AF129E7E0"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_preallocations Date: Wed, 7 Apr 2021 16:36:47 -0600 In-Reply-To: <20210407111647.5cmknwltwl2rfvmu@riteshh-domain> Cc: Wen Yang , riteshh , "Theodore Y. Ts'o" , Baoyou Xie , Ext4 Developers List , Linux Kernel Mailing List , Jan Kara To: Wen Yang References: <20210407070141.49253-1-wenyang@linux.alibaba.com> <20210407111647.5cmknwltwl2rfvmu@riteshh-domain> X-Mailer: Apple Mail (2.3273) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org --Apple-Mail=_E8BF602C-24E6-4AB1-92A3-E71AF129E7E0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Apr 7, 2021, at 5:16 AM, riteshh wrote: >=20 > On 21/04/07 03:01PM, Wen Yang wrote: >> From: Wen Yang >>=20 >> The kworker has occupied 100% of the CPU for several days: >> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND >> 68086 root 20 0 0 0 0 R 100.0 0.0 9718:18 kworker/u64:11 >>=20 >> And the stack obtained through sysrq is as follows: >> [20613144.850426] task: ffff8800b5e08000 task.stack: ffffc9001342c000 >> [20613144.850438] Call Trace: >> [20613144.850439] [] = ext4_mb_new_blocks+0x429/0x550 [ext4] >> [20613144.850439] [] = ext4_ext_map_blocks+0xb5e/0xf30 [ext4] >> [20613144.850441] [] ext4_map_blocks+0x172/0x620 = [ext4] >> [20613144.850442] [] ext4_writepages+0x7e5/0xf00 = [ext4] >> [20613144.850443] [] do_writepages+0x1e/0x30 >> [20613144.850444] [] = __writeback_single_inode+0x45/0x320 >> [20613144.850444] [] = writeback_sb_inodes+0x272/0x600 >> [20613144.850445] [] = __writeback_inodes_wb+0x92/0xc0 >> [20613144.850445] [] wb_writeback+0x268/0x300 >> [20613144.850446] [] wb_workfn+0xb4/0x380 >> [20613144.850447] [] process_one_work+0x189/0x420 >> [20613144.850447] [] worker_thread+0x4e/0x4b0 >>=20 >> The cpu resources of the cloud server are precious, and the server >> cannot be restarted after running for a long time, so a configuration >> parameter is added to prevent this endless loop. >=20 > Strange, if there is a endless loop here. Then I would definitely see > if there is any accounting problem in pa->pa_count. Otherwise busy=3D1 > should not be set everytime. ext4_mb_show_pa() function may help debug = this. >=20 > If yes, then that means there always exists either a file = preallocation > or a group preallocation. Maybe it is possible, in some use case. > Others may know of such use case, if any. If this code is broken, then it doesn't make sense to me that we would leave it in the "run forever" state after the patch, and require a sysfs tunable to be set to have a properly working system? Is there anything particularly strange about the workload/system that might cause this? Filesystem is very full, memory is very low, etc? Cheers, Andreas --Apple-Mail=_E8BF602C-24E6-4AB1-92A3-E71AF129E7E0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIzBAEBCAAdFiEEDb73u6ZejP5ZMprvcqXauRfMH+AFAmBuNAAACgkQcqXauRfM H+BlWQ//VA+WPUb9mnx0PLVODhTyol/AXVQsqOIDXVNLquC9QEHFhJAK/kX/oN/7 Mc46bS621YgVogJy6dpTUj08GuOpgW1gN7oqxrzIyw0crFYAX3S1D0808uRdwRLF 6NE/Yq/uRvk1rCSypSM1E/ZNtLaIGt6JkVOGIlUoW5IQ3saoBYdmGEGw0ZAaEywF 84DGHt5/9gKD6UA405H72mvlF7Dg0s6DOLiIKVAb/uaccPb/qSJ55+HEiTpeQgIL n09MAI+qfuKlShaMM5BAM2WvScZlIqtC8G7W1/4ogrfdx5s6W4F5tgj9oSQHUtc+ jWFiQYwrC/M785xR7usMUCx10KW3f7hDOuyo5KEXHVWSEPnQYJy1WG+XCGrEH0aL L7Vivk6PEDC1YIS0qCS2lQXzY7GnbYjLhC8Tl8QVxrUJq9Aa/+0Xr2r6F3rtmQ7H ZN3cC8EZYLkO0u8mgt4o9jcWtUL5VcrrU6o0ZQQPUXjxLG1hePlXoIwd+RGSyQlg S5RiZVMenRFN5EG2qlrV4mO3NBpqPe0mODpNQ6H/4M17Fd8VOCSta3Q6X9MORpCz ycB0KpB/nBWi1P0PmRq8upDwmYrmMlYqtIWQKq/A8vMroFAkdb1cnVrnv3hmR73v DHLZvBTJXlLCYF2kNq6PQ3GS/T+CaWg9uFjRSmNOLJWatBc3+hs= =jAQi -----END PGP SIGNATURE----- --Apple-Mail=_E8BF602C-24E6-4AB1-92A3-E71AF129E7E0--