Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3669556pxb; Mon, 1 Nov 2021 18:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoc8WqgltOXWv4Wcqab59T7ZVWIqCXETYWPYso8ZWYHideM18a/FMijyXkDSQPvzZK8YaK X-Received: by 2002:a17:906:4fcd:: with SMTP id i13mr2551072ejw.472.1635816607806; Mon, 01 Nov 2021 18:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635816607; cv=none; d=google.com; s=arc-20160816; b=jrvP5O4zFHS+254VVt2N+uNzhQljn1YzrzIvOQYLFv6WNPR+k6N86xATMrBB20/Et/ WsUvYhhw8BSfHZYZsxEY2v5FV3uTpszBVWFzR8LCrdsxa/U6XACTkVS6ecVpa5A8vyfo 928gMD5K+6tXHvJxZmZ8+dAPNAXByy2ARR5AwmDSR7IkO08oRVWs94rBic9T+c4X5Iyp ahduL3F597rlB8RL+hbPnfZL3QNgTO5oSqmi8BeBipHnYWQpJf6wpilOjQWpE+zQf0KI M99qx5qVIXcWaSduQv0kCEQQ6deFmWZsYN9SpA64QDWm8cpFk0Udn5DRZFNTTk6Y3ynq E8tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1A7HDzhjdY5hn/pnJsq/whbXnb304U4AQcYBouiJz5U=; b=yjumRBjN7aIkO/F3220y6PkIfdABBn+4V1K4b4I9NZI7Pa1LEjaEqcMRK3SkUTj3D/ XBMyyi08ejcPe/KKqkURDcjx2+x1qQdk1oGusadTO7u7GMHZO8rtGz/2YOtUIJ7caf6F QUdTvWk/vFHP0l/3Zv8N9ceKEQj2rxHfh3baM9X7iUCX2DeibGXvoj3ERykeQpHvj3Pt G04VTf0KwkR0qusocUBuR6y4XQOSdIFxnUv32G0rcMhzkxVsgkDmSxbT0FtCh42y1+/O In73cdOEjEY2B0gq74Oi+ze+7x01f5MlKa4YvlgDhWjU3MzVfiMorPgEVl57indCIpuP v7cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gVAfAFQL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si29675890edj.183.2021.11.01.18.29.40; Mon, 01 Nov 2021 18:30:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gVAfAFQL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229571AbhKBB3s (ORCPT + 99 others); Mon, 1 Nov 2021 21:29:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbhKBB3r (ORCPT ); Mon, 1 Nov 2021 21:29:47 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9287BC061714; Mon, 1 Nov 2021 18:27:12 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id i12so14135511ila.12; 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=BPP4MAwJJbN55XQ2uUHVoXEAaZhhWTYrWHPiJi1OOnXeiE4EzYGMs0N3EcfgQ01Xcm hyzrcidDfgUy/epJBkbLIrh5RZgP9kJw7aSK3CHZKQdp0NqXzU8OjUoid5/anI1wrBCm G4kjiUxuzgkJvLnv4d1S+b7Pxyv5bGWzpPhB5JlGHzCXx4spYKtw1dXBd94YTx3E2WCo AWuvTTQfEHsMSI9ubEGQMRvxE2wAU9smoMAo6ReSXLIRRa16NSOcVEFS1xGUI1Tz38V0 /5GfKlySCtKu47dzafnkIJykmzhoPvGj6CF4HijloCE9ImM56VJjSPF+mxGMD3su2tmU ap9Q== X-Gm-Message-State: AOAM532k/lYdwXizavHtzqNSoPe4KWp5t1NMoavObu8aBnSitsNqstno szPgK4RrunHvRN/tV7ox0JvhFfFT6cPx18xgLqg= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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