Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp121145lqt; Wed, 5 Jun 2024 20:24:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUD49Rx1G5toErun664TO35kO25lvr6DkFk/reeNXY3dFTAAnh0XlFqeQXwuvdkkhkVI7YLZjLCMOkWhucC7ckAT35U2zBeBpZv1aHtfQ== X-Google-Smtp-Source: AGHT+IEM8wgg4/M1o+PIFhBbIc1wkWYn218sgeYBINXEm09wRGYndv10CCxPNbcpb9/TWYHROUhm X-Received: by 2002:a05:622a:3d1:b0:43d:e767:f106 with SMTP id d75a77b69052e-440362c9f7amr31369571cf.30.1717644298247; Wed, 05 Jun 2024 20:24:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717644298; cv=pass; d=google.com; s=arc-20160816; b=yctTT09amG1B+E30D3QO1Eqwm2LjNDkzPQpQ0vGCkaomxPetiJqtu1QTR+PY+EWPis YF2ZhXcJ4KmylcdcUYQdknx2OFEcnzTu8cpsBc4hEhQXsWHsEr4z1hAtkPQgcrw/fId1 DcuyHap70Lz+7rSMgbVAT7+b88P+7HCczaX4lMFXoPtvrPV0fkuraRLhaZTj/8JsoNX+ kP1EHD06kPo4JZz/ulJalfOBb01YWnXbplCqgHlRdhqBoJVf7eD2JGUWGbumN95IPGAt 3FlhfP2jNUXQCobCpAyyMTLCV0mBYKXm1ml2tLHBArAal9pUgGMOdew2jFj63GLZChBS V6Pg== 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=1KwFRM0LwHxm/QAzhm4p4dUi0VzFz7fJGkp+Hk01OTA=; fh=GZTfS0VTepRf0ufKVIhBquNy77Na34/GlAgEnckH/JQ=; b=kQfMHZPt5QLa3gyhPxLIHrQ/IYI1Yr6GhtC8s7tfkU1dGtkHe077Aa6DuDOe3KYiNj BkkJNGpT9LRD0rP3tU+1nQCJ9OZgMYrXqmJVb7e5qcklWEayAn7pjNUj6XMqImPZzedA YGsvdiy/BBgeqJg7LbAJ9fMcluqdPcyLGuODOnXE4CjVEI6XhJKhWCYw0X2pz3xaPwco 1FZgH48miCQ6H2+4w4qcMEYhZQaEroNzxiZyu0ipUbo5lECyfPP3Jkjqdy+AzFccLZtu pKSCTVwjaJU3g2IS20rdsBVNtrcjf00v+XsS725IXkPPkX+XFGSTdVzl62F+psR+VEKE lf8A==; 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-203582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203582-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 d75a77b69052e-44038a6e76bsi6130371cf.89.2024.06.05.20.24.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 20:24:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203582-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-203582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203582-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 E0F841C214FC for ; Thu, 6 Jun 2024 03:24:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 646401E893; Thu, 6 Jun 2024 03:24:49 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (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 E5CEF17BD8; Thu, 6 Jun 2024 03:24:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717644288; cv=none; b=tm9p9mH47VbvMK7x9T6Va2vlwJ/nc4XyL3N/LiSgmyS4Se9EGL2yptI05qO663Cj7OO2Jl1QruAxeHfGQsUhxkUAFVYIfM9QYSRD+GzK1ZjQlOaUtApbuWyinZdu+w5KuCalsBULbLUojbc77NmdtsKfZhe0LIN0xvtatwjf7Ew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717644288; c=relaxed/simple; bh=EeTpYbZng4Y5bfpMT8WReGs6mMWFJe0SV0m03KYwY3M=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=FMoJE9Xnwfba+4tdw7TflACk3bvWtognmZu41hmsi+cXPK/WXzzmHo6hZSzKsJrjkL7azqY2zgKE9atQPca/CI951sCtRMzzJwp5HPq6idzi2BjjVXMydpz5diJwFvOPW3gBcQh9S9mBymnYuoB0mTcERIGqpzRETX1HC7FfTtU= 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.51 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 dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VvqST1C9mz4f3nKW; Thu, 6 Jun 2024 11:24:25 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.252]) by mail.maildlp.com (Postfix) with ESMTP id 556A31A016E; Thu, 6 Jun 2024 11:24:36 +0800 (CST) Received: from [10.174.178.129] (unknown [10.174.178.129]) by APP3 (Coremail) with SMTP id _Ch0CgAnMJjyK2Fmz2rqOQ--.40149S2; Thu, 06 Jun 2024 11:24:36 +0800 (CST) Subject: Re: [PATCH v2 8/8] writeback: factor out balance_wb_limits to remove repeated code To: Tejun Heo Cc: willy@infradead.org, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240514125254.142203-1-shikemeng@huaweicloud.com> <20240514125254.142203-9-shikemeng@huaweicloud.com> From: Kemeng Shi Message-ID: <6d5e260e-4910-92d1-faf4-8aee0b78b16d@huaweicloud.com> Date: Thu, 6 Jun 2024 11:24:34 +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:_Ch0CgAnMJjyK2Fmz2rqOQ--.40149S2 X-Coremail-Antispam: 1UD129KBjvdXoWruFyrWFW8JF4UCF43Zr4DXFb_yoW3Wwb_WF s29aykKw4UuFs7ta1vyF45J34xGFWrXryUZ348Way7C34fAa1UWay5WFyav3WxJr4IkF9x W3Z2g340kry2vjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbzAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwV A0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x02 67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I 0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07AlzVAYIcxG8wCF04k20xvY0x0E wIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E74 80Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0 I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04 k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY 1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUzsqWUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ on 6/4/2024 2:09 AM, Tejun Heo wrote: > Hello, > > On Mon, Jun 03, 2024 at 02:39:18PM +0800, Kemeng Shi wrote: >>> Isn't this a bit nasty? The helper skips updating states because it knows >>> the caller is not going to use them? I'm not sure the slight code reduction >>> justifies the added subtlety. >> >> It's a general rule that wb should not be limited if the wb is in freerun state. >> So I think it's intuitive to obey the rule in both balance_wb_limits and it's >> caller in which case balance_wb_limits and it's caller should stop to do anything >> when freerun state of wb is first seen. >> But no insistant on this... > > Hmm... can you at least add comments pointing out that if freerun, the > limits fields are invalid? Sure, will add it in next version. Thanks > > Thanks. >