From patchwork Thu Dec 19 02:34:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 13914392 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 90FD8E7718A for ; Thu, 19 Dec 2024 02:35:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 256376B0089; Wed, 18 Dec 2024 21:35:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1DEB56B008A; Wed, 18 Dec 2024 21:35:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0317F6B008C; Wed, 18 Dec 2024 21:35:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D5DFF6B0089 for ; Wed, 18 Dec 2024 21:35:14 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 54DE9B06D7 for ; Thu, 19 Dec 2024 02:35:14 +0000 (UTC) X-FDA: 82910140656.21.9230682 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf22.hostedemail.com (Postfix) with ESMTP id 6C286C0003 for ; Thu, 19 Dec 2024 02:34:38 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=XlP+UaKA; spf=pass (imf22.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734575697; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GFcOX4O91tQFD6muydW9g9dtgYf4vZjGzF6jEGHBeGo=; b=kspwSA5p5CZzNs6TSfzdL/sCeHfVd6P2OT0cFZfjuHnQzv5Laazd/hD5KrKvG9q0sOfpM9 DhVA4thdeaGDDSaVmngiKuVpT3vIcM6v/EMssU/1aLn06+1AJ3pYX64yIgVmKa+pf8yTYi EaEoQ8SRXxM5YOiLvajM294hyNA5lXM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=XlP+UaKA; spf=pass (imf22.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734575697; a=rsa-sha256; cv=none; b=rj3EAajP9krsYscHQEGCC06ZEdXpPkeRcnEhWZulZuDWI6lnyaBuZ66rhFBbibLf13zebV +g7lPT7zQfQRgfT26+MdF2sobYspMFpZKOgtmh9WZhRbMsmJ2toBlipS8VK97ndEAI3kFY WM7+t/muAcSbQ6hp6pqUxbrMB8S312M= Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-728e1799d95so387802b3a.2 for ; Wed, 18 Dec 2024 18:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734575711; x=1735180511; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GFcOX4O91tQFD6muydW9g9dtgYf4vZjGzF6jEGHBeGo=; b=XlP+UaKAmvuCUDIZKTrrZrrhu0WsNUFDcXITBXnyZlXJW+M24TiXsu9y3aQhXa5k7e pkSBzIyHrKmkKdA3RGBpIihKG7f+pDPvR5QVB9+tLme7WJa7KrlqkkcC7W5W+vlSr3Vh 9MA09iMEiLqWV8T7Hf2gRDG51oyvX8B8hpMlg8YkfLLAi8BQbxhPuQUeUFoRwA2k0kN0 cNyZBeaeAQdjYB7w0MKjFSuRaGALmtGP0+eAiXpzXh9vFlqDNMjVpMDq6NmGZx5ezFbX kbGNMNPUXGtDf7OE9To+x3U+9Tt5Ka36d0bhoIMY6rtm3QAJm/fCO6MeDv9sAMWS/ug7 tMZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734575711; x=1735180511; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GFcOX4O91tQFD6muydW9g9dtgYf4vZjGzF6jEGHBeGo=; b=Eh/XeoMnOjdT2APoVNCcj8zAYQad2+X1mzxDbdZh/lnI+g0R6c+UakzcxAIFuHrljz gs655jzwPFEUIZC64DUinwCpthumpO0En7OfdJp/7m4lw2iEZlZ7KfQUYdQprSqwEOmL LNrQJ7NZWLDO+uIJudHLqLJvtbL8Rd1XkiR21qO1FoglFJLFmnoUzupqGZzuzxOjsqsj moN7x/ihPxaZmPuZjJBw4WpNFjLpg8cjLrkiEUOC7mTIoNjwKo6w2A4cW7KGFL0xuFP5 b5Y6Dpf2O1gwwz4qKD9J3FWoIYBztR/AoWxt123hg8nNsNk4Si+gKXoREDkTJmrb6WiQ BjTw== X-Forwarded-Encrypted: i=1; AJvYcCUZxvozXUmkviygTeFw1af6brUw7drTicxt59EEbZSaOM+MVgzGUW38DUqvFx89StRFjV3zi/qlTw==@kvack.org X-Gm-Message-State: AOJu0YyMNT1pedar0Akf/b7eKYb+PqdADL63QVAX18gd24d3MQQMtkx7 EZduGoqxjDub1/f/2twJ4PIEHX9iNG2Qi5QuTrxkg6iIvqYp6gSh X-Gm-Gg: ASbGncvy3UuUrR6P1NAO9mr4wtHtFC72+Pjfkm9epEhG/JN4J81GzC8xHzwHW9FrIY0 bFW7v7GXHR1KSt+1Xe8MMw2sI3x2LmqcWIj5ojXC75QI5ZJ+AhIXyVaOlL/BOGnz0PWfARlnvlW JGhkh4iedRfdM6by3LAr0o29ALNKL7x60LzRbmqZ+R1YvGAJiBtKZuCg5nE+uUWpL/A+xn6SY1N q+m0k//S+1FgyUyKhkwg4Ix1wk9pRNidZYyDWbO7TtPvW/eLkKgolAr+D9TnN3l8wmXgxmaMX9u 6WHKP0U= X-Google-Smtp-Source: AGHT+IF8uDHPAeHRKoSWXDpZOfxN83+9I3jRkG5wW7qXuv+87XI+9vIxsP70Tcc6kEOf0TdmQfwRSg== X-Received: by 2002:a05:6a20:c6c2:b0:1e1:ca25:8da3 with SMTP id adf61e73a8af0-1e5b4820f26mr9200947637.20.1734575711218; Wed, 18 Dec 2024 18:35:11 -0800 (PST) Received: from localhost.localdomain ([180.159.118.224]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842b821da83sm142163a12.40.2024.12.18.18.35.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Dec 2024 18:35:10 -0800 (PST) From: Yafang Shao To: akpm@linux-foundation.org Cc: torvalds@linux-foundation.org, pmladek@suse.com, kvalo@kernel.org, bp@alien8.de, andriy.shevchenko@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, x86@kernel.org, linux-snps-arc@lists.infradead.org, linux-wireless@vger.kernel.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, ocfs2-devel@lists.linux.dev, Yafang Shao , Vineet Gupta , Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" Subject: [PATCH v2 2/5] arch: Remove get_task_comm() and print task comm directly Date: Thu, 19 Dec 2024 10:34:49 +0800 Message-Id: <20241219023452.69907-3-laoar.shao@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20241219023452.69907-1-laoar.shao@gmail.com> References: <20241219023452.69907-1-laoar.shao@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6C286C0003 X-Stat-Signature: ru5d3wxmaauh6petdtu7awggorbe5fey X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1734575678-331151 X-HE-Meta: U2FsdGVkX19GhxSt8IgWygWpxty5h+dPSbnl9NQH5TAUff8ujdNRIEIpn5/tqxA0HLA9BiBXZX4jb8t43VpVnuDLrqPYhkOgaxAvK6A+yhXU8HEeJmfFraSm6yzmrqlPgRINnWYzgS32UjklUGtycUDFCtTB4TIaRwRu0MvHum+j61wezOxMYV7Owu30It3ZOiPaTT+N4MGEqLXp0JhZkrDu9y972mmp9L3x0PZYQ4QZ1stRPaa/JQ8CYVfKaRouheNtjP5fuhr6daq2ZVciggYawO1YN/DRWbBrdC2MjL4wAeOg5Ljfuz0M28rFsccsNJCoy/ew1SQD/Mqax+xoE0bvCWYqX0ZfqWCokPywMnowbYZDxQkMORlB11e+MZ+gl6C/BgDLy4qw3unWy0vyyEkeEbPJQ6/KBTTJw/uOyipPFJiA3DTt0Dbc6HnLV+QWZrovof22+vDAU6ZhMXlMid+g4rwwdOpS3y2Rg75Q1iY+YkBzMk2aPbrb1K6ISHGN8S1IcOa2wmUISw2jf41cMUTtenFOynlEhaq8RHabmZYbG1ytLsxj4lWrltQpqn8iM6siJ/IOtAsj1utz6ficNXqcjMxAikR8eeSJ+zI38rfF40ls5+F07FKtshNL25bBacr6deuJ4NwSVhAbaZyr0mOxIxcWGPwwCIrkeVLPh0+djGBL4L5M5L5WsctvLxpZEXLbEqalpDVJFukZ7dRD3i/V61Cm3gbgVhKVzMstgtobkv8z6NCbR3LfBPFiOtf5t7V3E5ej9sBvNF1kWnwh2sdRDd3OCeioyxmO08LDxTyiEy4KGI1iutaeu7isM0GS10O61XXTEbgVo5hwa+cuJwzKj1VtlQRBeOfCQsQ18NZ4LDYPztEHzbHeUR3qdy3J7fKK4PNxGy0YVsy/J9BlnWX3dV2jyGqs7FxDISdkTHlk0hywPWAxGW8gfoS9xz875tmpUiaAuGPJht3BrcP i8bL1t49 Zi8zhUOn3ebA4d0/U591ZjGR6ke88Q8x066OwyqnvqTQaYnQu97zc4zTyvYUaS8/eRFuDhSZcD+lt07j7Do3dq60Q8bL7P5YhcbzBO9+u+3kaAGy3mS7TZmvQv4hj/FoeeUyxNNcM5EL3QpuVgJHo4Eo8Js9zRfzVV8cPvWM8/5ODT3G2W/pqhov+vWTeQP1CN6G4+D1bPcEGzgh8Q6mR/NWYCQlc5bdIuyJC/uhmQ8PQ8vlPnGEp+A1csZpPNERY+6ZN8YphA2u0x1OZXFR/refGM4CRHi249YLvvwyhLYYsG2wpOthxY0EIKdYb1U5DQ8NMoKH9mXjy40GgkiEArda3OddBnnIbtJI1SnwsIzLzBdvUHeVzaG6fl2GQQtP0+p+2ZYpQrhTGxWkUTxah58C127/hGSAjLG4pZIixmCK5/H8iRm7qg07twre/XYH5PmybRQ664givsTZ/6NY6DyyXpOfhxjPpCyQryXMwfo29gNlFbw0BL3rOQgKAWMXyyREA5d8/0ghNpXtRg/JwksFauSRIbpN8tZh6FveXuFXmPTk9eOmoRYDopk8r79yrabkAxFjc99oUTq5YvYmUbmo4pOg1aMvldcTAspgjweLgtIwWBArEfczMgcg11eD8FpqSF8sP1Jiw6+mmaTSmyNtbKg== 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: List-Subscribe: List-Unsubscribe: Since task->comm is guaranteed to be NUL-terminated, we can print it directly without the need to copy it into a separate buffer. This simplifies the code and avoids unnecessary operations. Signed-off-by: Yafang Shao Cc: Vineet Gupta Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" --- arch/arc/kernel/unaligned.c | 5 ++--- arch/x86/kernel/vm86_32.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c index d2f5ceaaed1b..3b2d8b1bd271 100644 --- a/arch/arc/kernel/unaligned.c +++ b/arch/arc/kernel/unaligned.c @@ -200,7 +200,6 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs, struct callee_regs *cregs) { struct disasm_state state; - char buf[TASK_COMM_LEN]; /* handle user mode only and only if enabled by sysadmin */ if (!user_mode(regs) || !unaligned_enabled) @@ -212,11 +211,11 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs, " performance significantly\n. To enable further" " logging of such instances, please \n" " echo 0 > /proc/sys/kernel/ignore-unaligned-usertrap\n", - get_task_comm(buf, current), task_pid_nr(current)); + current->comm, task_pid_nr(current)); } else { /* Add rate limiting if it gets down to it */ pr_warn("%s(%d): unaligned access to/from 0x%lx by PC: 0x%lx\n", - get_task_comm(buf, current), task_pid_nr(current), + current->comm, task_pid_nr(current), address, regs->ret); } diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index e9e803a4d44c..e6cc84143f3e 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c @@ -246,9 +246,8 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus) /* VM86_SCREEN_BITMAP had numerous bugs and appears to have no users. */ if (v.flags & VM86_SCREEN_BITMAP) { - char comm[TASK_COMM_LEN]; - - pr_info_once("vm86: '%s' uses VM86_SCREEN_BITMAP, which is no longer supported\n", get_task_comm(comm, current)); + pr_info_once("vm86: '%s' uses VM86_SCREEN_BITMAP, which is no longer supported\n", + current->comm); return -EINVAL; }