From patchwork Fri Jan 17 01:46:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chen Ridong X-Patchwork-Id: 13942785 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 7390FC02187 for ; Fri, 17 Jan 2025 01:57:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B2FAF6B0085; Thu, 16 Jan 2025 20:57:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A6E766B0096; Thu, 16 Jan 2025 20:57:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 595CF6B0085; Thu, 16 Jan 2025 20:57:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 215866B0089 for ; Thu, 16 Jan 2025 20:57:44 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id CD514A14F6 for ; Fri, 17 Jan 2025 01:57:43 +0000 (UTC) X-FDA: 83015282406.18.AA0BDBA Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf27.hostedemail.com (Postfix) with ESMTP id 6AB7E4000C for ; Fri, 17 Jan 2025 01:57:39 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of chenridong@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=chenridong@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737079062; 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=vqfdCb/O0zTWB9L8PekKdPBo9VCHsK/drwN2wvM7elhPVby7FZQjsuFkCINCcsJXNiKSqc KRat+dnklwo+fgde8ASfmWct6CSqx+sfi1HCuLr0cYmtJAG1XV0e1Sb7n8xjLJUsM0XSof RdYpFCIc+bRs+oWWkpQcu/rBX3B6tYI= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of chenridong@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=chenridong@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737079062; a=rsa-sha256; cv=none; b=U54h/La4ZS2AsyslRRigXiufPJUEFcMafzt/tLnQnmthS4RsMZQ+IZdeFO2EgzdX3SZtm5 laAMHS0Ak+oYHUZDopDuWYSl2TiFREJBJCeimBpZ/3I7NiJqZNIxuYiiMsWdYDn2CPUa3o o8/dBeClkE/nd6dgATTFNHZhHRBdg4A= Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4YZ2t64tBMz4f3jsv for ; Fri, 17 Jan 2025 09:57:18 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id E79071A176F for ; Fri, 17 Jan 2025 09:57:33 +0800 (CST) Received: from hulk-vt.huawei.com (unknown [10.67.174.121]) by APP2 (Coremail) with SMTP id Syh0CgCnsWT7uIln8NWrBA--.20802S3; Fri, 17 Jan 2025 09:57:33 +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 v3 next 1/5] memcg: use OFP_PEAK_UNSET instead of -1 Date: Fri, 17 Jan 2025 01:46:41 +0000 Message-Id: <20250117014645.1673127-2-chenridong@huaweicloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250117014645.1673127-1-chenridong@huaweicloud.com> References: <20250117014645.1673127-1-chenridong@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgCnsWT7uIln8NWrBA--.20802S3 X-Coremail-Antispam: 1UD129KBjvdXoWrZFWrJF43Cw1xWF1xWr4Uurg_yoWfGFX_uF WkKr1DZr15J3ySk3Z0yrySvrnayF1UX347Kw45tw13AFyqqasYvF1vqr4vvw1kXr47try3 Cwsaqayqgw12gjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r18M2 8IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx 0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWU JVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628vn2kIc2xKxwCY1x0262kKe7AKxV WUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jjuWdU UUUU= X-CM-SenderInfo: hfkh02xlgr0w46kxt4xhlfz01xgou0bp/ X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6AB7E4000C X-Stat-Signature: hc6tyw6udamnjberqffyxj4ricqhogf3 X-Rspam-User: X-HE-Tag: 1737079059-979051 X-HE-Meta: U2FsdGVkX19UaxwqQaAg95/3tck6X0/V+TaeximQeCC0PkFNMw9mghe/xBu/d5xxHFbm/Mf8E5M12In8y0kDjwmNVp/SG9EnatdWDVMtRT8/NXsmD/4FC0/Li5/dzumKyAfQUzmfjOnEuwqenpSSqqOZY9j7KiK7/WkRqKUE9Fr15IWXdr/ajpc9q7b0UOWMRyYilWyvAlJ8sYadCBYjsamMpR7DLPu2TjNDibDnG4fGvEXghRW4ZzaTDsn/o3zVDDyCWgIFQILgpcKff99H3ycXCs2sQfTm96lzT0y/xV00xhBiAogqMPMViIqNLnk2ZHCYMgiweWZKxJaEHgzu6dqb9mKeP8BsZBla/lHwUEszzey0k0x2aW9ryP4V8fMwzOG/kLiSrozb/igtLUJwSVU/6KQwTiaIXV76EIZHxMVTRtFd63h8FFwK/Ev7v4JEhTkbNS+/PlSn/ah69MpcAzdMF5b8k96nlIFuNDhCZrwSRP0O05f6uDAkn2vOI/8FjsQTUXupCvOf2quBOYwUzGdAHKEosV8mFOVaWkLF0Gyx58ResFuxIRGLfR5II+bIwNj65dvjWbfnOMYmdwEwWiRceI46w5Y5YRZE+Lkz/PjKp3l7ybwsNPoxi3TYBc4pb7BoV6Re62zkz0PFmRuE1QdUKLFJ5FIeFD8Q13ZZb4HrqhmiUVdTrFWkIovSI+P+RV1Q2gUcZRen5I1DBvAX+9xWYappsksKiN2X7RvDh1otVL4kLnCkMJwLEXUR3gU7oT9r1pX+vYMkrZ2Te14NyLfue+ld9Sg/9c1p0TVtUQc3GYKUFy2E/u+IacEWp1h4353oGEgeiI/5qOFz4yT/KV/vVIp1laytPN3hz0UEo9rUxQ5zcXdtQVx9ViaB4ugtIGcoDRcUn1eawZNfODfHDD7I03Fj/67aQLoOz73ldnwHZZcOpZoUBTe1Tdgk9nIubZc6OrVKpwNF4q9ijRG euOs3ku9 g3I1bxLSUqkspQvuwpkNe76yZLDDSBq3K1c81+PcZR3QhUYox5aSktUpBh9bFkKBwJUDdNBtI0K7px3vF3OBMotW0hNvoGqJ+SsDezQIKxcCF8QOf0BiXfbFwtJ8T7WRhUS5Qi2FrR0z8dl0+tYq8qnaQCgHdgk1t9tA7X4C6gPpkmd98WAx2rnZXQwjwjOlpzqRBfRXecy/fgo5XMPHlDD9O189krSouw8ODA81X2u8oKGsmQc16b85ZzegqlXxEZvny61WlLpQmW/roTz6NIhfX+EoGVclnL7El8G7Rj3hMN4Y= 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 Acked-by: Johannes Weiner --- 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);