From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5693DC433EF for ; Tue, 2 Nov 2021 01:18:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A1F28610A2 for ; Tue, 2 Nov 2021 01:18:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A1F28610A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0D293940035; Mon, 1 Nov 2021 21:18:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 080A2940014; Mon, 1 Nov 2021 21:18:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB2EA940035; Mon, 1 Nov 2021 21:18:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id DC87E940014 for ; Mon, 1 Nov 2021 21:18:52 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A6B0D1801E8DD for ; Tue, 2 Nov 2021 01:18:52 +0000 (UTC) X-FDA: 78762230904.09.E7304E2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf12.hostedemail.com (Postfix) with ESMTP id 247ED10000A5 for ; Tue, 2 Nov 2021 01:18:52 +0000 (UTC) Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF35F61051; Tue, 2 Nov 2021 01:18:47 +0000 (UTC) Date: Mon, 1 Nov 2021 21:18:45 -0400 From: Steven Rostedt To: Yafang Shao Cc: Petr Mladek , Andrew Morton , Kees Cook , Mathieu Desnoyers , Arnaldo Carvalho de Melo , Peter Zijlstra , Al Viro , Valentin Schneider , Qiang Zhang , robdclark , christian , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Vincent Guittot , David Miller , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin Lau , Song Liu , Yonghong Song , john fastabend , KP Singh , dennis.dalessandro@cornelisnetworks.com, mike.marciniszyn@cornelisnetworks.com, dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org, netdev , bpf , "linux-perf-use." , linux-fsdevel@vger.kernel.org, Linux MM , LKML , kernel test robot , kbuild test robot Subject: Re: [PATCH v7 00/11] extend task comm from 16 to 24 Message-ID: <20211101211845.20ff5b2e@gandalf.local.home> In-Reply-To: References: <20211101060419.4682-1-laoar.shao@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 247ED10000A5 X-Stat-Signature: dq7eu1sffgygz8ocu9hxffxnerxkkxy8 Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf12.hostedemail.com: domain of "SRS0=+33O=PV=goodmis.org=rostedt@kernel.org" designates 198.145.29.99 as permitted sender) smtp.mailfrom="SRS0=+33O=PV=goodmis.org=rostedt@kernel.org" X-HE-Tag: 1635815932-827614 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: On Tue, 2 Nov 2021 09:09:50 +0800 Yafang Shao wrote: > So if no one against, I will do it in two steps, > > 1. Send the task comm cleanups in a separate patchset named "task comm cleanups" > This patchset includes patch #1, #2, #4, #5, #6, #7 and #9. > Cleaning them up can make it less error prone, and it will be > helpful if we want to extend task comm in the future :) Agreed. > > 2. Keep the current comm[16] as-is and introduce a separate pointer > to store kthread's long name I'm OK with this. Hopefully more would chime in too. > Now we only care about kthread, so we can put the pointer into a > kthread specific struct. > For example in the struct kthread, or in kthread->data (which may > conflict with workqueue). No, add a new field to the structure. "full_name" or something like that. I'm guessing it should be NULL if the name fits in TASK_COMM_LEN and allocated if the name had to be truncated. Do not overload data with this. That will just make things confusing. There's not that many kthreads, where an addition of an 8 byte pointer is going to cause issues. > > And then dynamically allocate a longer name if it is truncated, > for example, > __kthread_create_on_node > len = vsnprintf(name, sizeof(name), namefmt, args); > if (len >= TASK_COMM_LEN) { > /* create a longer name */ And make sure you have it fail the kthread allocation if it fails to allocate. > } > > And then we modify proc_task_name(), so the user can get > kthread's longer name via /proc/[pid]/comm. Agreed. > > And then free the allocated memory when the kthread is destroyed. Correct. Thanks, -- Steve