bad patch applied to kdebase/kcontrol/memory_solaris.cpp

Stefan Teleman steleman at nyc.rr.com
Sun Dec 5 01:16:00 GMT 2004


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memory_solaris.cpp.diff
Type: text/x-diff
Size: 2482 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20041204/4f4f8a1b/attachment.diff>


More information about the kde-core-devel mailing list