VirtFS possible memory leak in 9p virtio mapped
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| QEMU |
Invalid
|
Undecided
|
Unassigned | ||
Bug Description
I use as client Debian squeeze i386 with a custom kernel:
Linux (none) 2.6.35.5 #3 Thu Sep 23 18:36:02 UTC 2010 i686 GNU/Linux
And as host Debian squeeze amd64
Linux asd 2.6.32-5-amd64 #1 SMP Fri Sep 17 21:50:19 UTC 2010 x86_64 GNU/Linux
kvm version is:
kvm-88-
Started the client using:
sudo /usr/local/
I've done following inside the guest:
$ mount -t 9p -o trans=virtio host /mnt
$ rm -f /mnt/test
$ touch /mnt/test
$ ls -l /mnt/test
$ while true ;do ls -l /mnt/test > /dev/null; done
Now I can see on my host system that the memory consumption starts at 90MB and after a minute it raises to 130MB. The extra memory consumption stops when I stop the while-loop.
$ while true ;do ls -l /tmp > /dev/null; done
Doesn't show that behaviour.

Updated to v2.6.36.6 with https:/ /patchwork. kernel. org/patch/ 127401/ and it still has the problem. It increases the memory usage not as fast, but it still quite a lot.
I also tried to mount it using -oversion=9p2000.L
/sys/kernel/ debug/kmemleak says on unmount:
unreferenced object 0xf791a870 (size 192): alloc+0x70/ 0x160 0x254/0x440 scan_root+ 0x260/0x3b3 root_add+ 0x295/0x4b7 probe+0x72/ 0x277 probe_device+ 0x135/0x410 attach+ 0x11f/0x130 each_dev+ 0x92/0x110 attach+ 0x27/0x40 driver+ 0x1bd/0x4e0 register+ 0xcb/0x290 register_ driver+ 0x55/0x65 root_init+ 0x47/0x72 initcall+ 0x3e/0x2c0 init+0x1a6/ 0x305 thread_ helper+ 0x6/0x14 alloc+0x70/ 0x160 0x254/0x440 0x68/0xd0 scan_root+ 0x2a6/0x3b3 root_add+ 0x295/0x4b7 probe+0x72/ 0x277 probe_device+ 0x135/0x410 attach+ 0x11f/0x130 each_dev+ 0x92/0x110 attach+ 0x27/0x40 driver+ 0x1bd/0x4e0 register+ 0xcb/0x290 register_ driver+ 0x55/0x65 root_init+ 0x47/0x72 initcall+ 0x3e/0x2c0 alloc+0x70/ 0x160 alloc+0x21b/ 0x340 create+ 0x59/0xf0 create+ 0xe2/0x650 init+0x35f/ 0x890 sb+0xb1/ 0x440 mount+0xaa/ 0x240 mount+0x53/ 0x1c0 0x88a/0x10f0 0xe2/0x170 do_call+ 0x12/0x38
comm "swapper", pid 1, jiffies 4294892433 (age 784.692s)
hex dump (first 32 bytes):
00 00 00 e0 00 00 00 00 ff ff bf fe 00 00 00 00 ................
00 b9 9d f7 00 02 00 00 6b 6b 6b 6b 6b 6b 6b 6b ........kkkkkkkk
backtrace:
[<c1616140>] kmemleak_
[<c1174ad4>] __kmalloc+
[<c16210cf>] pci_acpi_
[<c161c98b>] acpi_pci_
[<c1343dd7>] acpi_device_
[<c1404db5>] driver_
[<c14051af>] __driver_
[<c14037a2>] bus_for_
[<c14049b7>] driver_
[<c1403ced>] bus_add_
[<c14056bb>] driver_
[<c1345129>] acpi_bus_
[<c196c96e>] acpi_pci_
[<c100105e>] do_one_
[<c1940546>] kernel_
[<c10049c2>] kernel_
unreferenced object 0xf79db900 (size 16):
comm "swapper", pid 1, jiffies 4294892433 (age 784.692s)
hex dump (first 16 bytes):
50 43 49 20 42 75 73 20 30 30 30 30 3a 30 30 00 PCI Bus 0000:00.
backtrace:
[<c1616140>] kmemleak_
[<c1174ad4>] __kmalloc+
[<c12efbb8>] kvasprintf+
[<c12efc4d>] kasprintf+0x2d/0x50
[<c1621115>] pci_acpi_
[<c161c98b>] acpi_pci_
[<c1343dd7>] acpi_device_
[<c1404db5>] driver_
[<c14051af>] __driver_
[<c14037a2>] bus_for_
[<c14049b7>] driver_
[<c1403ced>] bus_add_
[<c14056bb>] driver_
[<c1345129>] acpi_bus_
[<c196c96e>] acpi_pci_
[<c100105e>] do_one_
unreferenced object 0xf6a12c60 (size 96):
comm "mount", pid 1191, jiffies 4294893979 (age 778.536s)
hex dump (first 32 bytes):
01 00 00 00 ad 4e ad de ff ff ff ff ff ff ff ff .....N..........
28 65 11 c2 80 e8 b8 c1 8d 2c 78 c1 00 00 00 00 (e.......,x.....
backtrace:
[<c1616140>] kmemleak_
[<c117380b>] kmem_cache_
[<c160c4a9>] p9_idpool_
[<c160b4b2>] p9_client_
[<c129b1df>] v9fs_session_
[<c1295a51>] v9fs_get_
[<c118c60a>] vfs_kern_
[<c118c833>] do_kern_
[<c11bb41a>] do_mount+
[<c11bbd62>] sys_mount+
[<c10043df>] sysenter_
[<ffffffff>] 0xffffffff
unreferenced object 0xf6bb6cc0 (size 148):
comm "mount", pid 1191, jiffies 4294893979 (age 778.536s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 0...