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: "zhangpeng (AS)" X-Patchwork-Id: 108868 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1126786vqr; Thu, 15 Jun 2023 23:36:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Wbe5T1qZXw93VwWKoKzfo9ftMwI2nL48o8pLZ8j4EZNBBArP+eWz7Ls3/8W0JYt3rf/bm X-Received: by 2002:a05:6359:5a4:b0:12b:e45b:3fa7 with SMTP id ee36-20020a05635905a400b0012be45b3fa7mr798654rwb.6.1686897396947; Thu, 15 Jun 2023 23:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686897396; cv=none; d=google.com; s=arc-20160816; b=bzri8jD3gtdbV8zTEjEbBUal50kWySgMf+JpSV+pOhSipxOuVg8g0iCTsQ8Zbek27/ leKhusyPst4ugq8QJGJ2cWDOS6BD6JwTwcw8MoClp7wFDidqhIVHyXnF35O7l3XMYAus /iwayi57EPiedvvSXgYRSMQSsFfxjWkhFjC806hkgxYzoQNQi5kpAAq1lb5vBinzqplt u+tz6ywudPdaDcSjsqU0GW6E18NtK2auelG09lQVR+rmeYSWO36pI33W0PVoydTEW+Zd UB+UaBLE5QaMsBjfWGMyAlcGDdTYECaKL7eypnnW1I9CsnGUJ8Wfa0uqxH1gjaeIAhfu Bofg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YSI/NQGNylKZLcMzILQ7Owkrd7NCoX2BdMcWi2FFmTs=; b=CecnTyLLXmShhdjR4TmHnffEq4HlNtlGfQWdxMssLDQ7LNZhGH6qBhctJyG+H36Jyj DxIh6EgHHseIBFm52JRdXCREjFSKSLUyZ8/+zLkW6iNR3wmzHM6xHrsa6zC5B5Ze/fl7 TZZO4lqsj+0/HLo7MhM1vrQmBxh3ILMC5tZOhgvfCXl5K4pRdm+1x8aMD3idy2NbYXUn sXzuVHtWMd1kVUOSNsFIkCOmGBx/3PmczJzEwgxMxt1abnUOUe5s9Iv4sKdklETr7JJB YflZ/+dNUnmPmPDnSS7feHNU/+td7xLGtmfzKLM9tfc6xl6rPq9o2+Oal0s9sLnU1ad6 amXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a6552cb000000b005349009f1desi10996246pgp.354.2023.06.15.23.36.24; Thu, 15 Jun 2023 23:36:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241775AbjFPGbr (ORCPT + 99 others); Fri, 16 Jun 2023 02:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344016AbjFPGbS (ORCPT ); Fri, 16 Jun 2023 02:31:18 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 699632D68 for ; Thu, 15 Jun 2023 23:30:49 -0700 (PDT) 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768824574211107213?= X-GMAIL-MSGID: =?utf-8?q?1768840124958573816?= 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