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 52CBFC433EF for ; Tue, 2 Nov 2021 01:27:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E61AA610CC for ; Tue, 2 Nov 2021 01:27:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E61AA610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 274F8940036; Mon, 1 Nov 2021 21:27:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 22644940014; Mon, 1 Nov 2021 21:27:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0EC64940036; Mon, 1 Nov 2021 21:27:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id F28D1940014 for ; Mon, 1 Nov 2021 21:27:12 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AB6BB18352262 for ; Tue, 2 Nov 2021 01:27:12 +0000 (UTC) X-FDA: 78762251946.01.97119FA Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) by imf04.hostedemail.com (Postfix) with ESMTP id 198C750000AE for ; Tue, 2 Nov 2021 01:27:04 +0000 (UTC) Received: by mail-il1-f180.google.com with SMTP id j28so13928345ila.1 for ; Mon, 01 Nov 2021 18:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1A7HDzhjdY5hn/pnJsq/whbXnb304U4AQcYBouiJz5U=; b=gVAfAFQLVbuCYZGlc3nitOWxinUlm2TcBUuG/WlQGM3BrLv5p4TXRDeodF26CWvRzs ZGoGjmKunynS9wI1VaetPAatDYGmGJHYGKakCPE7PdTAGHIowtgrLF8h/wBOMRpSmkCb h/nLqK0DU9zeU/OwhhKE90uSO4CvWpQm9iqyCuXODjos8g2s1kMZesERgRTUZgBZD3hA bQc949JPfUmv2wtymyRRvl4GWMCziqOLyoYioMRGj/UOo0gPWXWfr8aqG3uh3K8MlYYU 7i5UGljnYemx6aIldJ5YDFDeSCl9AcggxU81rjZqNGVsyR+s5CPE+VNzSLVbI8Ux/vQ/ zeLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1A7HDzhjdY5hn/pnJsq/whbXnb304U4AQcYBouiJz5U=; b=t7gIJ56jTGakDXgIhrTUsKRYZVOkEdeEDhDNqGN6KEGqRmcDLxUOUQfVydO1yysxrI 4FY/0yAxEd56RNbx0NoD5Qcwr6xk05GKp47toLlT1wi0mKSUry2KBG1J8p0SLET4/gg5 Jj1VtsSSAIwmqtIo4KgCLTDecbCGOoZn39/UpY7KUJk1gWAuFaloMCYvs/FoekuQM6kf 1eUvRTBSEBRmfcXmUUXPG63k3bk39PNB4wrATBR6+Ml/rzF8lqyROYRJkmJQofrRnOsD G2ElVJn/apWnIp97Nq8Bewy6npGXS/nxgSDA8Vo8s/tihG9XvOYi2Czf8G7AgVE6VWLj vZOw== X-Gm-Message-State: AOAM531BRGCZ6e22zx87zUvmoMGWwQ+OVDqaxex7bAIxxt3+8wDbVRZg Ir7J+vTSLaTe31grQlrvBGMJEGysc5lLNUJyOAw= X-Google-Smtp-Source: ABdhPJwJBgI9aj//vf3EJRPnVnyMFDHNeTLdubr4rkK45Z1kExg7tk3zFAbc3ycTSpUCPYjcZYjJcVnOD/l3RuhtfVg= X-Received: by 2002:a92:c112:: with SMTP id p18mr18365849ile.52.1635816431697; Mon, 01 Nov 2021 18:27:11 -0700 (PDT) MIME-Version: 1.0 References: <20211101060419.4682-1-laoar.shao@gmail.com> <20211101211845.20ff5b2e@gandalf.local.home> In-Reply-To: <20211101211845.20ff5b2e@gandalf.local.home> From: Yafang Shao Date: Tue, 2 Nov 2021 09:26:35 +0800 Message-ID: Subject: Re: [PATCH v7 00/11] extend task comm from 16 to 24 To: Steven Rostedt 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 Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 198C750000AE X-Stat-Signature: tgq59xspoz3qszaz4es3d3pkwgb1rns8 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gVAfAFQL; spf=pass (imf04.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.166.180 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-HE-Tag: 1635816424-39117 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, Nov 2, 2021 at 9:18 AM Steven Rostedt wrote: > > 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. > Sure, I will add a new field named "full_name", which only be allocated if the kthread's comm is truncated. > > > > 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 -- Thanks Yafang