Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp635726rdg; Thu, 12 Oct 2023 16:56:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFc97AM/cXUZeaV84GYr4AfTzjlnkac5SWP56Q8zVi0OMKsA8P1Xfo3Vu6WtCtDKW9mgQWC X-Received: by 2002:a05:6808:1155:b0:3a9:bc8d:42ed with SMTP id u21-20020a056808115500b003a9bc8d42edmr31349672oiu.43.1697155017571; Thu, 12 Oct 2023 16:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697155017; cv=none; d=google.com; s=arc-20160816; b=XO4zNMNzaBvx93bWCiDWbbcGJn5d7vsvC3jpkmaFI8wnmhGRbSTl9Svc7Nf56dbHQb 5hlNlF/xaefS4B0wN0ZStFE7QtZKIOBh3rHL4IFdISqV+9Ikl8kLpI+tVvu2ZbCA4oDf K9jN5IYMufWukmBhInVIgWfV+I+VSaIDaTVMDV+5D53k+KpeF/bQtCA+OEUsKLd0lYcc 1W8TMQ/GOUUmqrMee7YDmp6IkcOpiJ1GjcL2OtU0Vp3e+PzP/+rXcKHp3XrsqJIIh9js I4JUMsP3dcb9BtliuGphOiugzMlkJKG87ivI3wG0TgUbOZFPm67dkPqqPnvaBlsgqYqM NXkQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=5ps0OJ1b0DC2lkx81G1PESGKDuuxt+TauYJdapz8T5M=; fh=HIk315CEhE5k4oHQ0V5RTHw5w23jgjoomhAbObG2E/M=; b=ssFZMjhlbEmSnSp7CLRkh079JeO/U5tbciVYgbfno0g+5HpZ3b5DpyVO8WuVu2f+Lz L/puRRNNOx+ByL4jv6i+9CIzrAfxcBSSvYK6l0TXM8AYbi4C3dfHqoNxHxoR/1OPvNXX zXSoUTqshegKC4fKY3ayGf9/C1jJF5/ETbviXeDnat9k5ueh4A2WPSB5LZOvYdNjMiZq ocWeLOU7ZnECJ826aciwiP8dBRd52BBfX5U0bKAoVU1Q9TPAlzZ7abw1lHFdaHTxE3b+ Iw0hOISEOo5/6a+Tskc6uraZeqRSQVO8Tfnd75lP2yAA5+7CoFgJRxrf7Z8iwWZ+FOvo njsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b0055fce913d52si3320338pgb.761.2023.10.12.16.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 16:56:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 91B858099899; Thu, 12 Oct 2023 16:56:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233798AbjJLX4D (ORCPT + 99 others); Thu, 12 Oct 2023 19:56:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233273AbjJLX4B (ORCPT ); Thu, 12 Oct 2023 19:56:01 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A006B8; Thu, 12 Oct 2023 16:55:59 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0Vu0.XgP_1697154955; Received: from 192.168.31.58(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0Vu0.XgP_1697154955) by smtp.aliyun-inc.com; Fri, 13 Oct 2023 07:55:56 +0800 Message-ID: Date: Fri, 13 Oct 2023 07:55:53 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH] writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs Content-Language: en-US To: Tejun Heo 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 References: <20231011084228.77615-1-jefflexu@linux.alibaba.com> From: Jingbo Xu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 12 Oct 2023 16:56:15 -0700 (PDT) On 10/13/23 1:31 AM, Tejun Heo wrote: > 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? Will add the comment in the next version. Thanks. -- Thanks, Jingbo