All of lore.kernel.org
 help / color / mirror / Atom feed
* a qemu process has 54 threads, how to know who they are and what they are doing
@ 2022-04-21  1:42 yue
  2022-04-28 18:51 ` Dr. David Alan Gilbert
  2022-04-28 22:10 ` Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: yue @ 2022-04-21  1:42 UTC (permalink / raw)
  To: qemu-devel

Hi, i think it is curios for a process to have so many threads.

my environment: 5.4.160-1.el7.x86_64, qemu-6.1.0

thanks


=============cmd==================
root     11918  0.0  0.0 112720  2280 pts/0    S+   09:30   0:00 grep --color=auto 38032
root     38032 58.0  1.0 8705632 2823304 ?     Sl   Apr19 1451:10 /opt/kata/bin/qemu-system-x86_64 -name sandbox-598c832569b63321f393b1f
ef6d23cb209a9668a17f3b56a8eb87171506baaf8 -uuid 9ab925f1-86f2-4703-801e-be23ce0fdca6 -machine q35,accel=kvm,kernel_irqchip=on,nvdimm=on 
-cpu host,pmu=off -qmp unix:/run/vc/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/qmp.sock,server=on,wait=off -qmp
 unix:/run/vc/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/qmp-guestcsi.sock,server=on,wait=off -qmp unix:/run/vc
/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/qmp-guestcni.sock,server=on,wait=off -m 4352M,slots=10,maxmem=25856
2M -device pci-bridge,bus=pcie.0,id=pci-bridge-0,chassis_nr=1,shpc=off,addr=2,io-reserve=4k,mem-reserve=1m,pref64-reserve=1m -device vir
tio-serial-pci,disable-modern=false,id=serial0 -device virtconsole,chardev=charconsole0,id=console0 -chardev socket,id=charconsole0,path
=/run/vc/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/console.sock,server=on,wait=off -device nvdimm,id=nv0,memde
v=mem0,unarmed=on -object memory-backend-file,id=mem0,mem-path=/opt/kata/share/kata-containers/kata-containers-2.4.img,size=134217728,re
adonly=on -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0 -device pcie-root-port,id=rp0,bus=pcie.0,chas
sis=0,slot=0,multifunction=off -device pcie-root-port,id=rp1,bus=pcie.0,chassis=0,slot=1,multifunction=off -device vhost-vsock-pci,disab
le-modern=false,vhostfd=3,id=vsock-2210812542,guest-cid=2210812542 -device virtio-9p-pci,disable-modern=false,fsdev=extra-9p-kataShared,
mount_tag=kataShared -fsdev local,id=extra-9p-kataShared,path=/run/kata-containers/shared/sandboxes/598c832569b63321f393b1fef6d23cb209a9
668a17f3b56a8eb87171506baaf8/shared,security_model=none,multidevs=remap -netdev tap,id=network-0,vhost=on,vhostfds=4:5:6,fds=7:8:9 -devi
ce driver=virtio-net-pci,netdev=network-0,mac=fa:16:3e:fd:ba:ab,disable-modern=false,mq=on,vectors=8 -rtc base=utc,driftfix=slew,clock=h
ost -global kvm-pit.lost_tick_policy=discard -vga none -no-user-config -nodefaults -nographic --no-reboot -daemonize -object memory-back
end-ram,id=dimm1,size=4352M -numa node,memdev=dimm1 -kernel /opt/kata/share/kata-containers/vmlinux-5.4.160 -append tsc=reliable no_time
r_check rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k console=hvc0 console=
hvc1 cryptomgr.notests net.ifnames=0 pci=lastbus=0 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro ro rootfstype=ext4 deb
ug systemd.show_status=true systemd.log_level=debug panic=1 nr_cpus=40 systemd.unit=kata-containers.target systemd.mask=systemd-networkd
.service systemd.mask=systemd-networkd.socket agent.debug_console agent.debug_console_vport=1026 -pidfile /run/vc/vm/598c832569b63321f39
3b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/pid -D /run/vc/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/qemu.lo
g -smp 3,cores=1,threads=1,sockets=40,maxcpus=40
root     38038  0.0  0.0      0     0 ?        S    Apr19   0:10 [vhost-38032]
root     38040  0.0  0.0      0     0 ?        S    Apr19   0:10 [vhost-38032]
root     38041  0.0  0.0      0     0 ?        S    Apr19   0:11 [vhost-38032]
root     38046  0.0  0.0      0     0 ?        S    Apr19   0:00 [kvm-pit/38032]
root     38047  0.0  0.0      0     0 ?        S    Apr19   0:02 [vhost-38032]
[root@os ~]# ps -L -p 38032 | wc -l
54
[root@os ~]# ps -fT -p 38032 | wc -l
54

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: a qemu process has 54 threads, how to know who they are and what they are doing
  2022-04-21  1:42 a qemu process has 54 threads, how to know who they are and what they are doing yue
@ 2022-04-28 18:51 ` Dr. David Alan Gilbert
  2022-04-28 22:10 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2022-04-28 18:51 UTC (permalink / raw)
  To: yue; +Cc: qemu-devel

* yue (kvmluck@163.com) wrote:
> Hi, i think it is curios for a process to have so many threads.
> 
> my environment: 5.4.160-1.el7.x86_64, qemu-6.1.0

If you pass:
   -name whatever,debug-threads=on

then the qemu will set the kernel thread name to names
like 'CPU 0/Kvm' or 'migration' or whatever, so you can tell what
the thread is.

I'd bet your threads are mostly IO threads, you can configure that a
lot.

Dave

> thanks
> 
> 
> =============cmd==================
> root     11918  0.0  0.0 112720  2280 pts/0    S+   09:30   0:00 grep --color=auto 38032
> root     38032 58.0  1.0 8705632 2823304 ?     Sl   Apr19 1451:10 /opt/kata/bin/qemu-system-x86_64 -name sandbox-598c832569b63321f393b1f
> ef6d23cb209a9668a17f3b56a8eb87171506baaf8 -uuid 9ab925f1-86f2-4703-801e-be23ce0fdca6 -machine q35,accel=kvm,kernel_irqchip=on,nvdimm=on 
> -cpu host,pmu=off -qmp unix:/run/vc/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/qmp.sock,server=on,wait=off -qmp
>  unix:/run/vc/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/qmp-guestcsi.sock,server=on,wait=off -qmp unix:/run/vc
> /vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/qmp-guestcni.sock,server=on,wait=off -m 4352M,slots=10,maxmem=25856
> 2M -device pci-bridge,bus=pcie.0,id=pci-bridge-0,chassis_nr=1,shpc=off,addr=2,io-reserve=4k,mem-reserve=1m,pref64-reserve=1m -device vir
> tio-serial-pci,disable-modern=false,id=serial0 -device virtconsole,chardev=charconsole0,id=console0 -chardev socket,id=charconsole0,path
> =/run/vc/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/console.sock,server=on,wait=off -device nvdimm,id=nv0,memde
> v=mem0,unarmed=on -object memory-backend-file,id=mem0,mem-path=/opt/kata/share/kata-containers/kata-containers-2.4.img,size=134217728,re
> adonly=on -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0 -device pcie-root-port,id=rp0,bus=pcie.0,chas
> sis=0,slot=0,multifunction=off -device pcie-root-port,id=rp1,bus=pcie.0,chassis=0,slot=1,multifunction=off -device vhost-vsock-pci,disab
> le-modern=false,vhostfd=3,id=vsock-2210812542,guest-cid=2210812542 -device virtio-9p-pci,disable-modern=false,fsdev=extra-9p-kataShared,
> mount_tag=kataShared -fsdev local,id=extra-9p-kataShared,path=/run/kata-containers/shared/sandboxes/598c832569b63321f393b1fef6d23cb209a9
> 668a17f3b56a8eb87171506baaf8/shared,security_model=none,multidevs=remap -netdev tap,id=network-0,vhost=on,vhostfds=4:5:6,fds=7:8:9 -devi
> ce driver=virtio-net-pci,netdev=network-0,mac=fa:16:3e:fd:ba:ab,disable-modern=false,mq=on,vectors=8 -rtc base=utc,driftfix=slew,clock=h
> ost -global kvm-pit.lost_tick_policy=discard -vga none -no-user-config -nodefaults -nographic --no-reboot -daemonize -object memory-back
> end-ram,id=dimm1,size=4352M -numa node,memdev=dimm1 -kernel /opt/kata/share/kata-containers/vmlinux-5.4.160 -append tsc=reliable no_time
> r_check rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k console=hvc0 console=
> hvc1 cryptomgr.notests net.ifnames=0 pci=lastbus=0 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro ro rootfstype=ext4 deb
> ug systemd.show_status=true systemd.log_level=debug panic=1 nr_cpus=40 systemd.unit=kata-containers.target systemd.mask=systemd-networkd
> .service systemd.mask=systemd-networkd.socket agent.debug_console agent.debug_console_vport=1026 -pidfile /run/vc/vm/598c832569b63321f39
> 3b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/pid -D /run/vc/vm/598c832569b63321f393b1fef6d23cb209a9668a17f3b56a8eb87171506baaf8/qemu.lo
> g -smp 3,cores=1,threads=1,sockets=40,maxcpus=40
> root     38038  0.0  0.0      0     0 ?        S    Apr19   0:10 [vhost-38032]
> root     38040  0.0  0.0      0     0 ?        S    Apr19   0:10 [vhost-38032]
> root     38041  0.0  0.0      0     0 ?        S    Apr19   0:11 [vhost-38032]
> root     38046  0.0  0.0      0     0 ?        S    Apr19   0:00 [kvm-pit/38032]
> root     38047  0.0  0.0      0     0 ?        S    Apr19   0:02 [vhost-38032]
> [root@os ~]# ps -L -p 38032 | wc -l
> 54
> [root@os ~]# ps -fT -p 38032 | wc -l
> 54
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: a qemu process has 54 threads, how to know who they are and what they are doing
  2022-04-21  1:42 a qemu process has 54 threads, how to know who they are and what they are doing yue
  2022-04-28 18:51 ` Dr. David Alan Gilbert
@ 2022-04-28 22:10 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-04-28 22:10 UTC (permalink / raw)
  To: yue, qemu-devel

On 4/21/22 03:42, yue wrote:
> Hi, i think it is curios for a process to have so many threads.
> 
> my environment: 5.4.160-1.el7.x86_64, qemu-6.1.0

Use "-name debug-threads=yes".  Most of them are going to be I/O workers.

Paolo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-28 22:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21  1:42 a qemu process has 54 threads, how to know who they are and what they are doing yue
2022-04-28 18:51 ` Dr. David Alan Gilbert
2022-04-28 22:10 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.