Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1130163lqh; Sun, 5 May 2024 18:36:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUaQaa7vNTOxgnagy2lcrFcHs6hvqPEZZg/uvVVRYRpo3MvfjsQhFrH97Ja9nIUF7CSIIJ3arEKxDe2pVOjLwTYR5+YSgpKkfzIhJ52Tw== X-Google-Smtp-Source: AGHT+IE20qrn75Oxl+q9llAoiex535zPI8KPJktjGVzclo6F8LTyTfjbEZ5QDAyB7Q33iGe3rC83 X-Received: by 2002:ad4:5f45:0:b0:6a0:a7a9:4ad4 with SMTP id p5-20020ad45f45000000b006a0a7a94ad4mr12655870qvg.7.1714959398533; Sun, 05 May 2024 18:36:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714959398; cv=pass; d=google.com; s=arc-20160816; b=EOLMJkBbo175eikACCWdteci4meOo2BUa5Y1y1JH0Y1A7tEMK7F3UcwUDqr354dM/T bSDmFuhQA4fGRAI0zVx5QNZt0b3YGQA5vFT5inycbzlLIZ1S6ngkZvM79sOEVuL+ZbxY Sig8x9o1sZ3j4GTrnLQub9KJ+IOiPoy0LukqsJCiPY9w/7BEIjk7+oGXJiloe7GUTAmn SdppfMS2IePh70XP9weudk1n3rNrfFxYgQBI10gBPiJ2Yntc4gDCwRj5vQob+MZ7EZcg DJ3yFFeGrLBXcYOb5bZH2kyDRheA8xKPBWeM4Eg5PYd4AdankdYuFTgeaOR6BfCSFtvb MD9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :references:cc:to:subject; bh=lgN23LOJLn0QCe1IyJIZFm7i6pf+0SdeyzDqc/BV3fs=; fh=XEHhcdA3crvUkUXS7itYrqQy2ZG3Udc4sIMF7Q9Y4OA=; b=tk9Lw7MIzoZGS1Su8ieyNnX+GktIBGMZUYPSm2URbsYfP8/fcftIyicLsRJ0VbFT3c /AotAEakG2tPw0AoSleiwwCyd1dwuqsQMU2d4Rzy10IGGxTHKcv8OZiyJqqgWmR/vMzk Z4kDBS4iFsg8JXVVOFXzZWuKjBdmSW3QdksSsTdifE6BiW1nebp4LmaOPdZrSM4MVnK/ FMsqdPS74UDJQ51UaCfIo/oss4FqSFBfp6FRUDyk/3qNNe4vNjlmCv0AHuW9A8jSrgam RuglnzfGB2ItKtGB9DmRQe2DD6cWoW0/4yGhFOYUWHr0fp2q2GGPL/wizBSZxM6N/m0P kwmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-169233-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169233-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r13-20020a0562140c8d00b006a0ca91d5e6si8233903qvr.238.2024.05.05.18.36.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 18:36:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169233-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-169233-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169233-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 431901C210E7 for ; Mon, 6 May 2024 01:36:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C7E63D967; Mon, 6 May 2024 01:36:29 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68BC62FB6; Mon, 6 May 2024 01:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714959388; cv=none; b=ZMeaL/3rzcCTLcMipI0GZXoAgq2Pmy1XZX8hy8+Ae2kEDMw4iDtt5Mma55U7jF/l2X81RqkFkSpJ/g9EGmtLpLWmqrT470AS7Kf8HXEGjUWsidIxYl4UjWFhbKTVSlsAq6pMt81sKYK5gD9yq7pq4Kd3f/LJkP44dxZmSpF+kJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714959388; c=relaxed/simple; bh=ag6RGZFM7m5plICBEfJons44Wjr75WLDkDSAT15eWdo=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=mep0QnpMWG1F56GPEEH1y779FS3qSDceav+buJZkBu/WXIJMxAIChdoap3ntnYSIs6U1oVE8JY/pwOZEhZuL98U6k7vWpXWqeORnPJfGDN4tRgxdMIyJJ/xr1wi/xTYGsmUwm36AqdyyKajonFmECCGDCZSDaBLoh8q1oC3GUQE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4VXkWs55kQz4f3khh; Mon, 6 May 2024 09:36:09 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id D7C691A016E; Mon, 6 May 2024 09:36:17 +0800 (CST) Received: from [10.174.178.129] (unknown [10.174.178.129]) by APP4 (Coremail) with SMTP id gCh0CgCH_nAQNDhmVahmMA--.56236S2; Mon, 06 May 2024 09:36:17 +0800 (CST) Subject: Re: [PATCH 04/10] writeback use [global/wb]_domain_dirty_avail helper in cgwb_calc_thresh To: Tejun Heo Cc: willy@infradead.org, akpm@linux-foundation.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240429034738.138609-1-shikemeng@huaweicloud.com> <20240429034738.138609-5-shikemeng@huaweicloud.com> From: Kemeng Shi Message-ID: <3bbfdaa6-c212-64eb-702f-7a8e18af2c67@huaweicloud.com> Date: Mon, 6 May 2024 09:36:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit X-CM-TRANSID:gCh0CgCH_nAQNDhmVahmMA--.56236S2 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUU5R7kC6x804xWl14x267AKxVW8JVW5JwAF c2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII 0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xv wVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4 x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG 64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE14v26r 1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62AI1cAE67vI Y487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI 0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y 0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Zr0_Wr1UMIIF0xvEx4A2jsIE14v26r1j6r4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07UGYL9UUU UU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ on 5/2/2024 12:56 AM, Tejun Heo wrote: > Hello, > > On Mon, Apr 29, 2024 at 11:47:32AM +0800, Kemeng Shi wrote: >> Use [global/wb]_domain_dirty_avail helper in cgwb_calc_thresh to remove >> repeated code. > > Maybe fold this into the patch to factor out domain_dirty_avail()? > >> + global_domain_dirty_avail(&gdtc, false); >> + wb_domain_dirty_avail(&mdtc, false); > > I'd just use domain_dirty_avail(). The compiler should be able to figure out > the branches and eliminate them and it removes an unnecessary source of > error. Sure, will this do this in next version. Thanks. > > Thanks. >