Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3651583rdg; Wed, 18 Oct 2023 01:44:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEP3ouzKOm1kEZ5vyXvKJaD6vzoyRgHkF8WRY4Cvw0Cx5AcjZ4cl9Y9t3lksAABD7dsw1FO X-Received: by 2002:a17:902:ec87:b0:1c5:f0fd:51b5 with SMTP id x7-20020a170902ec8700b001c5f0fd51b5mr5303976plg.40.1697618641486; Wed, 18 Oct 2023 01:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697618641; cv=none; d=google.com; s=arc-20160816; b=qKI5/UbxxTGkmi90MHkZPdavggH/yU1TvTwHFm1lvKDwo8hkU1rYqBATwVR7Zz/oaF le2YBmc6Auncqyu6J9IlN2dNZvByzYexMr2nXlStJsLL794p4aEec9t6+toP2vljRRqz m7wUAOzOSHNh7F1VQwhKrBysZXgYjsstFqclLmPyKKlJMY/JfvdPP/ya/rZDBVoQteeU wRc7ossCzL6ACYdqJ7KixbxpRteynImOJ2PwTuMpwCd7YHyNwtH/1QSFjZ4KTrLKkUAQ 88b9YNij0T7Dsg3HrpOipGHlV6mufs1tmMV6QUWLxCOyr9EqbzEU9G8fx3HyLhUXeAnA SdFw== 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=nAr4Czs1Gmv7dgWfEmdHDDt8I2NpUA7OGZmt8fiF/E0=; fh=QgyIlibq97cBekf1VoFy547bmOc8GAdHuEcCko0wVVw=; b=tgmHFxO+a+m7JhnSNhBeBryUe2Q/jGbrVhJFpyMGPvsNqxdFNO0zrCjxdDs0miP46O SFKR6gxUhmd9l4rQvbHdpiFpXQlyvn5S3xCu/4YyouwiJXjRQ8Bf5Jr3GbnOBDsZmGXL 5mGcM+Rtbg+ovUbBWpWPlHH1Mg41sUuogDxvx8GaPK5DrffI7A4TMKB2uafAZgeymbja hsI5oa14esWH9TyiuDdDvkJ3J4JMp6/yCFuABKSbPom6iSP0UqfdEe3C4IuZp5maFWE+ aKDobxibps0bkqNezYioDmtiYis+TL10mJP8epriw+NRzAdTZkGkvlfSdCklMhLkWRfo NGDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QgMXQFA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001c7264c458dsi3757089plh.181.2023.10.18.01.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 01:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QgMXQFA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id A7D5580775BB; Wed, 18 Oct 2023 01:44:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbjJRIn6 (ORCPT + 99 others); Wed, 18 Oct 2023 04:43:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbjJRIn5 (ORCPT ); Wed, 18 Oct 2023 04:43:57 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4CC1C6; Wed, 18 Oct 2023 01:43:55 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c9d407bb15so55532475ad.0; Wed, 18 Oct 2023 01:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697618635; x=1698223435; 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=nAr4Czs1Gmv7dgWfEmdHDDt8I2NpUA7OGZmt8fiF/E0=; b=QgMXQFA9e4+m0u3jKiJFFyKnc4p7AxhbnczkydbxRSjqwUaf6Tgj8Dx2NOHGSczpHD yn/8EX5fbv1r+7ct52nITw7LxZGoaz/0bFdbuQ4znQxTDxUMOPWQ0ohAB5h8huo7LcAG CSxD4ku/8xpCA/pKbeWIpAI/gIjvnvtZYREBmz6ZoKJUBpv+oiOTgHcSx9mAkTFLVN45 ciDnj2LerZNGctupfGH0Ik0CfG3m5DN1DbQx7SK4H8HSed8b/AnV9ja4Cmf8S5ECoaMu RB99mMm2KUg3jiWmks+T1twhlK5ZZaPJYnS81Pw183qkLWSOE12CUjFaxXahEgoaBQNh gr3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697618635; x=1698223435; 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=nAr4Czs1Gmv7dgWfEmdHDDt8I2NpUA7OGZmt8fiF/E0=; b=nIz/DiC9E+X4+isuLLmo/NIhFBpraflRFhzdYnfQLde0CszSonXc46qcJ/mrNN51Ry I3q1VyDoAkq/ZAjhsZ4J692uaZHi3kDcQHi0pkpw3pkU608z0o5Mgq+TCSGcNOlynGVu NU9fx9GsC5Zld5gI7ZL6UV//sREEeazaiJuOtgNTNhcy5yJT8MpcftLJ8MJ+93BJNK5M t/nQxiehFWA/JR2d65MJTGKtXe6S41X+5aNjKkHYAsCTsbeOuCAuarqfpGoGVzG+RfmN ovFSCkJdsiOsRDGrLmXk1yBH28/HCHwQN7srWgXvQgms0BMdGztBy9qEokn2XV66FGmq 0vOQ== X-Gm-Message-State: AOJu0YyN/jtwSHtdt8tR18hJ/d45NqDuxpbT5N+T25tlCFv+bmbb4hvY 1Pelm8sdW8q16bzqhy0xnqw= X-Received: by 2002:a17:902:e74a:b0:1c9:ccb3:2352 with SMTP id p10-20020a170902e74a00b001c9ccb32352mr5994017plf.12.1697618634960; Wed, 18 Oct 2023 01:43:54 -0700 (PDT) Received: from localhost (dhcp-72-235-13-41.hawaiiantel.net. [72.235.13.41]) by smtp.gmail.com with ESMTPSA id k13-20020a170902760d00b001c5fc11c085sm2941357pll.264.2023.10.18.01.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 01:43:54 -0700 (PDT) Sender: Tejun Heo Date: Tue, 17 Oct 2023 22:43:53 -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 v2] writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs Message-ID: References: <20231013055208.15457-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231013055208.15457-1-jefflexu@linux.alibaba.com> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 01:44:00 -0700 (PDT) On Fri, Oct 13, 2023 at 01:52:08PM +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 for, 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 Acked-by: Tejun Heo Thanks. -- tejun