Re: [PATCH -mm -v2] mm, swap: Use kvzalloc to allocate some swap data structure

2017-04-06 Thread Huang, Ying
Hi, Matthew, Matthew Wilcox writes: > On Wed, Apr 05, 2017 at 03:10:58PM +0800, Huang, Ying wrote: >> In general, kmalloc() will have less memory fragmentation than >> vmalloc(). From Dave Hansen: For example, we have a two-page data >> structure. vmalloc() takes two

Re: [PATCH -mm -v2] mm, swap: Use kvzalloc to allocate some swap data structure

2017-04-06 Thread Huang, Ying
Hi, Matthew, Matthew Wilcox writes: > On Wed, Apr 05, 2017 at 03:10:58PM +0800, Huang, Ying wrote: >> In general, kmalloc() will have less memory fragmentation than >> vmalloc(). From Dave Hansen: For example, we have a two-page data >> structure. vmalloc() takes two effectively random

Re: [PATCH -mm -v2] mm, swap: Use kvzalloc to allocate some swap data structure

2017-04-06 Thread Matthew Wilcox
On Wed, Apr 05, 2017 at 03:10:58PM +0800, Huang, Ying wrote: > In general, kmalloc() will have less memory fragmentation than > vmalloc(). From Dave Hansen: For example, we have a two-page data > structure. vmalloc() takes two effectively random order-0 pages, > probably from two different 2M

Re: [PATCH -mm -v2] mm, swap: Use kvzalloc to allocate some swap data structure

2017-04-06 Thread Matthew Wilcox
On Wed, Apr 05, 2017 at 03:10:58PM +0800, Huang, Ying wrote: > In general, kmalloc() will have less memory fragmentation than > vmalloc(). From Dave Hansen: For example, we have a two-page data > structure. vmalloc() takes two effectively random order-0 pages, > probably from two different 2M

[PATCH -mm -v2] mm, swap: Use kvzalloc to allocate some swap data structure

2017-04-05 Thread Huang, Ying
From: Huang Ying Now vzalloc() is used in swap code to allocate various data structures, such as swap cache, swap slots cache, cluster info, etc. Because the size may be too large on some system, so that normal kzalloc() may fail. But using kzalloc() has some advantages,

[PATCH -mm -v2] mm, swap: Use kvzalloc to allocate some swap data structure

2017-04-05 Thread Huang, Ying
From: Huang Ying Now vzalloc() is used in swap code to allocate various data structures, such as swap cache, swap slots cache, cluster info, etc. Because the size may be too large on some system, so that normal kzalloc() may fail. But using kzalloc() has some advantages, for example, less