Re: WARNING: at mm/page-writeback.c:1990 __set_page_dirty_nobuffers+0x13a/0x170()

From: KOSAKI Motohiro
Date: Sun Jun 03 2012 - 21:26:57 EST


> Right. I missed that. I think we can use the page passed to rescue_unmovable_pageblock.
> We make sure it's valid in isolate_freepages. So how about this?
>
> barrios@bbox:~/linux-2.6$ git diff
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 4ac338a..7459ab5 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -368,11 +368,11 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
>  static bool rescue_unmovable_pageblock(struct page *page)
>  {
>        unsigned long pfn, start_pfn, end_pfn;
> -       struct page *start_page, *end_page;
> +       struct page *start_page, *end_page, *cursor_page;
>
>        pfn = page_to_pfn(page);
>        start_pfn = pfn & ~(pageblock_nr_pages - 1);
> -       end_pfn = start_pfn + pageblock_nr_pages;
> +       end_pfn = start_pfn + pageblock_nr_pages - 1;
>
>        start_page = pfn_to_page(start_pfn);
>        end_page = pfn_to_page(end_pfn);
> @@ -381,19 +381,19 @@ static bool rescue_unmovable_pageblock(struct page *page)
>        if (page_zone(start_page) != page_zone(end_page))
>                return false;
>
> -       for (page = start_page, pfn = start_pfn; page < end_page; pfn++,
> -                                                                 page++) {
> +       for (cursor_page = start_page, pfn = start_pfn; cursor_page <= end_page; pfn++,
> +                                                                 cursor_page++) {
>                if (!pfn_valid_within(pfn))
>                        continue;

I guess page_zone() should be used after pfn_valid_within(). Why can
we assume invalid
pfn return correct zone?


> -               if (PageBuddy(page)) {
> -                       int order = page_order(page);
> +               if (PageBuddy(cursor_page)) {
> +                       int order = page_order(cursor_page);
>
>                        pfn += (1 << order) - 1;
> -                       page += (1 << order) - 1;
> +                       cursor_page += (1 << order) - 1;
>
>                        continue;
> -               } else if (page_count(page) == 0 || PageLRU(page))
> +               } else if (page_count(cursor_page) == 0 || PageLRU(cursor_page))
>                        continue;
>
>                return false;
--
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/