WSL2-Linux-Kernel/fs
john stultz 4614a696bd procfs: allow threads to rename siblings via /proc/pid/tasks/tid/comm
Setting a thread's comm to be something unique is a very useful ability
and is helpful for debugging complicated threaded applications.  However
currently the only way to set a thread name is for the thread to name
itself via the PR_SET_NAME prctl.

However, there may be situations where it would be advantageous for a
thread dispatcher to be naming the threads its managing, rather then
having the threads self-describe themselves.  This sort of behavior is
available on other systems via the pthread_setname_np() interface.

This patch exports a task's comm via proc/pid/comm and
proc/pid/task/tid/comm interfaces, and allows thread siblings to write to
these values.

[akpm@linux-foundation.org: cleanups]
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Mike Fulton <fultonm@ca.ibm.com>
Cc: Sean Foley <Sean_Foley@ca.ibm.com>
Cc: Darren Hart <dvhltc@us.ibm.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 08:53:24 -08:00
..
9p 9p: fix build breakage introduced by FS-Cache 2009-12-01 07:35:11 -08:00
adfs
affs
afs afs: remove manual O_SYNC handling 2009-12-10 15:02:50 +01:00
autofs
autofs4
befs
bfs
btrfs vfs: Implement proper O_SYNC semantics 2009-12-10 15:02:50 +01:00
cachefiles CacheFiles: Update IMA counters when using dentry_open 2009-12-01 07:35:11 -08:00
cifs vfs: Implement proper O_SYNC semantics 2009-12-10 15:02:50 +01:00
coda sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
configfs
cramfs
debugfs debugfs: fix create mutex racy fops and private data 2009-12-11 11:24:53 -08:00
devpts devpts_get_tty() should validate inode 2009-12-11 15:18:05 -08:00
dlm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm 2009-12-10 09:33:59 -08:00
ecryptfs
efs
exofs exofs: Multi-device mirror support 2009-12-10 09:59:23 +02:00
exportfs
ext2 ext2: fix comment in ext2_find_entry about return values 2009-12-10 15:02:53 +01:00
ext3 ext3: PTR_ERR return of wrong pointer in setup_new_group_blocks() 2009-12-10 15:02:55 +01:00
ext4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-12-14 09:58:24 -08:00
fat
freevxfs
fscache FS-Cache: Provide nop fscache_stat_d() if CONFIG_FSCACHE_STATS=n 2009-11-20 21:50:44 +00:00
fuse fuse: reject O_DIRECT flag also in fuse_create 2009-11-27 16:37:13 +01:00
gfs2 GFS2: Fix glock refcount issues 2009-12-03 12:00:12 +00:00
hfs hfs: fix a potential buffer overflow 2009-12-15 08:53:10 -08:00
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs zisofs: Implement reading of compressed files when PAGE_CACHE_SIZE > compress block size 2009-12-10 15:02:49 +01:00
jbd fs/jbd: Export log_start_commit to fix ext3 build. 2009-11-12 10:24:12 +01:00
jbd2 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6 2009-12-11 15:31:13 -08:00
jffs2 Merge branch 'for-next' into for-linus 2009-12-07 18:36:35 +01:00
jfs tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
lockd sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
minix
ncpfs tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
nfs Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6 2009-12-14 10:00:24 -08:00
nfs_common
nfsd Fix memory corruption caused by nfsd readdir+ 2009-11-14 12:55:55 -08:00
nilfs2 nilfs2: separate wait function from nilfs_segctor_write 2009-11-30 21:17:52 +09:00
nls
notify Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
ntfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
ocfs2 quota: Move definition of QFMT_OCFS2 to linux/quota.h 2009-12-10 15:02:53 +01:00
omfs tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
openpromfs
partitions partitions: read whole sector with EFI GPT header 2009-11-23 09:29:58 +01:00
proc procfs: allow threads to rename siblings via /proc/pid/tasks/tid/comm 2009-12-15 08:53:24 -08:00
qnx4
quota quota: Implement quota format with 64-bit space and inode limits 2009-12-10 15:02:54 +01:00
ramfs
reiserfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
romfs
smbfs
squashfs
sysfs sysfs: sysfs_setattr remove unnecessary permission check. 2009-12-11 11:24:54 -08:00
sysv
ubifs Merge git://git.infradead.org/ubifs-2.6 2009-12-10 09:31:45 -08:00
udf udf: Avoid IO in udf_clear_inode 2009-12-14 21:40:04 +01:00
ufs
xfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-12-14 09:58:24 -08:00
Kconfig
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
binfmt_elf_fdpic.c nommu: fix malloc performance by adding uninitialized flag 2009-12-15 08:53:24 -08:00
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
block_dev.c
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c md: move compat_ioctl handling into md.c 2009-12-14 12:51:41 +11:00
dcache.c
dcookies.c
direct-io.c Fix regression in direct writes performance due to WRITE_ODIRECT flag removal 2009-11-26 09:46:46 +01:00
drop_caches.c
eventfd.c
eventpoll.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
exec.c procfs: allow threads to rename siblings via /proc/pid/tasks/tid/comm 2009-12-15 08:53:24 -08:00
fcntl.c fcntl: rename F_OWNER_GID to F_OWNER_PGRP 2009-11-17 17:40:33 -08:00
fifo.c
file.c
file_table.c
filesystems.c
fs-writeback.c writeback: remove unused nonblocking and congestion checks 2009-12-03 13:54:25 +01:00
fs_struct.c
generic_acl.c
inode.c
internal.h
ioctl.c __generic_block_fiemap(): fix for files bigger than 4GB 2009-11-12 07:26:01 -08:00
ioprio.c
libfs.c
locks.c
mbcache.c
mpage.c
namei.c Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6 2009-12-11 15:31:13 -08:00
namespace.c
nfsctl.c
no-block.c
open.c LSM: Move security_path_chmod()/security_path_chown() to after mutex_lock(). 2009-11-24 08:49:26 +11:00
pipe.c
pnode.c
pnode.h
posix_acl.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
super.c
sync.c kill wait_on_page_writeback_range 2009-12-10 15:02:50 +01:00
timerfd.c
utimes.c
xattr.c
xattr_acl.c VFS: Use GFP_NOFS in posix_acl_from_xattr() 2009-12-03 11:48:07 +00:00