Re: [Help] Question about vm: fair zone allocator policy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK, I think I got it. Thank you very much!!


2014/1/12 Johannes Weiner <hannes@xxxxxxxxxxx>
On Tue, Jan 07, 2014 at 09:37:01AM +0800, yvxiang wrote:
> Hi, Johannes
>
>      I'm a new comer to vm. And I read your commit 81c0a2bb about fair zone
> allocator policy,  but I don't quite understand your opinion, especially
> the words that
>
>    "the allocator may keep kswapd running while kswapd reclaim
>     ensures that the page allocator can keep allocating from the first zone
> in
>     the zonelist for extended periods of time. "
>
>     Could you or someone else explain me what does this mean in more
> details? Or could you give me a example?

The page allocator tries to allocate from all zones in order of
preference: Normal, DMA32, DMA.  If they are all at their low
watermark, kswapd is woken up and it will reclaim each zone until it's
back to the high watermark.

But as kswapd reclaims the Normal zone, the page allocator can
continue allocating from it.  If that happens at roughly the same
pace, the Normal zone's watermark will hover somewhere between the low
and high watermark.  Kswapd will not go to sleep and the page
allocator will not use the other zones.

The whole workload's memory will be allocated and reclaimed using only
the Normal zone, which might be only a few (hundred) megabytes, while
the 4G DMA32 zone is unused.


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]