No subject


Fri Jan 21 21:43:21 CET 2005


[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 7bit, Size: 1.5K --]

Hi.

A patch was applied to kdebase/kcontrol/memory_solaris.cpp between
3.3.1 and 3.3.2.

This patch (diff between 3.3.1 and 3.3.2 attached) is wrong. The
values reported by memory_solaris with this new patch are orders of
magnitude off reality.

1. sysconf(_SC_PHYS_PAGES) does not report the total number of pages
available to memory, just the number of pages in physical memory
(i.e. core RAM).
2. swapctl (SC_AINFO, (void *) &struct anoninfo) reports wrong values.
A comment to this effect already exists in memory_solaris.cpp.

Values reported by the new patch :

total memory: 2097152 MB
total swap: 1546632 MB
free swap: 1131280 MB
used swap: 415852 MB

swap -s reports:

[steleman at obiwan][~/tmp][12/04/2004 20:22:21][3353]>> swap -s
total: 276296k bytes allocated + 138784k reserved = 415080k used,
9520168k available

This box has 2GB core RAM and 8GB swap. Total memory should be
reported as 2GB physical + 8GB swap. Total swap should be reported as
8192 MB.

The following #ifdef block is also wrong:

/* Stop <sys/swap.h> from crapping out on 32-bit architectures. */

#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
# undef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 32
#endif

_FILE_OFFSET_BITS should *not* be redefined to 32. The error in
sys/procfs.h is fixed by making _FILE_OFFSET_BITS undefined in this
file only.

The values reported by memory_solaris.cpp before this patch were
correct.

--Stefan

--
Stefan Teleman          'Nobody Expects the Spanish Inquisition'
steleman at nyc.rr.com                          -Monty Python
---





Now my comments:

"1. sysconf(_SC_PHYS_PAGES) does not report the total number of pages
available to memory, just the number of pages in physical memory
(i.e. core RAM)."

a. This is part of the real memory side of things which I never even changed.
This has *nothing* to do with the changes I made in the patch I submitted.
b. Either I'm stupid or not following you - but it's a standard asumption that
if you're providing both total MEMORY and total SWAP in the same statistical
area that it implies total MEMORY is REAL MEMORY.

"2. swapctl (SC_AINFO, (void *) &struct anoninfo) reports wrong values.
A comment to this effect already exists in memory_solaris.cpp."

Wrong wrong wrong.

At this moment, I'm looking at the Solaris 5.9 source code for swap.c and various
other VM related tools/libs and they're using the same structures and methods as
I did using anoninfo structs. Is Sun wrong too?

Perhaps the comment you're referring to is the one *I* added - which did
not say what you paraphrased. In addition there were no comments present
in the code previous to my patching that dictated what you said above. Go
ahead and check out revision 1.3 of kdebase/kcontrol/info/memory_solaris.cpp
if you don't believe me.

This was my comment added:

        /*
         *  Retrieve overall swap information from anonymous memory structure -
         *  which is the same way "swap -s" retrieves it's statistics.
         *
         *  swapctl(SC_LIST, void *arg) does not return what we are looking for.
         */


Anyways:

[clayne at build02-sol8-x86 ~]$ swap -s
total: 605024k bytes allocated + 532732k reserved = 1137756k used, 1748648k available

Of which kinfocenter reports:

TOTAL: 2955677696 = 2.75 GB
FREE:  1790738432 = 1.67 GB
USED:  1164939264 (using basic math)

Divide all by 1024, we derive:

USED:  1137636k
FREE:  1748768k

So if you're referring to a 120k difference (when we're dealing with gigs here) as
"orders of magnitude off reality" I really don't know what to tell you.

"The values reported by memory_solaris.cpp before this patch were
correct."

No they were not - which is why I wrote the patch in the first place.

It's quite possible that the code still has issues with machines utilizing greater
than 4GB of swap. In the machine you list as having 8GB as swap, is this a single
8 GB swap file, or multiple?




In regards to the _FILE_OFFSET_BITS issue:

1. Undefine, or set it to 32, it really doesn't matter in this case.
2. I do remember this disussion which you NEVER replied to:



From: steleman at nyc.rr.com
To: KDE Solaris <kde-solaris at mail.kde.org>
Cc: coolo at kde.org, kde-solaris at kde.org, deller at kde.org, waba at kde.org,
   tk at Genetik.Uni-Bielefeld.DE
Date: Tue, 19 Oct 2004 23:09:20 -0400
Subject: Re: [kde-solaris] kdebase/kcontrol/info/memory_solaris.cpp patch


More information about the kde-solaris mailing list