Summary: | linprocfs: /proc/meminfo values do not add up | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Alexey Dokuchaev <danfe> | ||||
Component: | kern | Assignee: | Mark Johnston <markj> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | markj | ||||
Priority: | --- | ||||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Alexey Dokuchaev
![]() ![]() Created attachment 217028 [details]
proposed patch
Here is a patch which fixes some problems with the meminfo handler.
(In reply to Mark Johnston from comment #1) Thanks, new code makes a lot more sense. I've tried it yesterday, but observed some strange inconsistencies in the inactive memory numbers reported between top(1) and /compat/linux/proc/meminfo, but that could be due to my pretty old kernel version (Mayish 1300096). I've just svn up'ed to the latest -CURRENT and will reconduct my tests shortly. I also want to compare with the values reported by Fedora Linux on the same laptop. (In reply to Alexey Dokuchaev from comment #2) meminfo does not report inactive memory with my patch, it reports the amount of memory in all page queues. (In reply to Mark Johnston from comment #3) > meminfo does not report inactive memory with my patch Sorry for this confusion; I've modified your patch to report individual values for active, inactive, and laundry pages while trying to understand the differences reported by top(1) and /compat/linux/proc/meminfo. Ping? Any problems with the patch? (In reply to Mark Johnston from comment #5) Ah, sorry, I got side-tracked. Everything looks good now, please commit and thank you Mark! A commit references this bug: Author: markj Date: Wed Aug 12 16:08:45 UTC 2020 New revision: 364168 URL: https://svnweb.freebsd.org/changeset/base/364168 Log: linprocfs: Fix some inaccuracies in meminfo. - Fill out MemFree correctly. Delete an ancient comment suggesting that we don't want to advertise the true quantity of free memory. - Populate the Buffers field by reading vfs.bufspace. - The page cache consists of all pages in page queues, not just the inactive queue. PR: 248463 Reported and tested by: danfe MFC after: 1 week Sponsored by: The FreeBSD Foundation Changes: head/sys/compat/linprocfs/linprocfs.c A commit references this bug: Author: markj Date: Wed Aug 19 13:44:08 UTC 2020 New revision: 364392 URL: https://svnweb.freebsd.org/changeset/base/364392 Log: MFC r364168: linprocfs: Fix some inaccuracies in meminfo. PR: 248463 Changes: _U stable/12/ stable/12/sys/compat/linprocfs/linprocfs.c Thanks for the report. (In reply to Mark Johnston from comment #9) Thanks for the prompt fix and making FreeBSD better! |