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 ECA25C433EF for ; Fri, 5 Nov 2021 06:35:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6F5A0611C4 for ; Fri, 5 Nov 2021 06:35:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6F5A0611C4 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 E8E51940007; Fri, 5 Nov 2021 02:35:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3DF56B0071; Fri, 5 Nov 2021 02:35:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2D84940007; Fri, 5 Nov 2021 02:35:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id C40316B006C for ; Fri, 5 Nov 2021 02:35:35 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7563A1848AB0E for ; Fri, 5 Nov 2021 06:35:35 +0000 (UTC) X-FDA: 78773915430.13.49B8973 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by imf29.hostedemail.com (Postfix) with ESMTP id 038DE900024F for ; Fri, 5 Nov 2021 06:35:34 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id n15so7925330qkp.12 for ; Thu, 04 Nov 2021 23:35:34 -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:content-transfer-encoding; bh=471eGmUxaF67diQu9fpSiCy6uokW6qtVpUcaxV0sWLg=; b=jS5yXBDc4yq8hyj2cMX5ZzypfkbcLj9UWr5FarIDV8R/zKENQbna+Jo8HNO42CtEMt RiopFHwHRn4GwPkE5mt3IdSzakYbUGSj2lbLs/YAsoK0ar9yVUh09Yhl8a4WWyQOjwZ+ ZMVvmuhWqz7vNgHbChGOHuDkC5/GG4HCHnSqsF5E+6MK0hng9T+RlaxODaBfqkN6w0KD OKWDtzvX8pHGd6kiigIdwo/20u19Uex8DStSUaqEFXYlC/NevQSYREnt+slq5II6jC87 rVCtpwgcKIuv2TtDWCxHgQLpa/HJ7hMsWJ5Fd6j9a8IyeYP3DdbyGWKU3ZTxpURg3r5p g1nA== 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:content-transfer-encoding; bh=471eGmUxaF67diQu9fpSiCy6uokW6qtVpUcaxV0sWLg=; b=sTinUwYhCiPaSc25qyHxhK8r9/LnslRxpUU0Y+lPRyx0+JHuvzzINGBMGi3mZSiOt7 FiPfVO/Vu60cRKO+0iEYCrX4JGjg2/8IlAHyoFOyGXWIJdt+ck3dKKAyWTpY6D/FLxp1 pG1eR0zGQ9FHb5ybB5AES46XM3MWodzWCaRS7Qa6K8VHSr8kR5M+4hthsG9KxIcPaAaC Eeu6Zq725gFv235nLZ3HNrz04gcBGyJyndeIFQZJt2shJJDgydtN3bX2P3vK271kcHLX Q/oJDJmJ/ezAwaPtLI4oZTmy+x16lo5dNEQq0klonFEBsHa1oZWRnOtzCLwYzrHlY9Zt w7rw== X-Gm-Message-State: AOAM533IDX0yGu8A+4J0L99Ztk0p+ViZ9JYKiFCaRWReU2RP+Yws9/DP Nqc1D2PsGbCJ34VeLVzAjrYKbjPBMB5RKIIl2/c= X-Google-Smtp-Source: ABdhPJyGlAK/4T0maCDIO1vKCkl3dt4UGJclujZc/WZfgwdBVMPOmko9selD7aq7tjVzpVvwBlKU0yeFneDO8orvn9Y= X-Received: by 2002:a05:620a:408:: with SMTP id 8mr16641290qkp.116.1636094134305; Thu, 04 Nov 2021 23:35:34 -0700 (PDT) MIME-Version: 1.0 References: <20211101060419.4682-1-laoar.shao@gmail.com> In-Reply-To: From: Yafang Shao Date: Fri, 5 Nov 2021 14:34:58 +0800 Message-ID: Subject: Re: [PATCH v7 00/11] extend task comm from 16 to 24 To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Andrew Morton , Kees Cook , Steven Rostedt , Mathieu Desnoyers , Arnaldo Carvalho de Melo , Petr Mladek , 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" Content-Transfer-Encoding: quoted-printable Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=jS5yXBDc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf29.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.222.175 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 038DE900024F X-Stat-Signature: 81rq8ye4jrn6brj17wq87beyb4wb3jg8 X-HE-Tag: 1636094134-529933 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 Thu, Nov 4, 2021 at 9:37 AM Micha=C5=82 Miros=C5=82aw wrote: > > On Mon, Nov 01, 2021 at 06:04:08AM +0000, Yafang Shao wrote: > > There're many truncated kthreads in the kernel, which may make trouble > > for the user, for example, the user can't get detailed device > > information from the task comm. > > > > This patchset tries to improve this problem fundamentally by extending > > the task comm size from 16 to 24, which is a very simple way. > [...] > > Hi, > > I've tried something like this a few years back. My attempt got mostly > lost in the mailing lists, but I'm still carrying the patches in my > tree [1]. My target was userspace thread names, and it turned out more > involved than I had time for. > > [1] https://rere.qmqm.pl/git/?p=3Dlinux;a=3Dcommit;h=3D2c3814268caf2b1fee= 6d1a0b61fd1730ce135d4a > and its parents > Hi Michal, Thanks for the information. I have looked through your patches. It seems to contain six patches now and can be divided into three parts per my understanding. 1. extend task comm len This parts contains below 4 patches: [prctl: prepare for bigger TASK_COMM_LEN](https://rere.qmqm.pl/git/?p=3Dlinux;a=3Dcommit;h=3Dcfd99db9c= f911bb4d106889aeba1dfe89b6527d0) [bluetooth: prepare for bigger TASK_COMM_LEN](https://rere.qmqm.pl/git/?p=3Dlinux;a=3Dcommit;h=3Dba2805f51= 96865b81cc6fc938ea53af2c7c2c892) [taskstats: prepare for bigger TASK_COMM_LEN](https://rere.qmqm.pl/git/?p=3Dlinux;a=3Dcommit;h=3D4d29bfedc= 57b36607915a0171f4864ec504908ca) [mm: make TASK_COMM_LEN configurable](https://rere.qmqm.pl/git/?p=3Dlinux;a=3Dcommit;h=3D362acc3558= 2445174589184c738c4d86ec7d174b) What kind of userspace issues makes you extend the task comm length ? Why not just use /proc/[pid]/cmdline ? 2. A fix Below patch: [procfs: signal /proc/PID/comm write truncation](https://rere.qmqm.pl/git/?p=3Dlinux;a=3Dcommit;h=3Dd72027388d4d= 95db5438a7a574e0a03ae4b5d6d7) It seems this patch is incomplete ? I don't know what it means to do. 3. A feature provided for pthread_getname_np Below patch: [procfs: lseek(/proc/PID/comm, 0, SEEK_END)](https://rere.qmqm.pl/git/?p=3Dlinux;a=3Dcommit;h=3D2c3814268caf2= b1fee6d1a0b61fd1730ce135d4a) It seems this patch is useful. With this patch the userspace can directly get the TASK_COMM_LEN through the API. --=20 Thanks Yafang