From patchwork Sat Nov 20 11:27:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 12630331 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 C50AFC433FE for ; Sat, 20 Nov 2021 11:28:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E94C96B0071; Sat, 20 Nov 2021 06:28:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E436F6B0072; Sat, 20 Nov 2021 06:28:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0C016B0073; Sat, 20 Nov 2021 06:28:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id C39E16B0071 for ; Sat, 20 Nov 2021 06:28:10 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 81C821828AE2C for ; Sat, 20 Nov 2021 11:28:00 +0000 (UTC) X-FDA: 78829084362.10.5178A54 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf30.hostedemail.com (Postfix) with ESMTP id ACE68E0019B4 for ; Sat, 20 Nov 2021 11:27:56 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id y14-20020a17090a2b4e00b001a5824f4918so12915937pjc.4 for ; Sat, 20 Nov 2021 03:27:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mgmaoQ7WVjX7ocxIMV0FACmVlj4LoHfwU5mj0OexKdM=; b=S4y3JwNRrMAGuMJwsosIe3PcJ6XbMkUHIl9d954eAGt+u+QBFQcKtabuwG91d5g0jl IrZqpSurc/H8YMbS9n/LDTla/KFUN9aX9mVT75HQ5Qa06BJQ5Fb2wAE544GL63b123Ey 6/PEmk/PWD18fAIWvNaXduPSG8WPUa+D0QY+rlqnXhr8EGUwJ5oUXPs/9QlGXcv+aXSS 3emz8G442htfK6TmiJ1jgPNS68AEnqsD2UnWYg2sgq/H/MeZ1E/A3PR7otTqF9lEa13J wV8AnvYPh99RbLsZTetAkg9ad+hQcTJzbdMcM+QtNSPJXYP6sNdWzlcUqrgjWKk5Wn59 XqlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mgmaoQ7WVjX7ocxIMV0FACmVlj4LoHfwU5mj0OexKdM=; b=yiU4uozTxvDmRld4tI3pgKy4fYwqSHrrnGPx5vuoYYszpCLWVU6pcq402RXvRzyrc2 1DZIjdaRKYLP2pkypCOEBTCIuydAwer4tQC1+QUFgPMlvJXbDb9yFonslZRixZP1y+ek a9s2iJmXUCLq08/zr7L1T/ADT1u+jiicCnrC2LwZSfL1PCS46NO/87hEE3wFJpZ/KWTT bSi//KTYFnMMV7Z1W5+gl7j+kNWEUF90EexdCP5yYm5V2OthsQy6R3nsGipJVuhE8nlJ ZhwRxp/k7QArhu5hJxfD58mtFxqnShZ/ClqFDZykRsPcK2qh1JTGoyOvQMwZG+ZiO20A 6Nyg== X-Gm-Message-State: AOAM530UhcIlCZtorVgdwhrW3S1v9KxbCxnA7S3ZVArLuv+ghqWbYyp0 X4aPcjttcJn7MDUvYkw+M5E= X-Google-Smtp-Source: ABdhPJyxGUG4Lf6ezqV5ps6fISVl14knM2EzOSeswUoGLe+KRCige/jJED6Ic8dKukjHNTV2PFTiKA== X-Received: by 2002:a17:90a:c398:: with SMTP id h24mr9332156pjt.73.1637407679121; Sat, 20 Nov 2021 03:27:59 -0800 (PST) Received: from vultr.guest ([66.42.104.82]) by smtp.gmail.com with ESMTPSA id q17sm2835490pfu.117.2021.11.20.03.27.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Nov 2021 03:27:58 -0800 (PST) From: Yafang Shao To: akpm@linux-foundation.org Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, oliver.sang@intel.com, lkp@intel.com, Yafang Shao , Mathieu Desnoyers , Arnaldo Carvalho de Melo , Alexei Starovoitov , Andrii Nakryiko , Michal Miroslaw , Peter Zijlstra , Steven Rostedt , Matthew Wilcox , David Hildenbrand , Al Viro , Kees Cook , Petr Mladek Subject: [PATCH v2 0/7] task comm cleanups Date: Sat, 20 Nov 2021 11:27:31 +0000 Message-Id: <20211120112738.45980-1-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: ACE68E0019B4 X-Stat-Signature: 9dt4qna1safnk77bcyqgk1t8j66t8qih Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=S4y3JwNR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com X-Rspamd-Server: rspam02 X-HE-Tag: 1637407676-613518 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: This patchset is part of the patchset "extend task comm from 16 to 24"[1]. Now we have different opinion that dynamically allocates memory to store kthread's long name into a separate pointer, so I decide to take the useful cleanups apart from the original patchset and send it separately[2]. These useful cleanups can make the usage around task comm less error-prone. Furthermore, it will be useful if we want to extend task comm in the future. [1]. https://lore.kernel.org/lkml/20211101060419.4682-1-laoar.shao@gmail.com/ [2]. https://lore.kernel.org/lkml/CALOAHbAx55AUo3bm8ZepZSZnw7A08cvKPdPyNTf=E_tPqmw5hw@mail.gmail.com/ Changes since v1: - improve the subject and description - add comment to explain the hard-coded 16 in patch #4 Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek Yafang Shao (7): fs/exec: replace strlcpy with strscpy_pad in __set_task_comm fs/exec: replace strncpy with strscpy_pad in __get_task_comm drivers/infiniband: replace open-coded string copy with get_task_comm fs/binfmt_elf: replace open-coded string copy with get_task_comm samples/bpf/test_overhead_kprobe_kern: replace bpf_probe_read_kernel with bpf_probe_read_kernel_str to get task comm tools/bpf/bpftool/skeleton: replace bpf_probe_read_kernel with bpf_probe_read_kernel_str to get task comm tools/testing/selftests/bpf: replace open-coded 16 with TASK_COMM_LEN drivers/infiniband/hw/qib/qib.h | 2 +- drivers/infiniband/hw/qib/qib_file_ops.c | 2 +- fs/binfmt_elf.c | 2 +- fs/exec.c | 5 +++-- include/linux/elfcore-compat.h | 5 +++++ include/linux/elfcore.h | 5 +++++ include/linux/sched.h | 9 +++++++-- samples/bpf/offwaketime_kern.c | 4 ++-- samples/bpf/test_overhead_kprobe_kern.c | 11 ++++++----- samples/bpf/test_overhead_tp_kern.c | 5 +++-- tools/bpf/bpftool/skeleton/pid_iter.bpf.c | 4 ++-- .../testing/selftests/bpf/progs/test_stacktrace_map.c | 6 +++--- tools/testing/selftests/bpf/progs/test_tracepoint.c | 6 +++--- 13 files changed, 42 insertions(+), 24 deletions(-)