From patchwork Fri Jun 16 02:19:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13281946 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 DF047EB64DA for ; Fri, 16 Jun 2023 02:20:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C7948E0001; Thu, 15 Jun 2023 22:20:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 450906B0075; Thu, 15 Jun 2023 22:20:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F11F8E0001; Thu, 15 Jun 2023 22:20:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1C5A46B0074 for ; Thu, 15 Jun 2023 22:20:12 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D100C120AE0 for ; Fri, 16 Jun 2023 02:20:11 +0000 (UTC) X-FDA: 80907006222.28.950086C Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf30.hostedemail.com (Postfix) with ESMTP id 7C65A80004 for ; Fri, 16 Jun 2023 02:20:08 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686882009; 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: references; bh=BE3AogqImwZBiswtA5XmtQALGAHUDrL8VUSuCX8Kw4s=; b=FdYYPZsMav99IE/o13IUC3xvY9wgjcIsoTW0qWZ79sfMkRUJJzuv7eWG10dUZvUkC78oxz ItnRkEQscEZ01lYOwgsop3vKFpdj3Rv382RmJGSMFhrUKURKJbcgZ0wqFCvxV5KBQdnhJv /FDVjNkUX83TvQrpsdLQFJAHsS/0m9c= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686882009; a=rsa-sha256; cv=none; b=xKXqwK/YZ3BnX3YF2XRMT4D6fUH2K8i1lrN//xxZi8hD01VMn5PkRgADWL9hAdNdKo0GCt mpT1et1aMYn3MovGik+scIGak5Q7Ey0zGSTCj7bKNUaaVl87inz3z98SY0sFccLOCePYEF MI/Kxv1QHWbfJGL77/qvdutWvt7FwtI= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Qj2qZ3HbPzpWMt; Fri, 16 Jun 2023 10:17:30 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 16 Jun 2023 10:20:00 +0800 From: Peng Zhang To: , CC: , , , , , , , , ZhangPeng Subject: [PATCH] mm/memcg: remove return value of mem_cgroup_scan_tasks() Date: Fri, 16 Jun 2023 10:19:55 +0800 Message-ID: <20230616021955.872413-1-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 7C65A80004 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: dnz5ag8syu4tkrkrcdgbfnsms8o5hmhw X-HE-Tag: 1686882008-686288 X-HE-Meta: U2FsdGVkX18wT0G6+KQsfNhaNPvHX8ZNedOZ5jwEBt4dM5+UqDpjPRS9z9lZ0IxMWj/0LuTVn1yu645Khv0AKZrnFqp7TcOYAgl6nxw9rtJiV55ddzibnEw/Un4kIgWUDxxYHWkGskeDsztSr3cPzmU8mQ6+YOK1ydJDxBsgCaNpVrLuBRpRff5v0TVZQkpcYUxpXKKai6+rMi7e+gxS1YcDzc5scdscceQmrCeOjwRflPDdqfjPTxE1HeGWUyUW3A6HGG+Rc4woNTs0T890OxOa3P1Z3mtKad0DZ0KoSRtWj5jjNxD41T9vIARkOHodPmwimAP4sz31Jz8XQnh7OYEXAtaYrMDiJ7nitHM8+dqFhlBicNbjODjW3NENgdDQq5p1yrCflcmUYAq/va4eX+sxXaCK6ioLjwnUdrNzvPuGQIPj6rauRRZ/hQBHp17snWV8zmv1aLvnzi+4NB1QMGJ/ZYO0gpTnBiZDWbEp7kaF7ogw1eRA5u88YIwlNm4PB/WJBVlENXm2vyk8QsTRnLrpjFQK8sgVOUi6djkAPirT/ZJJQ51fDm2dBKM2dmRp9nYHLAMedUqMG8/xxJTW5FIf6fAFsfI+8jJ8STg3ZbF0Fq3AfpohEaqtVyPnv4hL3sjBsrihHuKIBl9heh+LiIIKJ97+7Qz0YDjiLwdywjlQXc7PCxGybX2IJi+P0sUo7KsMHusWfKza9cs5RN72SH0KmKJ87EV+jyNbZgOFoSyQQejNcM4kW2qYXdVF2ucGwyU15xDFvIIbV+CTxq6PXQylEoxRmZxqC1WUo3AJbG68q6WzkE5veZetr/CSYUztmRBP3+MW4g4JPPrrV0bzEBFKDjnOGEF3I+QyVbW2u0CBMgZdYYnw7amNep1iPFzMc6FRCTOpa2uWVW/y36Ic2PEIUA/5f5E2TA01ecpL+fGfiq7Q8Y4YNq7iyCevPE/133Uw2YkblHWuL3fBU9l lqNi35o7 p7CAxOx7Ij8nofpVDw9G95R7d0TE0RH5dfoVkz9FmEgGwyr0/OIMmTxV3F4VbicpqogNjmH2iyT3hwa33GE+gJT5nasM0Xl6l76TLOu3JhYeNJ8wlW885yi5QmHLV00frT8WDtQ73y8aA1miZbuAcjuUzULT/TCWB+quzmyqROEyhslCbNHVmHlJHvNEeTkxAMy6D 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: From: ZhangPeng No user checks the return value of mem_cgroup_scan_tasks(). Make the return value void. Signed-off-by: ZhangPeng --- include/linux/memcontrol.h | 6 +++--- mm/memcontrol.c | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 7738d8c0fa4f..c20375a77c07 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -820,8 +820,8 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *, struct mem_cgroup *, struct mem_cgroup_reclaim_cookie *); void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *); -int mem_cgroup_scan_tasks(struct mem_cgroup *, - int (*)(struct task_struct *, void *), void *); +void mem_cgroup_scan_tasks(struct mem_cgroup *memcg, + int (*)(struct task_struct *, void *), void *arg); static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg) { @@ -1366,7 +1366,7 @@ static inline void mem_cgroup_iter_break(struct mem_cgroup *root, { } -static inline int mem_cgroup_scan_tasks(struct mem_cgroup *memcg, +static inline void mem_cgroup_scan_tasks(struct mem_cgroup *memcg, int (*fn)(struct task_struct *, void *), void *arg) { return 0; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 0fe39ed857db..92a553b06f7a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1259,13 +1259,13 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg) * * This function iterates over tasks attached to @memcg or to any of its * descendants and calls @fn for each task. If @fn returns a non-zero - * value, the function breaks the iteration loop and returns the value. - * Otherwise, it will iterate over all tasks and return 0. + * value, the function breaks the iteration loop. Otherwise, it will iterate + * over all tasks and return 0. * * This function must not be called for the root memory cgroup. */ -int mem_cgroup_scan_tasks(struct mem_cgroup *memcg, - int (*fn)(struct task_struct *, void *), void *arg) +void mem_cgroup_scan_tasks(struct mem_cgroup *memcg, + int (*fn)(struct task_struct *, void *), void *arg) { struct mem_cgroup *iter; int ret = 0; @@ -1285,7 +1285,6 @@ int mem_cgroup_scan_tasks(struct mem_cgroup *memcg, break; } } - return ret; } #ifdef CONFIG_DEBUG_VM