lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fbba559c-59e2-94f1-52d6-94960a13f682@kernel.org>
Date:   Tue, 7 Nov 2023 22:53:43 +0800
From:   Chao Yu <chao@...nel.org>
To:     Zhiguo Niu <zhiguo.niu@...soc.com>, jaegeuk@...nel.org
Cc:     linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org, niuzhiguo84@...il.com
Subject: Re: [PATCH] f2fs: fix thread name cannot be fully displayed

On 2023/11/2 9:20, Zhiguo Niu wrote:
> Because the length of task'name in task_struct can not exceed
> 16 characters, f2fs some thread'name cannot be fully displayed,
> including important device number information.
> If there are more than one partition using the f2fs file system,
> it is very inconvenient to match partitions and their threads.
> 
> The following examples show that 4 partitions all use f2fs file system
> PID: 400    TASK: ffffff80f120c9c0  CPU: 2   COMMAND: "f2fs_discard-25"
> PID: 392    TASK: ffffff80f6b75880  CPU: 3   COMMAND: "f2fs_discard-25"
> PID: 400    TASK: ffffff80f120c9c0  CPU: 2   COMMAND: "f2fs_discard-25"
> PID: 392    TASK: ffffff80f6b75880  CPU: 3   COMMAND: "f2fs_discard-25"
> PID: 510    TASK: ffffff80dd62c9c0  CPU: 0   COMMAND: "f2fs_ckpt-254:4"
> PID: 255    TASK: ffffff80f2268000  CPU: 3   COMMAND: "f2fs_ckpt-259:4"
> PID: 398    TASK: ffffff80f120ac40  CPU: 2   COMMAND: "f2fs_ckpt-259:4"
> PID: 390    TASK: ffffff80f6b76740  CPU: 3   COMMAND: "f2fs_ckpt-259:4"
> PID: 511    TASK: ffffff80dd629d80  CPU: 3   COMMAND: "f2fs_flush-254:"
> PID: 399    TASK: ffffff80f120bb00  CPU: 2   COMMAND: "f2fs_flush-259:"
> PID: 391    TASK: ffffff80f6b70000  CPU: 3   COMMAND: "f2fs_flush-259:"
> PID: 256    TASK: ffffff80f226d880  CPU: 6   COMMAND: "f2fs_flush-259:"
> 
> We can use the name format such as f2fs_gc-xxx, as saw in device:
> PID: 260    TASK: ffffff80f8c2e740  CPU: 3   COMMAND: "f2fs_gc-259:44"
> PID: 420    TASK: ffffff80f6505880  CPU: 2   COMMAND: "f2fs_gc-259:41"
> PID: 393    TASK: ffffff80f6b72c40  CPU: 1   COMMAND: "f2fs_gc-259:40
> PID: 513    TASK: ffffff80dd62e740  CPU: 1   COMMAND: "f2fs_gc-254:40"

Can you please check comments in below link?

https://lore.kernel.org/linux-f2fs-devel/8eaad9d0-1d59-3ecb-bab4-904ed22385f4@kernel.org/

Thanks,

> 
> Signed-off-by: Zhiguo Niu <zhiguo.niu@...soc.com>
> ---
>   fs/f2fs/checkpoint.c | 2 +-
>   fs/f2fs/segment.c    | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index b0597a5..f6a5424 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -1893,7 +1893,7 @@ int f2fs_start_ckpt_thread(struct f2fs_sb_info *sbi)
>   		return 0;
>   
>   	cprc->f2fs_issue_ckpt = kthread_run(issue_checkpoint_thread, sbi,
> -			"f2fs_ckpt-%u:%u", MAJOR(dev), MINOR(dev));
> +			"f2fs_cp-%u:%u", MAJOR(dev), MINOR(dev));
>   	if (IS_ERR(cprc->f2fs_issue_ckpt)) {
>   		int err = PTR_ERR(cprc->f2fs_issue_ckpt);
>   
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index d05b416..b290713 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -677,7 +677,7 @@ int f2fs_create_flush_cmd_control(struct f2fs_sb_info *sbi)
>   
>   init_thread:
>   	fcc->f2fs_issue_flush = kthread_run(issue_flush_thread, sbi,
> -				"f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev));
> +				"f2fs_fh-%u:%u", MAJOR(dev), MINOR(dev));
>   	if (IS_ERR(fcc->f2fs_issue_flush)) {
>   		int err = PTR_ERR(fcc->f2fs_issue_flush);
>   
> @@ -2248,7 +2248,7 @@ int f2fs_start_discard_thread(struct f2fs_sb_info *sbi)
>   		return 0;
>   
>   	dcc->f2fs_issue_discard = kthread_run(issue_discard_thread, sbi,
> -				"f2fs_discard-%u:%u", MAJOR(dev), MINOR(dev));
> +				"f2fs_dc-%u:%u", MAJOR(dev), MINOR(dev));
>   	if (IS_ERR(dcc->f2fs_issue_discard)) {
>   		err = PTR_ERR(dcc->f2fs_issue_discard);
>   		dcc->f2fs_issue_discard = NULL;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ