From patchwork Tue Jan 14 12:25:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chen Ridong X-Patchwork-Id: 13938733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B9F7C02183 for ; Tue, 14 Jan 2025 12:36:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 292C56B0085; Tue, 14 Jan 2025 07:36:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 242956B0088; Tue, 14 Jan 2025 07:36:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10A226B0089; Tue, 14 Jan 2025 07:36:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E1D8A6B0085 for ; Tue, 14 Jan 2025 07:36:18 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8BC26C0AE3 for ; Tue, 14 Jan 2025 12:36:08 +0000 (UTC) X-FDA: 83006004858.23.D42EAF3 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by imf27.hostedemail.com (Postfix) with ESMTP id 2F0A940016 for ; Tue, 14 Jan 2025 12:36:03 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of chenridong@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=chenridong@huaweicloud.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736858166; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UPKc7ft2JpOg+OAKWpamlj/AW0n8d8vPesZcgRRiI6s=; b=ea+DwgrXT3vX76KxWtfvmAwpd+6IAmCBbJk/Y131LpRuH1LUvztEkQ0mubnV7qRQff+1N2 mqYO1u8J3CAnuCOaIOfU9J4/pGYHYUC99Nln6a+pFe5oP3wyw0hwJvK0FRtjDA0pDq3hYr 8WUkNW7e9vIBUWY6DSP30IUmP9nKNlk= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of chenridong@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=chenridong@huaweicloud.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736858166; a=rsa-sha256; cv=none; b=Qk70OxNc1aGdeuuXH42Joh9NkI64VVcmQxg+3fwachZ4GshUdYkLfLZp/8k1C/VpTHPM3a /jtIWHiNXsym8s3krtvaBSZN0sM4kl8YyQNdqnCfLKqJ8rWthVt6xXZk0O4jMlRg3pyd8d h/xju1ZqWNx+FVggNgXRc+K+kuw/r2g= Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4YXTB26pTgz4f3jdP for ; Tue, 14 Jan 2025 20:35:38 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.252]) by mail.maildlp.com (Postfix) with ESMTP id 4D8971A1285 for ; Tue, 14 Jan 2025 20:35:59 +0800 (CST) Received: from hulk-vt.huawei.com (unknown [10.67.174.121]) by APP3 (Coremail) with SMTP id _Ch0CgB3F8IhWoZnN4KvAw--.1325S3; Tue, 14 Jan 2025 20:35:59 +0800 (CST) From: Chen Ridong To: akpm@linux-foundation.org, mhocko@kernel.org, hannes@cmpxchg.org, yosryahmed@google.com, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, davidf@vimeo.com, vbabka@suse.cz, mkoutny@suse.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, chenridong@huawei.com, wangweiyang2@huawei.com Subject: [PATCH -v2 next 1/4] memcg: use OFP_PEAK_UNSET instead of -1 Date: Tue, 14 Jan 2025 12:25:16 +0000 Message-Id: <20250114122519.1404275-2-chenridong@huaweicloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250114122519.1404275-1-chenridong@huaweicloud.com> References: <20250114122519.1404275-1-chenridong@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: _Ch0CgB3F8IhWoZnN4KvAw--.1325S3 X-Coremail-Antispam: 1UD129KBjvdXoWrZFWrJF43Cw1xWF1xWr4Uurg_yoWfGFX_uF WkKr1DZr15J3ySk3Z0yrySvrnayF1UX347Kw45tw13AFyqqasYvF1vqr4vvw1kXr47try3 Cwsaqayqgw12gjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r18M2 8IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx 0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWU JVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628vn2kIc2xKxwCY1x0262kKe7AKxV WUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jnpnQU UUUU= X-CM-SenderInfo: hfkh02xlgr0w46kxt4xhlfz01xgou0bp/ X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 2F0A940016 X-Rspam-User: X-Stat-Signature: 9f77cne3tpf9cocs5dtsmkrhxc5epyuu X-HE-Tag: 1736858163-941162 X-HE-Meta: U2FsdGVkX1/bvPvzAPpjHH+pSN9heXnHTSgbFO3NxppSKY+mFJjzwyCKXWBLUlLthg51WbL5/SfVLtIvVYWwMJkEB06oQSfbatVgAYa6SKbQOUNnl6O2BN8IZo8qQJoasSRIfkmArCHNcKvH2jiPYufqLZvwLrnV67xk8OK9IDtiI0QuwVdr/O6ulIklpC1mNmTYpR5+DJiBkIov/3/yRyaF9GB0gBa3Uqb5bm6ols1EFx5EaRhbnpDqut4U9cmyUfj+iaaCGo/fLyScPYHnHhRNsVkbPP217C8gkcJCiVUGNqHOEwWLCJ3ZCHsorQQAl6JHqgOzFOScRNdhbYFMFIkKjTT8pYaCg34CLnGAcMI1OKF9Msf0PlVNUaY4S3Gp6xhyAreTJPmr1tOeDULGzp9R61zWmQWU12FhKjL4SMsXlwHmHXbDBujcWc7FK0wJgAkTZPJDwq4GqOdJ9gT+CG559yj8zZr5/6ph9gN99GgW7jSyS2PymWTMZO3ltItaltTH/JXBsHFV7+ddGO4/kO3P/VRDbbgzXj2JKEKmTplzUOF9zLIqJA3b0rmjxArEXUywAARuFxLOuq6s+FGucf31Um8tqOFulWGGWyTgzrv9VrvQzYK3T8V2xE8NDgqKyb1vkzvvYuvA1IiRbiR43xT3NsFEEx42axfVw03U5FLRFFYoWSVkOYD5DO4iViKimMj3sxddNGCfoqjYIJbx5tKK1at2v9KpOxpsQK5ZVAM4zDiYgPT3mXSO5Z+R98sjwd3aMjl5wS0i8/DeMdj4CGIAArfeiztwoywJz/xdXysuUNAz2ionjzUmhQfdXr2vFfSEbn4Gr3LT23El8DYvjnnqPdF5UeCVx6iqDqAYndmgJYbykyqe8YWKCDs4eL0OdFuOFNA5ynSunE7ZhnjAybT3HS61IohypMCeIGvEIwy6hrAtnihXIhAbKtzoG3XKkKJg4Xt6uqeyKsrD+uU 88rBdRiq fODbXHXusQSboPW4cz2baRFu1HNFRTw6E65Z585fyAawHyvuewA5ABxFxicyuLoV/kaKVtd+mLT2/XWeCf+db9nde/n2CKvoetr4Xrv+zKJGnL60z1B6HsR3FlOoh3pTA3iE8xpwna4LM3XLGUlyH5JTjR/br5ynFDd+el5jmEmgu5GuotNpydKsZUDR5xwYlSjVxPrFy2SNJkT/Qam65ARzCVXi/+RacaZtmW6yplFIiRNkigJna1cW2Xs8m/h7MXAhARzQzVxtxodoLCFCCBT9AMLHa8Yw4wrp38JARwPYmJLY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Chen Ridong The 'OFP_PEAK_UNSET' has been defined, use it instead of '-1'. Signed-off-by: Chen Ridong Reviewed-by: Michal Koutný Acked-by: David Finkel Acked-by: Shakeel Butt Reviewed-by: Roman Gushchin --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 46f8b372d212..05a32c860554 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4004,7 +4004,7 @@ static ssize_t peak_write(struct kernfs_open_file *of, char *buf, size_t nbytes, WRITE_ONCE(peer_ctx->value, usage); /* initial write, register watcher */ - if (ofp->value == -1) + if (ofp->value == OFP_PEAK_UNSET) list_add(&ofp->list, watchers); WRITE_ONCE(ofp->value, usage);