From patchwork Fri Dec 6 01:35:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chen Ridong X-Patchwork-Id: 13896221 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 80768E77170 for ; Fri, 6 Dec 2024 01:45:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B095B6B0150; Thu, 5 Dec 2024 20:45:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FC386B015A; Thu, 5 Dec 2024 20:45:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 578F36B0154; Thu, 5 Dec 2024 20:45:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1721A6B014F for ; Thu, 5 Dec 2024 20:45:12 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 921A0C1828 for ; Fri, 6 Dec 2024 01:45:11 +0000 (UTC) X-FDA: 82862840508.27.67E8430 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf15.hostedemail.com (Postfix) with ESMTP id 5E24FA0007 for ; Fri, 6 Dec 2024 01:44:50 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf15.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=1733449493; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aarG5x0F6As3NG//sAUTnErB/Ygp1DCXiUfC13G9XS4=; b=M4zV6UQnzRgK14dpID8txaWMhyOPjKoWbSgvpbE4SXR3BgZTp4VVVyGb/hnuRlQZVXuU9a kzGWesB3Pg5sTt768T1FW7sunJNztvm8q+PIBSWo5eVMjTQoZ4TFdQpSKCT8Nz5x5++GbG IxGPADJgcvIQzipCdr2kTc6LfAMZjXk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733449493; a=rsa-sha256; cv=none; b=yJYO5W9r5P+btS6pQdWHNyAKgkLmk1fOy7f+jpVLmmqnRYXZU03AvkwCgGoNhtTxvm0VjQ Ej60nZVHAj9HWvhzmWxdBR4tvxzLrdE15UEEqATXxLeqJI6X1CuQuI/dfDBbIKgW5a1u+4 tlb8eOGlJo5atEN1XGJMzqljXfzHq2k= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf15.hostedemail.com: domain of chenridong@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=chenridong@huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Y4Db43HrRz4f3jq9 for ; Fri, 6 Dec 2024 09:44:48 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 7FD281A06D7 for ; Fri, 6 Dec 2024 09:45:02 +0800 (CST) Received: from hulk-vt.huawei.com (unknown [10.67.174.121]) by APP4 (Coremail) with SMTP id gCh0CgD30oYKV1JnkkskDw--.31315S3; Fri, 06 Dec 2024 09:45:02 +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 Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, chenridong@huawei.com, wangweiyang2@huawei.com Subject: [next -v1 1/5] memcg: use OFP_PEAK_UNSET instead of -1 Date: Fri, 6 Dec 2024 01:35:08 +0000 Message-Id: <20241206013512.2883617-2-chenridong@huaweicloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241206013512.2883617-1-chenridong@huaweicloud.com> References: <20241206013512.2883617-1-chenridong@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgD30oYKV1JnkkskDw--.31315S3 X-Coremail-Antispam: 1UD129KBjvdXoWrZFWrJF48XF4kAF15tw4UXFb_yoWxKrg_uF 97Kr1Dur15J34Sk3WqyrySvFn2yF1Uuw1DKw15tw13AF9Yq3sYvF1kXr4Fvry8ZrW3try3 uwsYqayqgr12kjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb9AYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r18M2 8IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx 0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWU JVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628vn2kIc2xKxwCY1x0262kKe7AKxV WUtVW8ZwCF04k20xvY0x0EwIxGrwCF54CYxVCY1x0262kKe7AKxVWUtVW8ZwCFx2IqxVCF s4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r 1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWU JVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r 1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1U YxBIdaVFxhVjvjDU0xZFpf9x07jjuWdUUUUU= X-CM-SenderInfo: hfkh02xlgr0w46kxt4xhlfz01xgou0bp/ X-Rspamd-Queue-Id: 5E24FA0007 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: zqwg3heo1mqk4krs9q147drtdrdzc8ha X-HE-Tag: 1733449489-377970 X-HE-Meta: U2FsdGVkX1/9WrTPseqdk7ka1dkQ/cpbFU+XUb68r5xxYa9H0JAcNLG1eJ24TtKpzPfH3UbQBvQUT7OgO5PZVQk7pBabMJ/u18ebjeVcwmPHf5oClXmzPlJkI2UuMHUUsVgylTbdiwpNoKh0OrGKLCZ1MLyrtgCuo/zSV6aw5DugDXJofgml4LOpDCnzBwd026bdOPBKEf/hbPBkhetXFmUwxzTVP7uSd53Dv4iF8OpVI10depVhd4b0t7V5H9MMgmzSsQfh+k7Y6wueHn5v/J8q4lPuX4eFKaXcde43NfARuGtbBsT7Rz/+5t4POPoen6oadzZEH2sWEEJ5+YRG/HrreyPtVheHjrjf2Y0xM/nKXu3X0lB4nvT0y/DldujDxDl0qAFMdV8ugTxL3HjddFzcHwBY0QTjKNpwJLhLeodidu0N+KcdcRTayqXtsuXiEe8pAxO1fFLOXJw/EWRrnivdJweO8E9o52Tzl3vJt4zfvSX18hglUv8FLXmuEMYvmwPAEP490hYwBJWMcnzMON9XFHD/ysTvlVze0qAQazdBkoTpKltLfMli2TkRMyXRUgrh4IHa0Bxa8neZhFZ67aSYyEgCiO8rLVVDho1nA0zIgfEoIlSY9Ik7p+KRaNFn980mrgRc4W/oLrgigvt2oeowIR2EVWSV04FiPmVvgx/svEnhNU3HaPQXMwxac79vFUPUm3j8AOlDgvwZWZAuF6O1emTAmuZ+ee1DUQlABxONqykUx1jrmyoW3I8T2P17tusx8CB5kJDXmHnHGy226aXg6LFCl/FLxxmzSZRYZQxRCZH35Drjm2GORSv3/DLn4uaZVVU1jsGMvch6tvHNBT1Oq3EWSbzUPLATadkWb13/yqf5pIcgXmmrB9nGk0mY4xu/9IwYDMIT4KhXw0QQH4a7u5XEFzaprO7PXkohdp7kNBlFMFZms4paDbo30Qwtv0eDRlh3igrJJPozGEs FnHo/JV3 RnzTg54iWfSEd2BZlS4++A9UWYsTyTbRSv4cTvZRd8WIu9Iu7vuiKA4UdTkpeA2NYPKawn0ODX0XtIeezrgMqIMUGFD8lO8wRQiQ4hLBnkFm0J3RJlQ46S4zkta2BXpUryRpUTJqhDSaC80rRA134Nv0RaMmAfiqBwSTgMoVO7EReP2j5t6OhHvmcgw== 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 --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7b3503d12aaf..fc18633aba5d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4014,7 +4014,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);