Bug 77253 - [linux] meminfo in linprocfs returns bad value about swap.
Summary: [linux] meminfo in linprocfs returns bad value about swap.
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 4.10-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 09:00 UTC by TsurutaniNaoki
Modified: 2006-01-15 07:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TsurutaniNaoki 2005-02-08 09:00:28 UTC
"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.

Fix: 

I don't know.
	"swapblist" in /usr/src/sys/i386/linux/linprocfs/linprocfs_misc.c might be suspicious....
How-To-Repeat: 	always when 2 swap device is specified.
	only 1 device does not make such result.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2005-07-23 03:16:08 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-emulation

Over to maintainer(s).
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2005-07-25 21:20:59 UTC
Responsible Changed
From-To: freebsd-emulation->emulation

Canonicalize assignment.
Comment 3 Alexander Leidinger freebsd_committer freebsd_triage 2005-12-29 16:15:04 UTC
State Changed
From-To: open->feedback

Is this still a problem with a recent FreeBSD?
Comment 4 Alexander Leidinger freebsd_committer freebsd_triage 2006-01-14 14:26:04 UTC
State Changed
From-To: feedback->open

Still a problem on 5-stable: 
---snip--- 
Yes, it is still bogus... 

polymer3 % uname -a 
FreeBSD polymer3.scphys.kyoto-u.ac.jp 5.4-STABLE FreeBSD 5.4-STABLE #11: 
Mon Dec 26 11:23:23 JST 2005     turutani@polymer3.scphys.kyotou.ac.jp:/usr/obj/usr/src/sys/POLYMER  i386 

polymer3 % cat /compat/linux/proc/meminfo 
total:    used:    free:  shared: buffers:  cached: 
Mem:  527863808 90378240 437485568 16003072 0 25706496 
Swap: 18446744071562067968 229376 18446744071561838592 
MemTotal:    515492 kB 
MemFree:     427232 kB 
MemShared:    15628 kB 
Buffers:          0 kB 
Cached:       25104 kB 
SwapTotal:18014398507384832 kB 
SwapFree: 18014398507384608 kB 

polymer3 % swapinfo 
Device          1K-blocks     Used    Avail Capacity 
/dev/ad0s1b       1048576       88  1048488     0% 
/dev/ad1s1b       1048576      136  1048440     0% 
Total             2097152      224  2096928     0% 

polymer3 % cat /var/run/dmesg.boot | grep memory 
real memory  = 536805376 (511 MB) 
avail memory = 515629056 (491 MB) 
---snip---
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2006-01-14 18:20:04 UTC
State Changed
From-To: open->analyzed

ISTM 'analyzed' is a better state for this.
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2006-01-15 07:02:42 UTC
State Changed
From-To: analyzed->closed

Submitter notes that the latest cvsup has fixed the problem.