Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp464579rdg; Thu, 12 Oct 2023 10:32:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFlvXvNgucMPtYkOvmi2qofc9AgA7baP2L0X3F6p7d1Gcc/INNNLz0OuZYsVEvH7x+mHPB X-Received: by 2002:a05:6870:1314:b0:1e9:bb3a:9a89 with SMTP id 20-20020a056870131400b001e9bb3a9a89mr2063112oab.47.1697131929341; Thu, 12 Oct 2023 10:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697131929; cv=none; d=google.com; s=arc-20160816; b=P2MhakliCiaHFeuEG7A7Eu53yN2vHz1UKHvgOy0qnXsJ5KQQYFMR/EEEz1v3U9cvK0 ir9KHLSKdW+QgmZw0YEYRQxYByfNSPrAd57iW2tSn5H0FyafMDQUTsUr+Y9befGILXw0 /xuErx8Jinanz4TVppNWDLrSSfmIfP7XNwPQmews6qJitM046rMr2A5z05pMcT+er5SS FNIpsq5dey4l1gwDaTdimBrQw+OePY4LYO3TA5xmSUGRtmIVbfAtOMWWgmAZBRoi9fEp APNSz22mXpRzRnvVqrW4ITKva4HhOAGQHrfySbMgZ4CP2TnAasrPbYHvHK4UKEdVvccU MghA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=v1DANaDEHOucqubqJ4/b/aNrMNFhI1eFitx/RoQbRb8=; fh=QgyIlibq97cBekf1VoFy547bmOc8GAdHuEcCko0wVVw=; b=s1OpgEc21Md/YXEyXUxkCkfUgg/v6x2xLWgAdcohFrN9CZl07RKazvrBRrAgwVgVCq JIUrg5YsgYqhFHoek0yR1qnS/fjdEV0Nxa/qb4Ihlww2apnzinYbw6CiBNlZ6wCGTTLB oBBIYyDW0zt40xEkqPLMAAsFXVwf9a4WYL1jOpp7I6+0w63I9cVKRz7F1nu7AxDrfUnq I3yroD4U1KaVcTFd1K7z0SYEdnlKs8+vLSOkc1vTHQX0z9ZxvwkQ+nK+qm4YpHwhVVJ8 l4FqCHjgMZc9zRdmw9BgUDJrRV0of+otBRHI+821wPiYTLJCzY5T5Kgcs2d9pAMykPC+ I0lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=F9JvIr2e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q4-20020a63d604000000b0059b9e4e53d5si2686037pgg.218.2023.10.12.10.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 10:32:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=F9JvIr2e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BE6DB8098FDF; Thu, 12 Oct 2023 10:31:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344173AbjJLRbN (ORCPT + 99 others); Thu, 12 Oct 2023 13:31:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344166AbjJLRbL (ORCPT ); Thu, 12 Oct 2023 13:31:11 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03249182; Thu, 12 Oct 2023 10:31:10 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1c9b95943beso10873895ad.1; Thu, 12 Oct 2023 10:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697131869; x=1697736669; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=v1DANaDEHOucqubqJ4/b/aNrMNFhI1eFitx/RoQbRb8=; b=F9JvIr2em32HFZF/djAEzFjgX4RuTj6a3ud4BBXRc3DkqduDSW+xW2HtzZ2vlUXNl7 nvo86Z2EHWPB5TMzSsPzhkEbDZeOBGP7pynRJZXA3u+A5VFYeuIdJwlCIiQw5d79idiN T9jBPhGnlK0Z2ty4nG6jzv3id4JH5gUkUUUL7hkaz52XiSct542Ctlsfd2/d5WGJ4d1P hPFbyTIIQDlbEK/vMJ9azlSAjfOJxke5krwgBKvVarV9Ty16hCSjYyEYHr2M93w4YCcC hGjIyZpHVBUeu9kvAdnkAMg8O2AiE6XLL4rAnPPMkvuBU/fcT/N/Q5kMEMeo+8Tol1FX 3yDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697131869; x=1697736669; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v1DANaDEHOucqubqJ4/b/aNrMNFhI1eFitx/RoQbRb8=; b=aaifymGcJoNPxj7QGFtNH/3Z1Lrx6UeWHl/00FiuIsYo6Bk6LVMQR859iX/qPmJMYL P7fvorykLMd7xDTO+ube/51RExB/Gm7AChBo81+mE8Wo1CQwDDYdNdtFNSIbqqIuv+4+ 8XmCW96GeUEd6fORcduAFxl7VQjgkc/tDokRcC9G7nmYHfa64IiUQ5tzP0GguHUbhWBb W2T8Wv9uxK3NcjuOeKtomC4GN4kdUquwSQQZxGM8xq3rz/am+Ym3f7JPX6R53CqRJkhH RyhyDFsUE4LP8kNiabyvwYYREHWvGz61v3CgQ01S5TRDIeRU4XgnaMuFgLWaejukkHB9 +Xww== X-Gm-Message-State: AOJu0YyLU0ZkwrLAOthTsAb2ftAdrfq4iz3ONYGpZ4qMfY1Ex+i4mj1V iYmYH3LpEo/Le0dljwvlOkWv1NZGMSXMFw== X-Received: by 2002:a17:902:c115:b0:1c5:e1b7:1c13 with SMTP id 21-20020a170902c11500b001c5e1b71c13mr22664289pli.3.1697131869277; Thu, 12 Oct 2023 10:31:09 -0700 (PDT) Received: from localhost (dhcp-72-235-13-41.hawaiiantel.net. [72.235.13.41]) by smtp.gmail.com with ESMTPSA id b11-20020a170902d50b00b001c57aac6e5esm2278311plg.23.2023.10.12.10.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 10:31:08 -0700 (PDT) Sender: Tejun Heo Date: Thu, 12 Oct 2023 07:31:07 -1000 From: Tejun Heo To: Jingbo Xu Cc: guro@fb.com, lizefan.x@bytedance.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, willy@infradead.org, joseph.qi@linux.alibaba.com Subject: Re: [PATCH] writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs Message-ID: References: <20231011084228.77615-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231011084228.77615-1-jefflexu@linux.alibaba.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 12 Oct 2023 10:31:24 -0700 (PDT) On Wed, Oct 11, 2023 at 04:42:28PM +0800, Jingbo Xu wrote: > The cgwb cleanup routine will try to release the dying cgwb by switching > the attached inodes. It fetches the attached inodes from wb->b_attached > list, omitting the fact that inodes only with dirty timestamps reside in > wb->b_dirty_time list, which is the case when lazytime is enabled. This > causes enormous zombie memory cgroup when lazytime is enabled, as inodes > with dirty timestamps can not be switched to a live cgwb for a long time. > > It is reasonable not to switch cgwb for inodes with dirty data, as > otherwise it may break the bandwidth restrictions. However since the > writeback of inode metadata is not accounted, let's also switch inodes > with dirty timestamps to avoid zombie memory and block cgroups when > laztytime is enabled. > > Fixs: c22d70a162d3 ("writeback, cgroup: release dying cgwbs by switching attached inodes") > Signed-off-by: Jingbo Xu The patch looks fine to me. ... > + restart = isw_prepare_wbs_switch(isw, &wb->b_attached, &nr); > + if (!restart) > + restart = isw_prepare_wbs_switch(isw, &wb->b_dirty_time, &nr); But can you add a comment explaining why we're also migrating b_dirty_time? Thanks. -- tejun