Re: [PATCH] mm: compaction: Abort compaction if too many pages areisolated and caller is asynchronous
From: Andrew Morton
Date: Mon Jun 06 2011 - 18:33:05 EST
On Fri, 3 Jun 2011 17:45:54 +0200
Andrea Arcangeli <aarcange@xxxxxxxxxx> wrote:
> On Fri, Jun 03, 2011 at 03:49:41PM +0100, Mel Gorman wrote:
> > Right idea of the wrong zone being accounted for but wrong place. I
> > think the following patch should fix the problem;
>
> Looks good thanks.
>
> I also found this bug during my debugging that made NR_SHMEM underflow.
>
> ===
> Subject: migrate: don't account swapcache as shmem
>
> From: Andrea Arcangeli <aarcange@xxxxxxxxxx>
>
> swapcache will reach the below code path in migrate_page_move_mapping,
> and swapcache is accounted as NR_FILE_PAGES but it's not accounted as
> NR_SHMEM.
>
> Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx>
> ---
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index e4a5c91..2597a27 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -288,7 +288,7 @@ static int migrate_page_move_mapping(struct address_space *mapping,
> */
> __dec_zone_page_state(page, NR_FILE_PAGES);
> __inc_zone_page_state(newpage, NR_FILE_PAGES);
> - if (PageSwapBacked(page)) {
> + if (mapping != &swapper_space && PageSwapBacked(page)) {
> __dec_zone_page_state(page, NR_SHMEM);
> __inc_zone_page_state(newpage, NR_SHMEM);
> }
fyi, this was the only patch I applied from this whole thread. Once the
dust has settled, could people please resend whatever they have,
including any acked-by's and reviewed-by's?
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/