From patchwork Mon Mar 31 12:18:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh X-Patchwork-Id: 14033741 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 3313FC3600B for ; Mon, 31 Mar 2025 15:54:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4DEE28000B; Mon, 31 Mar 2025 11:54:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F9A2280002; Mon, 31 Mar 2025 11:54:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 847A328000B; Mon, 31 Mar 2025 11:54:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 61CD2280002 for ; Mon, 31 Mar 2025 11:54:44 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7BF771C7D9C for ; Mon, 31 Mar 2025 12:19:03 +0000 (UTC) X-FDA: 83281750566.11.27BF1BE Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by imf26.hostedemail.com (Postfix) with ESMTP id D7072140010 for ; Mon, 31 Mar 2025 12:19:01 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b="L+o/M001"; dmarc=pass (policy=none) header.from=igalia.com; spf=pass (imf26.hostedemail.com: domain of bhupesh@igalia.com designates 178.60.130.6 as permitted sender) smtp.mailfrom=bhupesh@igalia.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743423542; a=rsa-sha256; cv=none; b=L6Tpbj1Wd2c9CjoxXenRpz6TEsG4mm64M9DxAEac62xGpqy+iUN+9Vvib6NwPhfZAMgval 0WcdnVPCTZMJBrM4urt3mZJjf5ZUg+XiqJGGRHQkdcf2l502FIlMHovBRlYBgHbnhAsHJP 1DdNAvGKVp3KjvpDOlwkAr9RYLIEY5E= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b="L+o/M001"; dmarc=pass (policy=none) header.from=igalia.com; spf=pass (imf26.hostedemail.com: domain of bhupesh@igalia.com designates 178.60.130.6 as permitted sender) smtp.mailfrom=bhupesh@igalia.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743423541; 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:dkim-signature; bh=1MkSIgjVP+CNberSoyFKkoWthULoTCREbX6XMJGd8lA=; b=iphuzDU7xIUOOpoLu+xlavtf7t6zf402BYf1h1VXx4vR+CxYWeSil8vU7vumlM2rcaqf1q mlY0Fv/cWZumDg69iiY7ltQ5CY8SvNL9xOMszu2gxA/R9dZXLSiCJMMxMaVfLTWXf3NCAN TrONfsDxd+X6zMXq1snNeNl7NIChHRY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1MkSIgjVP+CNberSoyFKkoWthULoTCREbX6XMJGd8lA=; b=L+o/M001kDp9zhtwVq6l7nKazt X33DiETYaftD/OyEKT64sHULD1LqxAwwGVw2p50uEMaK8Qxw903OL83zpimWSnT/AHZUoHF86VBDT icgPE3a6B0BK5o0wn1dBYthmgxXQyzbDDZq1kMesB+zKwc85ztragw76N+q/2nRszAE1/kYMvEZdA gs+dsWb+iugK2xp8P6uKnQMf9F1HBIzIcT9OOqwqnFbHCzaIy6x4thyVVAfgzGoM2ve5QKQo15BI1 KnWXeXxsk2+zHZljLGAKzCB7cD/Wxt1H3wBSb9Hfk8+ifIoOJoYdN3Q3YToOJG3eC8hGhbtDze8ai 5mrotbzg==; Received: from [223.233.69.2] (helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1tzE6T-009Btr-M7; Mon, 31 Mar 2025 14:18:58 +0200 From: Bhupesh To: akpm@linux-foundation.org Cc: bhupesh@igalia.com, kernel-dev@igalia.com, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, oliver.sang@intel.com, lkp@intel.com, laoar.shao@gmail.com, pmladek@suse.com, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, arnaldo.melo@gmail.com, alexei.starovoitov@gmail.com, andrii.nakryiko@gmail.com, mirq-linux@rere.qmqm.pl, peterz@infradead.org, willy@infradead.org, david@redhat.com, viro@zeniv.linux.org.uk, keescook@chromium.org, ebiederm@xmission.com, brauner@kernel.org, jack@suse.cz, mingo@redhat.com, juri.lelli@redhat.com, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com Subject: [PATCH v2 3/3] kthread: Use 'task_struct->full_name' to store kthread's full name Date: Mon, 31 Mar 2025 17:48:20 +0530 Message-Id: <20250331121820.455916-4-bhupesh@igalia.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20250331121820.455916-1-bhupesh@igalia.com> References: <20250331121820.455916-1-bhupesh@igalia.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: D7072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QG NBfPynQRzAES/BgltAp95hxiQYC2vO8lJoX/IAryg+WAj8pYJD6gTxGdqaaoU/AIR8Qz2eE1XY9VXVumsn6vuYUX/IbXdSbrG8qbEGFAzgDShAZrGwRz5kSjz6WJse+JPem/+VofONBaXPJfYdakbcQrj6mW6aY5oyW4t3LmC2cWmKF6CMlCCZIfZqyntJNgJndZL7wvJO3S7/ZVNKXz0rU/XhYovacnv43otBOqBYSj4pg4nvYwsfvv6GA0ne5082tnWXXUTEBDjHeasyPJoeJq0mJiQogv/ho3PcwodeHx2yycaBgRmiALjbpqAZMiquvx+0ao0zKcYftXGmFYDsLOzLNjnmWcLhTYqnoDAOsF2iBPMsLaPjA00GLFGFk41lNiLqByAPxkB2yU= 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: Commit 6986ce24fc00 ("kthread: dynamically allocate memory to store kthread's full name"), added 'full_name' in parallel to 'comm' for kthread names. Now that we have added 'full_name' added to 'task_struct' itself, drop the additional 'full_name' entry from 'struct kthread' and also its usage. Signed-off-by: Bhupesh --- kernel/kthread.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/kthread.c b/kernel/kthread.c index 5dc5b0d7238e..46fe19b7ef76 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -66,8 +66,6 @@ struct kthread { #ifdef CONFIG_BLK_CGROUP struct cgroup_subsys_state *blkcg_css; #endif - /* To store the full name if task comm is truncated. */ - char *full_name; struct task_struct *task; struct list_head hotplug_node; struct cpumask *preferred_affinity; @@ -108,12 +106,12 @@ void get_kthread_comm(char *buf, size_t buf_size, struct task_struct *tsk) { struct kthread *kthread = to_kthread(tsk); - if (!kthread || !kthread->full_name) { + if (!kthread || !tsk->full_name) { strscpy(buf, tsk->comm, buf_size); return; } - strscpy_pad(buf, kthread->full_name, buf_size); + strscpy_pad(buf, tsk->full_name, buf_size); } bool set_kthread_struct(struct task_struct *p) @@ -153,7 +151,6 @@ void free_kthread_struct(struct task_struct *k) WARN_ON_ONCE(kthread->blkcg_css); #endif k->worker_private = NULL; - kfree(kthread->full_name); kfree(kthread); } @@ -430,7 +427,7 @@ static int kthread(void *_create) kthread_exit(-EINTR); } - self->full_name = create->full_name; + self->task->full_name = create->full_name; self->threadfn = threadfn; self->data = data;