From patchwork Fri Jun 16 06:30:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13282097 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 24275EB64D7 for ; Fri, 16 Jun 2023 06:30:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5CF838E0002; Fri, 16 Jun 2023 02:30:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5804E8E0001; Fri, 16 Jun 2023 02:30:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46F4B8E0002; Fri, 16 Jun 2023 02:30:54 -0400 (EDT) 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 3555E8E0001 for ; Fri, 16 Jun 2023 02:30:54 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0755BA0A15 for ; Fri, 16 Jun 2023 06:30:54 +0000 (UTC) X-FDA: 80907638028.28.1F26D24 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf27.hostedemail.com (Postfix) with ESMTP id 783B240008 for ; Fri, 16 Jun 2023 06:30:50 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686897052; 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=YSI/NQGNylKZLcMzILQ7Owkrd7NCoX2BdMcWi2FFmTs=; b=eUhbLdu8jDUr3wlZzVoDJ6iB965WZKPjBd6ITzdKTHtPBR3y2f9+0ehc0/jXUhv6rSW3NB BZiluUYtr9MrLAm+Qynmg8OleVjkExj609aMXedUTVqRdb3Pgq1kFvhbIVSqqmjfdXXWXR MzHtt5PwtGe0jB9TNaqf5SUNGH4Zn5E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686897052; a=rsa-sha256; cv=none; b=xWpvNtSZm87H5weua21k50blJia7LY4TXGZqiWGr+djrtMk/9t6m800iCh+172JL9XMkpA rlOwRI+djUDUtXK95WaTjxNI1dPfnmj0Br393GQYPnfG2Awo2hsdm6ASxlcccPPoKmtjj6 3qPPwNvD8ss0FlFKfmRcdvZ4JwRYS20= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Qj8L30xhkz18Lbg; Fri, 16 Jun 2023 14:25:47 +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 14:30:45 +0800 From: Peng Zhang To: , CC: , , , , , , , , ZhangPeng Subject: [PATCH v2] mm/memcg: remove return value of mem_cgroup_scan_tasks() Date: Fri, 16 Jun 2023 14:30:30 +0800 Message-ID: <20230616063030.977586-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: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 783B240008 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 9dhew56y865aot69qoaax1baeu1x7c7m X-HE-Tag: 1686897050-115892 X-HE-Meta: U2FsdGVkX1+id3Zo+APYzJiuKscO9Rgx5JiVApxa0yAnt13/ZyEAqdTOOuYQQK2WX3CU1GYbIn5nl7dvq6Nl4f2vuh7hnYpKwHst7b5MNAAe9TFTSFWbz4VuiFQE/GW06mOAkBxD2YpKDFtlA2eV+pTFDshWfINYpAX3Fog4T3sXPUE2qV3pyairDfimTlXFzjq+idnGQUucGt05JHIZ3MlohxSk/lueGk5OiuGuZmhyQ8DLmXlww3UJEduGKyZp/40JOGg33oWMxjKhEqO85mhoHv88vCWFDApVupMKFbEcyqF+y/NimRvLec7mVFed7qVpN79xUKnhTqiX5vDasSb5UJEZDUtY9gCxx10qYdHIulOlg3n8/+8tz17w7U8flXYHpY0WpNe3ZrZ+Hm3JN9Fbb+vdSSCFGpkm4eetjfAZklcp4qr6Hiv2QbBPm7YYZJ/NuDpixABw8Nc5G0Fzpp+fZb6u1XH1egYfJWhRLkpyDMAAN4Lu8ggDx/LwcQ5Zd8NK180hg3NVHqkD0xgsFvQHgXtAWhjzMPH0g5SnK2vsP0UH1+/6zCCXxv1qfGOagjhgooS/Rhqgl6/+o8wYXTMHEcuVqs04PWf7qrqi2ZRnkH96rPp9zIeYHZ5WAV7tMWo24ypjheJRNzvbOqaF4hH98GjuuiQPB+T72d7Ba+YIrUwZT1Bb6wTxNDm7EQXxFwX8ZUWey3m2DXdtu4pDIDr/UsCcXqO2/RMH3HXTixYj02nQbpktehZan+42tqph+ZLyrUaB4KJTxO1eYkSVarq2YdDjTzSKUc4I/BgrKorkoHUjhCUJpMNAMUb0vKCjjW/W5h2RWtjPQuiOGaVTLTspqe07IAy/lkk1bk5apZ8fCJiPYVVQjVsN4V16G8bPh8NGIzYSAXJz4qAXU2m4doRHBIuWYlXOQJGGGE77CV0roP88MJxT/VIGd0z9C8namBG7OsEb8vQzUKhzgfd tP/RZGYz COvuS0KRWEFIpQX6MYMBzaZ5JJ1gj298I88evIvenNa3LWOBb6ZAHOhxZ9YckL4i71+oLB8jsPFU1oghqJHNZiau6nGpoDbdRYNkgZ9bfToDdLloiqAQPvrFb8Kqy4s1m3iyDqckvlHg2DwegKGv6fc5V7EPsd6juF+BZ0iNgAq1+0+lv+FceeoPG5FS831V9ktZ7 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 --- v2: - drop redundant return 0 per kernel test robot include/linux/memcontrol.h | 7 +++---- mm/memcontrol.c | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index c3d3a0c09315..5818af8eca5a 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) { @@ -1364,10 +1364,9 @@ 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; } static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index cf06b1c9b3bb..a834b1edcde9 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