Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1508727pxb; Thu, 7 Oct 2021 09:06:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwElezgl+/xBm8tKg5r8oDDnB0yhM7Tyx4+laoYKJufvtBNcm9Q+nK0VQW3Abk1NqeP/ffS X-Received: by 2002:adf:b302:: with SMTP id j2mr6544703wrd.285.1633622809448; Thu, 07 Oct 2021 09:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633622809; cv=none; d=google.com; s=arc-20160816; b=DsL8NexiUKKSIdScqJ+FAQ8qGIcbAqz/ddxS+rvpkDMqd5se9RgtGSMTaELQOGRoxZ 9ULeoA7QFQiyjpfTmvRcwKKQCKUFHoNzyZKuvU5lsS+Shx3QJ/ScmYuHersKBmpl5LF2 OHBziWbs5EeKbM13LkxWt76AkdK3xUXBnAbjq1F1kcHEMgOWpbKgHBAi0QF2MydWP+C7 yViFaXJG7mOEJ9EwtC3ebqXRBjp06BFW5B6hgw7uPxUP8HZawTqC9SJMQYarrUTXwi2w 1hhQO0csOV/BTwKoBAAU94v2VuxLBmBgniWAggh4/1UCiXpuLm9wkpBQlFBjgHUBawre SHfg== 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=93k30BowPAWJLvRYOEPtip43/6dZEF05PbXu8mfv+TI=; b=HNOjgqp9mtgLt4Tp5vEVxATdo7K5cHHCcqkYLR2oyzg6tO12RPSQ/L35OcuvNfyY8P pgXs1UGELSIj/qskBB2+mfdvY+459pTzboKS6AbQqb8qfbsdJUro5Vof2tCcdXspkI1Q 4wnWFPWKdzRo1nzQvFGwaOp2olXtNg8VyMehkkTH11kgNgM7CJAZtfGGDA3aW4+YsV6T lJVJMxqIHPJRZ5javtXSZ1Dl7ix7hCZNGx7f55rbMxShusFCU6KJ2m91gpO1imH/nZr2 3Dy/ydDnukTiU1LoOn8Yna/IGLKBqmthbP2CP9eTuRObHVcrZgravdeaa7ArTBgbMmHG LkAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pkXbgGbE; 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 g5si26294085edb.265.2021.10.07.09.06.22; Thu, 07 Oct 2021 09:06:49 -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=pkXbgGbE; 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 S241861AbhJGPtk (ORCPT + 99 others); Thu, 7 Oct 2021 11:49:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232870AbhJGPtj (ORCPT ); Thu, 7 Oct 2021 11:49:39 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CBD1C061570 for ; Thu, 7 Oct 2021 08:47:45 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id z184so7294954iof.5 for ; Thu, 07 Oct 2021 08:47:45 -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=93k30BowPAWJLvRYOEPtip43/6dZEF05PbXu8mfv+TI=; b=pkXbgGbEfdJ9fpdSaLsbOtSQlYPHSEzaXIqbleidL+uRH1mABVSXcrLLlzLzIZqB5C UUoygOXmBimnW3yVifKAcCDlx+rEjQ0trpUxvaHMKyYz7YPcDja8Z1Zrr+/fSSwr6svT f62DCHtbDbtSBwRmA+w+i3bQQSywsOROEBgGBo+51fZigZJZktTx1zE7FMp9KHScdsJM A123guNIRiynRX3yTJLC/TzUoUGucFHye4572sqtutVYRmWEqIlcKQPo7UNisu4Vykta GpytpJIlEbghtZjJPWJ2hM3wBhmTIlrlXxzoQZUxLI0dVSke7l5uN8mRq9NLJg7/Bdm9 VM+g== 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=93k30BowPAWJLvRYOEPtip43/6dZEF05PbXu8mfv+TI=; b=AAXFnJ2C84viemsf2gtU683T2GAYzYBXk7xXtiYRWKiaeU/KLAOi/RBKVkS0ZjlCNI 21vfnLVwkFBGH8ZgyoesYQUcMvWK8JQKHglO0flND9N0iYpUm18OgJq5Y6eXnWSHRxT0 KARxUTantldqxTmeJE3Zfy/SBVHRAv2/LrykPuGApjMjG3z5HS4phQmXM94esR9QewpX jtS1bR/r4oJtunONAl9qFPOaL8OLEZ4vYFc6Y5DCMvvonkh4Bty0vSzcc6RqWaZLOcai YOG5V2makMEhFj5ZkoevZkdbFR2bYy3GvSHJ3ThvafaVWfp+wDk2eNOezxIwxrI8IL9k rJjw== X-Gm-Message-State: AOAM533ucTH+kIbxNFfmzWvuehVTmALgva7b190k0pbPyzhK4LYmrkfA Lz17uGNItc7DD9IylMYEanuPWSSumtzNxJrqzFE= X-Received: by 2002:a05:6638:35a0:: with SMTP id v32mr3536250jal.128.1633621664959; Thu, 07 Oct 2021 08:47:44 -0700 (PDT) MIME-Version: 1.0 References: <20211007120752.5195-1-laoar.shao@gmail.com> <20211007120752.5195-4-laoar.shao@gmail.com> <202110070755.60DFB87711@keescook> In-Reply-To: <202110070755.60DFB87711@keescook> From: Yafang Shao Date: Thu, 7 Oct 2021 23:47:09 +0800 Message-ID: Subject: Re: [PATCH v2 3/4] sched.h: extend task comm from 16 to 24 for CONFIG_BASE_FULL To: Kees Cook Cc: Petr Mladek , Al Viro , Andrew Morton , Peter Zijlstra , Valentin Schneider , Mathieu Desnoyers , qiang.zhang@windriver.com, robdclark@chromium.org, christian@brauner.io, Dietmar Eggemann , Ingo Molnar , Juri Lelli , Vincent Guittot , Steven Rostedt , Benjamin Segall , Mel Gorman , Daniel Bristot de Oliveira , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 7, 2021 at 10:56 PM Kees Cook wrote: > > On Thu, Oct 07, 2021 at 12:07:51PM +0000, Yafang Shao wrote: > > When I was implementing a new per-cpu kthread cfs_migration, I found the > > comm of it "cfs_migration/%u" is truncated due to the limitation of > > TASK_COMM_LEN. For example, the comm of the percpu thread on CPU10~19 are > > all with the same name "cfs_migration/1", which will confuse the user. This > > issue is not critical, because we can get the corresponding CPU from the > > task's Cpus_allowed. But for kthreads correspoinding to other hardware > > devices, it is not easy to get the detailed device info from task comm, > > for example, > > > > jbd2/nvme0n1p2- > > nvidia-modeset/ > > > > We can also shorten the name to work around this problem, but I find > > there are so many truncated kthreads: > > > > rcu_tasks_kthre > > rcu_tasks_rude_ > > rcu_tasks_trace > > poll_mpt3sas0_s > > ext4-rsv-conver > > xfs-reclaim/sd{a, b, c, ...} > > xfs-blockgc/sd{a, b, c, ...} > > xfs-inodegc/sd{a, b, c, ...} > > audit_send_repl > > ecryptfs-kthrea > > vfio-irqfd-clea > > jbd2/nvme0n1p2- > > ... > > > > Besides the in-tree kthreads listed above, the out-of-tree kthreads may > > also be truncated: > > > > rtase_work_queu > > nvidia-modeset/ > > UVM global queu > > UVM deferred re > > ... > > > > We should improve this problem fundamentally. > > > > This patch extends the size of task comm to 24 bytes, which is the > > same length with workqueue's, for the CONFIG_BASE_FULL case. And for the > > CONFIG_BASE_SMALL case, the size of task comm is still kept as 16 bytes. > > > > Suggested-by: Petr Mladek > > Signed-off-by: Yafang Shao > > This, as expected, adds 8 bytes to task_struct, which is reasonable. I > don't see any easy places to consolidate other members to make this a > "free" change, but I did just remove 64 bytes from task_struct[1], so > this is okay. :) > Cool! > Reviewed-by: Kees Cook > Thanks for the review. > [1] https://lore.kernel.org/lkml/20210924025450.4138503-1-keescook@chromium.org/ > -- Thanks Yafang