Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3329290lqp; Tue, 26 Mar 2024 06:30:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQGXc5iig5u7jPvxLuajuZD81RFPuVyWGCh1djUCNbVTd/Sm5gFcGtIOXiVz9MZ1bDBmjwaeITRwISg7MD2SDjeZwiX0v6yhdzn+Xy2w== X-Google-Smtp-Source: AGHT+IFoSgQJDZkjm22zsmx0hVOYL/39ig8sgHSMj4Sj+bjgA2AH9gTJm3ELbSIlFTo4kRQ1Ut6D X-Received: by 2002:a17:902:d50f:b0:1e0:b883:a122 with SMTP id b15-20020a170902d50f00b001e0b883a122mr8055942plg.46.1711459841070; Tue, 26 Mar 2024 06:30:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711459841; cv=pass; d=google.com; s=arc-20160816; b=fFADU2YmkPH1qmK9WlavARW7WQUjmsTpIwjbmJ0kQEEY3FjPBMX9qb/bf4/KFsTsjg ydEe+MdaOlSzOYeVGtO34t3T2vzIrdQSXpS76oNS8OPGebVLnsCto+cwITqQneb/NO1H YrmtXXe5MlFBmSXxFHnnEF1YjQAZz32tueq8uPFTypy8DA/oJC0uqnT1SppF/gYmgBnZ 1bpz6mx04HYkXQO9sDTX5bbrGWKVUbcpsJkT2DQvvo4P0g9j8O8r598LxeK4xRcE1FlZ jarHm7aTfTY5mWYjMA+arFQ1u0gAXfHcYKx0EPSe0iRlRWQoITFGqYVO7jgVJiw0qSSG xBBg== 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=uJd1/8iCFzjZxOfnwPLJ6P9UHKR1DwBw2yqpIj4Z9L8=; fh=UTltJTs+wAXkLdI2ZvhGWzZhEPCz4GS10C+f9LZR+Fc=; b=Zq26wu/Wm/xShCWEx1Tn5f5Ajo96Kg1pZDqKrXHmyD+t4cVqnx8eb+QHlwoyhlsja4 B8pRnW80/9fMQGUQsXTRXO3P3TLum1+KFMv1miCJI+vhx4VC9uz3iBTHKPvWqVZzuNoP fQ/EulJsUkKhmNaSmWdQfk30WWbqwCwxzZVuSmrl46GXtZm3MTwDlnqdAOkjU9ikpdAd DaJZeYsH5GbCanlhE2qVPotrDk3+mzzvWLaA4muGfXmBCvu9Woe6rkmg/1FjyqI3zqXq GpmtxhkzznQYHgcHMkgi3sFOlS3zO/6s3aXJJ7hSC5+uaj+iHlOnCce/8wBp+e9vUR+a gExQ==; 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-119058-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119058-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e8-20020a170903240800b001dedc759e17si7609950plo.259.2024.03.26.06.30.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 06:30:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119058-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-119058-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119058-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BA3182E4DDB for ; Tue, 26 Mar 2024 13:30:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41704745DC; Tue, 26 Mar 2024 13:30:33 +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 441FB70CC2; Tue, 26 Mar 2024 13:30:29 +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=1711459832; cv=none; b=neSN9XbzZ33b615wj6Q3Wh8GUfttVKIQL+lOf2KtI914V5Im/AVS5XyKvPGFbCH7IJkucap3ZPhwH7UbT2+R9ucrNZ6n5vanSNwGhnT11+FHOz/b3fr8DPXUcM+3npCqW+JBpouHQA8+hQlN4njF0hajVBy/le4vXu2aiXoTy8E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711459832; c=relaxed/simple; bh=4lRRYxCm99C7bS5GE8+hJil4QP2rifr8KGGpETgr1Cc=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=UEIdnwxCmxuPDSuFEhkVQr1SIf9q4+9+TqNUTBX1OK6SUPtXW+ziteQQqrRRXfOlgL46jGZI7bA9pH6DuUHwDri9Cbm48+tW50gNcWwtt88mMwMsBDz1nu/2N8tQ1IKfx+QUIZOAv77yYgY27fQBkuU/wR45myL7B6+0m33zbQU= 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.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4V3rJk2brhz4f3jXb; Tue, 26 Mar 2024 21:30:14 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 8B44E1A0199; Tue, 26 Mar 2024 21:30:20 +0800 (CST) Received: from [10.174.178.129] (unknown [10.174.178.129]) by APP2 (Coremail) with SMTP id Syh0CgAnlQjpzQJmxEQ+IQ--.31963S2; Tue, 26 Mar 2024 21:30:18 +0800 (CST) Subject: Re: [PATCH 6/6] writeback: remove unneeded GDTC_INIT_NO_WB To: Jan Kara Cc: akpm@linux-foundation.org, tj@kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, willy@infradead.org, bfoster@redhat.com, dsterba@suse.com, mjguzik@gmail.com, dhowells@redhat.com, peterz@infradead.org References: <20240320110222.6564-1-shikemeng@huaweicloud.com> <20240320110222.6564-7-shikemeng@huaweicloud.com> <20240326123503.kxyxg75xr7wk3ux3@quack3> From: Kemeng Shi Message-ID: <2e1ac568-1883-700c-ba41-575f5db339c2@huaweicloud.com> Date: Tue, 26 Mar 2024 21:30:17 +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: <20240326123503.kxyxg75xr7wk3ux3@quack3> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit X-CM-TRANSID:Syh0CgAnlQjpzQJmxEQ+IQ--.31963S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Aw4rKr1xCw45Kr4xWr15Arb_yoW8KF4kpF sxGa1UKF45Ars29rnxCas7WrnIqrZ7tFZrKwsrCw4ayF4xGF1rGFyj9w1Iyr1UAr93Kry7 Arsrta4fZayjyrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvFb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I 0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1lc7I2V7IY0VAS 07AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c 02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_ GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7 CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6Fyj6rWUJwCI42IY6I8E87Iv67AK xVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvj xUrcTmDUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ on 3/26/2024 8:35 PM, Jan Kara wrote: > On Wed 20-03-24 19:02:22, Kemeng Shi wrote: >> We never use gdtc->dom set with GDTC_INIT_NO_WB, just remove unneeded >> GDTC_INIT_NO_WB >> >> Signed-off-by: Kemeng Shi > > Please no, this leaves a trap for the future. If anything, I'd teach > GDTC_INIT() that 'wb' can be NULL and replace GDTC_INIT_NO_WB with > GDTC_INIT(NULL). Would it be acceptable to define GDTC_INIT_NO_WB to null for now as discussed in [1]. [1] https://lore.kernel.org/lkml/becdb16b-a318-ec05-61d2-d190541ae997@huaweicloud.com/ Thanks, Kemeng > > Honza > >> --- >> mm/page-writeback.c | 7 ++----- >> 1 file changed, 2 insertions(+), 5 deletions(-) >> >> diff --git a/mm/page-writeback.c b/mm/page-writeback.c >> index 481b6bf34c21..09b2b0754cc5 100644 >> --- a/mm/page-writeback.c >> +++ b/mm/page-writeback.c >> @@ -154,8 +154,6 @@ struct dirty_throttle_control { >> .dom = &global_wb_domain, \ >> .wb_completions = &(__wb)->completions >> >> -#define GDTC_INIT_NO_WB .dom = &global_wb_domain >> - >> #define MDTC_INIT(__wb, __gdtc) .wb = (__wb), \ >> .dom = mem_cgroup_wb_domain(__wb), \ >> .wb_completions = &(__wb)->memcg_completions, \ >> @@ -210,7 +208,6 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, >> >> #define GDTC_INIT(__wb) .wb = (__wb), \ >> .wb_completions = &(__wb)->completions >> -#define GDTC_INIT_NO_WB >> #define MDTC_INIT(__wb, __gdtc) >> >> static bool mdtc_valid(struct dirty_throttle_control *dtc) >> @@ -438,7 +435,7 @@ static void domain_dirty_limits(struct dirty_throttle_control *dtc) >> */ >> void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty) >> { >> - struct dirty_throttle_control gdtc = { GDTC_INIT_NO_WB }; >> + struct dirty_throttle_control gdtc = { }; >> >> gdtc.avail = global_dirtyable_memory(); >> domain_dirty_limits(&gdtc); >> @@ -895,7 +892,7 @@ unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh) >> >> unsigned long wb_calc_cg_thresh(struct bdi_writeback *wb) >> { >> - struct dirty_throttle_control gdtc = { GDTC_INIT_NO_WB }; >> + struct dirty_throttle_control gdtc = { }; >> struct dirty_throttle_control mdtc = { MDTC_INIT(wb, &gdtc) }; >> unsigned long filepages, headroom, writeback; >> >> -- >> 2.30.0 >>