Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp10081784rwb; Fri, 25 Nov 2022 00:23:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf4x/ZOeUXMkOIGjdAbNvpeLrF1gKmDPvrhx4ij8+b6Dw9Z0kWxNoLhA0Z5ZtM330em73OV+ X-Received: by 2002:a17:906:7f15:b0:7ae:5035:29a0 with SMTP id d21-20020a1709067f1500b007ae503529a0mr31015860ejr.1.1669364607829; Fri, 25 Nov 2022 00:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669364607; cv=none; d=google.com; s=arc-20160816; b=k04rCbrl2kvGLbSzmE+UEydC70v2tEmIwy8sJXJRd34B5ShN4o92QGnnJA+i8OdZX8 QsPsWMDEJ+8SEtoJeCpgFlH7gSVNUKMJeLupRORkayGj8uVzjyS8x+QIQ3Wg4SJ5TBDX hJRzzaR4uvVsk4Oxc4VeHV2B3W9637sNsIvK38hutCZvz7aUdjwdSsf9T5mRRQU9F54c Sn7jpvSmmY5zNHrUgyZu/CxPTp4aHVjmavzoKnwCuCz8/9NaOzlGdvVA+EPLUMpLlLP9 8wctoLXDgENePdwsfWX69/H2w0NqN0ngX+LAS5rlx8ej/j/zVBZiPCdfR3UG8P7xqTAm VjuA== 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:dkim-signature; bh=F+6fVVB9BmEJEqb7Ji1ITmJk4l6XMki34cizL1NoHWs=; b=TdJQHMdOGWPm5eyLjoeRafrq30c2xUeiF5wjdvFUqtdPetD5loTRRHsMDjvhVrWaVD F6Y4MAn2oPao0HhUG+3eVF/yFDNgJdMmtA/llUT9DTsUD5TmVg6IoBPE9sG8p4GZpcUx BwfP8mv3vJa0kCilh+DLiK71k3f6OiGUz5rFx0O4HWMJ8lEZ9x1iMUokd/tpFlr93upg H5Jrl+3cIzz+38eH0n0Ms1/f9srrPgqZ6ucYsAbnizN7OvNQwvdDCm9Vpwy2IgF/7H4d aHMni1Oz7iCLtA/JaOUpmGIcTKM70HksG8PqbxwJ4/vICyExikcrPtqJkUb8f8dfasRV Wl0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shopee.com header.s=shopee.com header.b=aeRBe+pU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=shopee.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v22-20020a056402349600b00461bde34a12si3215569edc.627.2022.11.25.00.23.05; Fri, 25 Nov 2022 00:23:27 -0800 (PST) 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; dkim=pass header.i=@shopee.com header.s=shopee.com header.b=aeRBe+pU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=shopee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229763AbiKYHv4 (ORCPT + 87 others); Fri, 25 Nov 2022 02:51:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbiKYHvx (ORCPT ); Fri, 25 Nov 2022 02:51:53 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C5A32F395 for ; Thu, 24 Nov 2022 23:51:51 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id x13-20020a17090a46cd00b00218f611b6e9so3450257pjg.1 for ; Thu, 24 Nov 2022 23:51:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopee.com; s=shopee.com; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=F+6fVVB9BmEJEqb7Ji1ITmJk4l6XMki34cizL1NoHWs=; b=aeRBe+pU/jO8Gy99w737xR904Bnhj4f7us8VIYn/UcNkg7f2jsbMct+LXkjRtIQnXR GZsrEFlwJuhFVxyPqBGmEIRpqO1FUKXM+fTwxEUSoYWST4Y/WaxRTmuzz2+1Gn+fppTZ /JbZzmq3BnXoadA6T17FouZYezsATwTr6Xi7CQprNDZNyatcjS2yA7j2G/euX6k/iJFo 6tjj1W4cPapz8lnuiHq92v5HPGUBDqQLBnfjzSMHtAPCU+UGMnI/wzefa8on4hZDwhIM FTAUduVWvQWY+fGycu13uGrVnHNZ6sUez7Ijg+hMOJ1pNf8Q61ISQpLn1tLexhw73YUq LsnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=F+6fVVB9BmEJEqb7Ji1ITmJk4l6XMki34cizL1NoHWs=; b=g2M6LSqBJ/jgyHE2ynF7ccewJEQP2qf+kznWl+G09QQTvcpxinvO8rPvj4naempoWL 9SimecldKBR/C50TVFNijUNrp8IU/yi2/3vW2NlL7N/2yM/2thhaE0/qMzrIl23zeCnn kcH3xNlYtI+5hyGaQpJg/SPwMnJ3cdTXkYcXgXa0mqtGM5ramdbvoLVFd7CVo0XQzLTa jGRONt8I6bhkiMPf3jiOw0mrbVATEFbMO0myzdUhd1sOT9Bz6ef8UNlcgejnI2un4hwz jBRNP2+DpXwe78p0JTGVEWE0qjudGhC+uxR0nMhCMvmcsvmGuevuewku/m+N0YoDbiVV gUKA== X-Gm-Message-State: ANoB5pmX3mbtSlprs+ppym7wvTIXJxyn1TvEZZKpdSOXMyQbKJo7b4Yc N0BgXG8fBJr4dIdlNBzUf901ZA== X-Received: by 2002:a17:90a:5918:b0:213:ff:1cda with SMTP id k24-20020a17090a591800b0021300ff1cdamr38252467pji.86.1669362710755; Thu, 24 Nov 2022 23:51:50 -0800 (PST) Received: from ubuntu-haifeng.default.svc.cluster.local ([101.127.248.173]) by smtp.gmail.com with ESMTPSA id 6-20020a621406000000b0057447bb0ddcsm2433271pfu.49.2022.11.24.23.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 23:51:50 -0800 (PST) From: "haifeng.xu" To: longman@redhat.com Cc: lizefan.x@bytedance.com, tj@kernel.org, hannes@cmpxchg.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, "haifeng.xu" Subject: [PATCH] cgroup/cpuset: Clean up cpuset_task_status_allowed Date: Fri, 25 Nov 2022 07:51:33 +0000 Message-Id: <20221125075133.12718-1-haifeng.xu@shopee.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 cpuset_task_status_allowed just shows mems_allowed status, so rename it to task_mems_allowed. Moreover, it's only used in proc_pid_status, so move it to fs/proc/array.c. There is no intentional function change. Signed-off-by: haifeng.xu --- fs/proc/array.c | 13 +++++++++++-- include/linux/cpuset.h | 7 ------- kernel/cgroup/cpuset.c | 9 --------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/fs/proc/array.c b/fs/proc/array.c index 49283b8103c7..e6cdef8387e6 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -80,7 +80,6 @@ #include #include #include -#include #include #include #include @@ -413,6 +412,16 @@ static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) cpumask_pr_args(&task->cpus_mask)); } +static void task_mems_allowed(struct seq_file *m, struct task_struct *task) +{ +#ifdef CONFIG_CPUSETS + seq_printf(m, "Mems_allowed:\t%*pb\n", + nodemask_pr_args(&task->mems_allowed)); + seq_printf(m, "Mems_allowed_list:\t%*pbl\n", + nodemask_pr_args(&task->mems_allowed)); +#endif +} + static inline void task_core_dumping(struct seq_file *m, struct task_struct *task) { seq_put_decimal_ull(m, "CoreDumping:\t", !!task->signal->core_state); @@ -449,7 +458,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, task_cap(m, task); task_seccomp(m, task); task_cpus_allowed(m, task); - cpuset_task_status_allowed(m, task); + task_mems_allowed(m, task); task_context_switch_counts(m, task); return 0; } diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index d58e0476ee8e..30b91116dd2f 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -112,8 +112,6 @@ extern int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, extern int cpuset_memory_pressure_enabled; extern void __cpuset_memory_pressure_bump(void); -extern void cpuset_task_status_allowed(struct seq_file *m, - struct task_struct *task); extern int proc_cpuset_show(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *tsk); @@ -246,11 +244,6 @@ static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, static inline void cpuset_memory_pressure_bump(void) {} -static inline void cpuset_task_status_allowed(struct seq_file *m, - struct task_struct *task) -{ -} - static inline int cpuset_mem_spread_node(void) { return 0; diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 589827ccda8b..5798d4231662 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -4045,12 +4045,3 @@ int proc_cpuset_show(struct seq_file *m, struct pid_namespace *ns, return retval; } #endif /* CONFIG_PROC_PID_CPUSET */ - -/* Display task mems_allowed in /proc//status file. */ -void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task) -{ - seq_printf(m, "Mems_allowed:\t%*pb\n", - nodemask_pr_args(&task->mems_allowed)); - seq_printf(m, "Mems_allowed_list:\t%*pbl\n", - nodemask_pr_args(&task->mems_allowed)); -} -- 2.25.1