Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1499392

Re: [PATCH 2/4] mm: prevent double decrease of nr_reserved_highatomic

From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] mm: prevent double decrease of nr_reserved_highatomic
Date 2016-10-12 09:00 +0200
Message-ID <srlGa-Ku-35@gated-at.bofh.it> (permalink)
References <spwcF-3WG-3@gated-at.bofh.it> <spwcF-3WG-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Oct 07, 2016 at 02:45:34PM +0900, Minchan Kim wrote:
> There is race between page freeing and unreserved highatomic.
> 
>  CPU 0				    CPU 1
> 
>     free_hot_cold_page
>       mt = get_pfnblock_migratetype
>       set_pcppage_migratetype(page, mt)
>     				    unreserve_highatomic_pageblock
>     				    spin_lock_irqsave(&zone->lock)
>     				    move_freepages_block
>     				    set_pageblock_migratetype(page)
>     				    spin_unlock_irqrestore(&zone->lock)
>       free_pcppages_bulk
>         __free_one_page(mt) <- mt is stale
> 
> By above race, a page on CPU 0 could go non-highorderatomic free list
> since the pageblock's type is changed. By that, unreserve logic of
> highorderatomic can decrease reserved count on a same pageblock
> several times and then it will make mismatch between
> nr_reserved_highatomic and the number of reserved pageblock.
> 
> So, this patch verifies whether the pageblock is highatomic or not
> and decrease the count only if the pageblock is highatomic.
> 
> Signed-off-by: Minchan Kim <minchan@kernel.org>

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 2/4] mm: prevent double decrease of nr_reserved_highatomic Minchan Kim <minchan@kernel.org> - 2016-10-07 07:50 +0200
  Re: [PATCH 2/4] mm: prevent double decrease of nr_reserved_highatomic Vlastimil Babka <vbabka@suse.cz> - 2016-10-07 14:50 +0200
    Re: [PATCH 2/4] mm: prevent double decrease of nr_reserved_highatomic Minchan Kim <minchan@kernel.org> - 2016-10-07 16:50 +0200
  Re: [PATCH 2/4] mm: prevent double decrease of nr_reserved_highatomic Mel Gorman <mgorman@techsingularity.net> - 2016-10-12 09:00 +0200

csiph-web