Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932542Ab2FBE7S (ORCPT ); Sat, 2 Jun 2012 00:59:18 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:59654 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756993Ab2FBE7R (ORCPT ); Sat, 2 Jun 2012 00:59:17 -0400 MIME-Version: 1.0 In-Reply-To: References: <20120530163317.GA13189@redhat.com> <20120531005739.GA4532@redhat.com> <20120601023107.GA19445@redhat.com> <20120601161205.GA1918@redhat.com> <20120601171606.GA3794@redhat.com> From: Linus Torvalds Date: Fri, 1 Jun 2012 21:58:50 -0700 X-Google-Sender-Auth: 1BphR7UYHfcZPYjKyGWiFBLzWiI Message-ID: Subject: Re: WARNING: at mm/page-writeback.c:1990 __set_page_dirty_nobuffers+0x13a/0x170() To: Hugh Dickins Cc: Bartlomiej Zolnierkiewicz , Kyungmin Park , Marek Szyprowski , Mel Gorman , Minchan Kim , Rik van Riel , Dave Jones , Andrew Morton , Cong Wang , Markus Trippelsdorf , linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1214 Lines: 32 On Fri, Jun 1, 2012 at 9:40 PM, Hugh Dickins wrote: > > Move the lock after the loop, I think you meant. Well, I wasn't sure if anything inside the loop might need it. I don't *think* so, but at the same time, what protects "page_order(page)" (or, indeed PageBuddy()) from being stable while that loop content uses them? I don't understand that code at all. It does that crazy iteration over page, and changes "page" in random ways, and then finishes up with a totally new "page" value that is some random thing that is *after* the end_page thing. WHAT? The code makes no sense. It tests all those pages within the page-block, but then after it has done all those tests, it does the final set_pageblock_migratetype(..) move_freepages_block(..) using a page that is *beyond* the pageblock (and with the whole page_order() thing, who knows just how far beyond it?) It looks entirely too much like random-monkey code to me. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/