Skip to contentSkip to conversation

Performance degradation with memory compaction (on QC chip-set)

Query PINTU KUMAR 2 participants 3 messages May 13, 2013 6 messages not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Dear Mel Gorman,

I have one question about memory compaction.
Kernel version: kernel-3.4 (ARM)
Chipset: Qual-Comm MSM8930 dual-core.

We wanted to enable CONFIG_COMPACTION for our product with kernel-3.4.
But QC commented that, enabling compaction on their chip-set is causing performance degradation for some streaming scenarios (from the beginning).

I wanted to know is this possible always?
We used compaction with exynos processor and did not observe any performance degradation.

All,
Does any one observed any performance problem (on any chipset) by enabling compaction?

Please let me know your comments.
It will be helpful to decide on enabling compaction or not.

Thank You.
With Regards,
Pintu

Quoted 98 lines

________________________________
From: Mel Gorman <[email protected]>
To: Pintu Agarwal <[email protected]>
Sent: Tuesday, 12 July 2011 8:44 AM
Subject: Re: How to verify memory compaction on Kernel2.6.36??

Quoted 3 lines · Pintu Agarwal


Actually I enabled compaction without HUGETLB support. Hope this is fine.

In terms of compaction yes. In terms of your target application, I don't know.

Quoted 3 lines

Then I wrote a sample kernel module to allocate physical pages using kmalloc.
(By passing the memory size from sample user space application and passing to this kernel module via ioctl calls)

The allocations will not be accessible to userspace without additional driver support to map the pages in userspace.

Quoted 18 lines

Using these application, I request for total number of physical pages of the desired order(from commandline of user app). And at the sametime verifying the buddyinfo before and after the allocation.
A sample output of my application is as follows:-
============================================================
/opt/pintu # ./app_pinchar.bin
Node 0, zone   Normal     34      9     13      7     11      6      2      2      3      1     36 Node 0, zone  HighMem     53    194    110     36     21      7      1      2      3      2      6 Page block order: 10
Pages per block:  1024
Free pages count per migrate type at order       0      1      2      3      4      5      6      7      8      9     10 Node    0, zone   Normal, type    Unmovable     32      5      8      5     11      5      2      0      2      0      0 Node    0, zone   Normal, type  Reclaimable      1      2      4      2      0      0      0      1      1      1      0 Node    0, zone   Normal, type      Movable      1      0      1      0      0      1      0      1      0      0     35 Node    0, zone   Normal, type      Reserve      0      0      0      0      0      0      0      0      0      0      1 Node    0, zone   Normal, type      Isolate      0      0      0      0      0      0      0      0      0      0      0 Node    0, zone  HighMem, type    Unmovable      1      0      2      3      1      0      0      1      2      1      1 Node    0, zone  HighMem, type  Reclaimable      0      0      0      0      0      0      0      0      0      0      0 Node    0, zone  HighMem, type      Movable     21    194    108     33     20      7      1      1      1      1      4

Quoted 8 lines

Node    0, zone  HighMem, type      Reserve      0      0      0      0      0      0      0      0      0      0      1 Node    0, zone  HighMem, type      Isolate      0      0      0      0      0      0      0      0      0      0      0 Number of blocks type     Unmovable  Reclaimable      Movable      Reserve      Isolate
Node 0, zone   Normal           82            4           73            1            0
Node 0, zone  HighMem           14            0           81            1            0
-------------------------------------------------------------------------------------------

Enter the page order(in power of 2) : 512

Page order 512? That's a good trick. I assume you means order 9 for 512 pages.

Quoted 4 lines

Enter the number of such block : 200
ERROR : ioctl - PINCHAR_ALLOC - Failed, after block num = 72 !!! DONE.....

72 corresponds almost exactly to the number of order-9 pages that were free when the application started.

Quoted 4 lines

==========================================================================================
Node 0, zone   Normal    100     84     53     36     33     21      8      0      3      2      0 Node 0, zone  HighMem    844    744    612    357    200     91      8      3      4      1      6

There is almost no free memory in the Normal zone at this stage of the test implying that even perfect compaction of all pages would still not result in a new order-9 page while obeying watermarks.

Quoted 3 lines

============================================================

Then I want to verify whether compaction is working for the all allocation request or not.

Read /proc/vmstat but I doubt it was used much. Memory was mostly unfragmented when the application started. It is likely that after 72 order-9 pages there was not enough free memory to compact further and that is why the allocation failed.

Quoted 2 lines

OR, at least how far compaction is helpful in these scenarios.

Compaction would have been helpful in the event the system has been running for some time and was fragmented. This test looks like it happened very close to boot so compaction would not have been requried.

Quoted 2 lines

Please let me know how compaction can be effective in such cases where order 8,9,10 pages are requested.

Compaction reduces allocation latencies when memory is fragmented for high-order allocations like this. I'm not what else you are expecting to hear.

Signature · 2 lines
Mel Gorman
SUSE Labs
#7 lore raw

* Sorry Re-sending as plain text.

Dear Mr. Mel Gorman,

I have one question about memory compaction.
Kernel version: kernel-3.4 (ARM)
Chipset: Qual-Comm MSM8930 dual-core.

We wanted to enable CONFIG_COMPACTION for our product with kernel-3.4.
But QC commented that, enabling compaction on their chip-set is causing performance degradation for some streaming scenarios (from the beginning).

I wanted to know is this possible always?
We used compaction with exynos processor and did not observe any performance degradation.

All,
Does any one observed any performance problem (on any chipset) by enabling compaction?

Please let me know your comments.
It will be helpful to decide on enabling compaction or not.

Thank You.
With Regards,
Pintu

Quoted 21 lines
Quoted 21 lines

________________________________
From: Mel Gorman <[email protected]>
To: Pintu Agarwal <[email protected]>
Sent: Tuesday, 12 July 2011 8:44 AM
Subject: Re: How to verify memory compaction on Kernel2.6.36??

Quoted 3 lines · Pintu Agarwal


Actually I enabled compaction without HUGETLB support. Hope this is fine.

In terms of compaction yes. In terms of your target application, I don't know.

Quoted 3 lines

Then I wrote a sample kernel module to allocate physical pages using kmalloc.
(By passing the memory size from sample user space application and passing to this kernel module via ioctl calls)

Quoted 6 lines
Quoted 6 lines

The allocations will not be accessible to userspace without additional driver support to map the pages in userspace.

Quoted 3 lines

Using these application, I request for total number of physical pages of the desired order(from commandline of user app). And at the sametime verifying the buddyinfo before and after the allocation.
A sample output of my application is as

follows:-

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

============================================================
/opt/pintu # ./app_pinchar.bin
Node 0, zone   Normal     34      9     13      7     11      6      2      2      3      1     36 Node 0, zone  HighMem     53    194    110     36     21      7      1      2      3      2      6 Page block order: 10
Pages per block:  1024
Free pages count per migrate type at

order       0      1      2      3      4      5      6      7      8      9     10

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Node    0, zone   Normal, type    Unmovable     32      5      8      5     11      5      2      0      2      0      0 Node    0, zone   Normal, type  Reclaimable      1

2      4      2      0      0      0      1      1      1      0

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Node    0, zone   Normal, type      Movable      1      0      1      0      0      1      0      1      0      0     35 Node    0, zone   Normal, type      Reserve      0      0      0

0      0      0      0      0      0      0      1

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Node    0, zone   Normal, type      Isolate      0      0      0      0      0      0      0      0      0      0      0 Node    0, zone  HighMem, type    Unmovable      1      0      2      3      1

0      0      1      2      1      1

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Node    0, zone  HighMem, type  Reclaimable      0      0      0      0      0      0      0      0      0      0      0 Node    0, zone  HighMem, type      Movable     21    194    108     33     20      7      1      1

1      1      4

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Node    0, zone  HighMem, type      Reserve      0      0      0      0      0      0      0      0      0      0      1 Node    0, zone  HighMem, type      Isolate      0      0      0      0      0      0      0      0      0      0

0

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Number of blocks type     Unmovable  Reclaimable      Movable      Reserve      Isolate Node 0, zone   Normal           82            4           73            1            0 Node 0, zone  HighMem           14            0           81            1            0

-------------------------------------------------------------------------------------------

Quoted 11 lines
Quoted 11 lines
Quoted 2 lines


Enter the page order(in power of 2) : 512

Page order 512? That's a good trick. I assume you means order 9 for 512 pages.

Quoted 4 lines

Enter the number of such block : 200
ERROR : ioctl - PINCHAR_ALLOC - Failed, after block num = 72 !!! DONE.....

Quoted 5 lines
Quoted 5 lines

72 corresponds almost exactly to the number of order-9 pages that were free when the application started.

Quoted 2 lines

==========================================================================================
Node 0, zone   Normal    100     84     53     36     33     21      8      0      3

2      0

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

Node 0, zone  HighMem    844    744    612    357    200     91      8      3      4      1      6

There is almost no free memory in the Normal zone at this stage of the test implying that even perfect compaction of all pages would still not result in a new order-9 page while obeying watermarks.

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

============================================================

Then I want to verify whether compaction is working for the all allocation request or not.

Read /proc/vmstat but I doubt it was used much. Memory was mostly unfragmented when the application started. It is likely that after 72 order-9 pages there was not enough free

memory to compact further

Quoted 16 lines
Quoted 16 lines

and that is why the allocation failed.

Quoted 2 lines

OR, at least how far compaction is helpful in these scenarios.

Compaction would have been helpful in the event the system has been running for some time and was fragmented. This test looks like it happened very close to boot so compaction would not have been requried.

Quoted 2 lines

Please let me know how compaction can be effective in such cases where order 8,9,10 pages are requested.

Compaction reduces allocation latencies when memory is fragmented for high-order allocations like this. I'm not what else you are expecting to hear.

Quoted 8 lines
Quoted 6 lines
Signature · 2 lines
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#8 lore raw
In reply to PINTU KUMAR
Quoted 6 lines · PINTU KUMAR

Dear Mel Gorman,

I have one question about memory compaction.
Kernel version: kernel-3.4 (ARM)
Chipset: Qual-Comm MSM8930 dual-core.

Quoted 6 lines

We wanted to enable CONFIG_COMPACTION for our product with kernel-3.4.
But QC commented that, enabling compaction on their chip-set is causing performance degradation for some streaming scenarios (from the beginning).

I wanted to know is this possible always?
We used compaction with exynos processor and did not observe any performance degradation.

I suspect one of their drivers are using high-order allocations and hitting compaction as a result. Compaction is not guaranteed to cause overhead but if it's in use then the scanning and copying overhead can cause problems.

Quoted 3 lines

Please let me know your comments.
It will be helpful to decide on enabling compaction or not.

Depends on workload and drivers.

Signature · 8 lines
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>