2009-07-08 03:43:59 Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Hari Prasad (INDIA)
Message: 76908
Hi,
In the uclinux distribution uclinux-dist-trunk-svn-7856, I do not see the option "Allow non-power of 2 allocations" in kernel configuration?
Is this option available in this kernel release?
QuoteReplyEditDelete
2009-07-08 14:26:35 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Robin Getz (UNITED STATES)
Message: 76930
Hari:
Most were dropped, since they caused more problems than they fixed - and the memory allocators in the kernel are much better on noMMU targets now.
-Robin
QuoteReplyEditDelete
2009-07-09 00:00:21 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Hari Prasad (INDIA)
Message: 76938
Hi Robin,
We have an application which when after booting up in 2008R1.5 kernel shows a free memory of 18MB on giving free command. When the same application is booted in 2009R1-pre kernel, the free command shows only 8 MB which is problematic for us. I think this huge difference in free memory is because of the presence of non-power 2 feature in 2008R1.5 and its absence in 2009R1-pre.
How can we achieve the same amount of free memory in 2009R1-pre?
QuoteReplyEditDelete
2009-07-09 00:09:49 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Sonic Zhang (CHINA)
Message: 76939
non-power 2 feature is not enabled by default in 2008R1.5. Are you sure you get 18MB free memory when enable non-power 2 feature? And what's the result if power 2 feature is enabled in 2008R1.5?
QuoteReplyEditDelete
2009-07-09 05:54:53 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Hari Prasad (INDIA)
Message: 76963
Hi Sonic,
I took the application that was ported for 2008R1.5 kernel. The free memory output is 16 MB with NP2 (non-power of 2) enabled and 12MB with NP2 same disabled. That shows a clear difference in memory usage with and without NP2.
QuoteReplyEditDelete
2009-07-09 10:53:06 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Robin Getz (UNITED STATES)
Message: 76970
Hari:
Can you look at /proc/meminfo - between the 2 kernel's and see where memory is being used?
-Robin
QuoteReplyEditDelete
2009-07-13 01:00:18 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Hari Prasad (INDIA)
Message: 77098
Hi Robin,
Do clarify this problem in a simple way, we wrote 2 sample codes, one that allocates 1000KB of static mem and the other allocates 1024KB of static mem.
When we ran this code in 2008R1.5 kernel, the difference in free memory output is same as the static memory size.
However, we see a clear difference in mem allocation pattern for 2009R1pre as follows:
1. Free memory: 48120 KB
2. Free mem after allocating 1000KB : 46424 (Difference of 1696 KB)
3. Free mem after allocating 1024KB: 45400 (Difference of 2720 KB)
Hence, a request of 1024KB of memory leads to a consumption of 2720KB of memory.
I would like to know if there is any way to bring back the NP2 behavior in 2009R1pre kernel also so that our application porting works fine in the new kernel?
Kindly provide your valuable inputs.
QuoteReplyEditDelete
2009-07-13 07:52:09 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Robin Getz (UNITED STATES)
Message: 77122
Hari:
if you really see an impact - you have the source - you can do it - with our testing -- it did not help that much, and only lead to more problems.
-Robin
QuoteReplyEditDelete
2009-07-13 08:58:21 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Hari Prasad (INDIA)
Message: 77127
Hi Robin,
Could you please let us know how to bring in the NP2 feature in 2009R1pre? I was analysing the codebase and found that this feature is linked to the macro CONFIG_NP2. It would be helpful if you can let me know the necessary changes to be done to enable this macro.
QuoteReplyEditDelete
2009-07-13 09:09:18 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Robin Getz (UNITED STATES)
Message: 77128
Hari:
Like I said - you have the source - you can do the work. Open the files with vi, copy, paste them into the newer kernel - try to compile - fix bugs, repeat. That is as much instructions as I can give.
-Robin
QuoteReplyEditDelete
2009-07-15 06:20:41 Re: Regarding non-power of 2 allocations in uclinux-dist-trunk-svn-7856
Hari Prasad (INDIA)
Message: 77334
Hi Robin,
I need few clarifications regarding a difference which I observed in the output of cat /proc/meminfo. When I ran my application in 2008R1.5 kernel, its output was as follows:
MemTotal: 60216 kB
MemFree: 15648 kB
Buffers: 0 kB
Cached: 11672 kB
SwapCached: 0 kB
Active: 10004 kB
Inactive: 1668 kB
When I ran the same application in 2009R1pre, it was as follows:
MemTotal: 60572 kB
MemFree: 7104 kB
Buffers: 0 kB
Cached: 16840 kB
SwapCached: 0 kB
Active: 756 kB
Inactive: 16044 kB
I request you to clarify the following:
1. Why there is a decrease in 'MemFree' and increase in 'Inactive' in 2009R1pre kernel?
2. How do I retrieve the Inactive cache memory and use it in my application?
TIA.