kern/77253: meminfo in linprocfs returns bad value about swap.

Tsurutani Naoki turutani at
Tue Feb 8 01:00:34 PST 2005

>Number:         77253
>Category:       kern
>Synopsis:       meminfo in linprocfs returns bad value about swap.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 08 09:00:28 GMT 2005
>Originator:     Tsurutani Naoki
>Release:        FreeBSD 4.10-STABLE i386
System: FreeBSD 4.10-STABLE FreeBSD 4.10-STABLE #15: Sat Aug 7 13:16:19 JST 2004 root at i386

"cat /compat/linux/proc/meminfo" returns bad value about swap size in use. On host with next swap partision:
	% swapinfo
	Device          1K-blocks     Used    Avail Capacity  Type
	/dev/ad0s1b        262016        0   262016     0%    Interleaved
	/dev/rad1s1b      1048448        0  1048448     0%    Interleaved
	Total             1310464        0  1310464     0%

	"cat /compat/linux/proc/meminfo" shows next values:
	% cat /compat/linux/proc/meminfo
	        total:    used:    free:  shared: buffers:  cached:
	Mem:  532656128 66535424 466120704 14569472 0 25350144
	Swap: 1073741824 18446744073441378304 1341915136
	MemTotal:    520172 kB
	MemFree:     455196 kB
	MemShared:    14228 kB
	Buffers:          0 kB
	Cached:       24756 kB
	SwapTotal:  1048576 kB
	SwapFree:   1310464 kB

	The 2nd column in "Swap:" line is incorrect, and this is due to
	bad "total swap size" of the 1st column in that line.
	I guess this value is the size of 2nd swap device. But the unused swap
	size shows correct size, so the difference of 2 values becomes
	negative value and shows large long long integer value.

	always when 2 swap device is specified.
	only 1 device does not make such result.
I don't know.
	"swapblist" in /usr/src/sys/i386/linux/linprocfs/linprocfs_misc.c might be suspicious.... 



More information about the freebsd-bugs mailing list