Re: [PATCH 1/1] mm: allocate order 0 page from pcb before zone_watermark_ok

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

 



hi Michal
2016-06-30 20:35 GMT+08:00 Michal Hocko <mhocko@xxxxxxxxxx>:
> On Wed 29-06-16 22:44:19, vichy wrote:
>> hi all:
>> In normal case, the allocation of any order page started after
>> zone_watermark_ok. But if so far pcp->count of this zone is not 0,
>> why don't we just let order-0-page allocation before zone_watermark_ok.
>> That mean the order-0-page will be successfully allocated even
>> free_pages is beneath zone->watermark.
>
> The watermark check has a good reason. It protects the memory reserves
> which are used for important users or emergency situations. The mere
> fact that there are pages available for the pcp usage doesn't mean that
> we should break this protection. Note that those emergency users might
> want order 0 pages as well.
Got it.
And due to your friendly reminder I found the "emergency users" you
mean, the cases in gfp_to_alloc_flags that will return with
ALLOC_NO_WATERMARKS as below
    if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) {
        if (gfp_mask & __GFP_MEMALLOC)
            alloc_flags |= ALLOC_NO_WATERMARKS;
        else if (in_serving_softirq() && (current->flags & PF_MEMALLOC))
            alloc_flags |= ALLOC_NO_WATERMARKS;
        else if (!in_interrupt() &&
                ((current->flags & PF_MEMALLOC) ||
                 unlikely(test_thread_flag(TIF_MEMDIE))))
            alloc_flags |= ALLOC_NO_WATERMARKS;
    }

Appreciate your kind review,

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



[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]