Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751945AbbGWFmn (ORCPT ); Thu, 23 Jul 2015 01:42:43 -0400 Received: from TYO201.gate.nec.co.jp ([210.143.35.51]:51787 "EHLO tyo201.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbbGWFmh convert rfc822-to-8bit (ORCPT ); Thu, 23 Jul 2015 01:42:37 -0400 From: Naoya Horiguchi To: Vlastimil Babka CC: Andrew Morton , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "minkyung88.kim" , "kmk3210@gmail.com" , Seungho Park , Joonsoo Kim , Minchan Kim , Michal Nazarewicz , Laura Abbott , Johannes Weiner , "Kirill A. Shutemov" , Mel Gorman Subject: Re: [PATCH 1/2] mm, page_isolation: remove bogus tests for isolated pages Thread-Topic: [PATCH 1/2] mm, page_isolation: remove bogus tests for isolated pages Thread-Index: AQHQw7RlRbwSelHiq0u219C9IXCyFp3n9iaA Date: Thu, 23 Jul 2015 05:41:28 +0000 Message-ID: <20150723054127.GA25423@hori1.linux.bs1.fc.nec.co.jp> References: <55969822.9060907@suse.cz> <1437483218-18703-1-git-send-email-vbabka@suse.cz> In-Reply-To: <1437483218-18703-1-git-send-email-vbabka@suse.cz> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.7] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2498 Lines: 43 On Tue, Jul 21, 2015 at 02:53:37PM +0200, Vlastimil Babka wrote: > The __test_page_isolated_in_pageblock() is used to verify whether all pages > in pageblock were either successfully isolated, or are hwpoisoned. Two of the > possible state of pages, that are tested, are however bogus and misleading. > > Both tests rely on get_freepage_migratetype(page), which however has no > guarantees about pages on freelists. Specifically, it doesn't guarantee that > the migratetype returned by the function actually matches the migratetype of > the freelist that the page is on. Such guarantee is not its purpose and would > have negative impact on allocator performance. > > The first test checks whether the freepage_migratetype equals MIGRATE_ISOLATE, > supposedly to catch races between page isolation and allocator activity. These > races should be fixed nowadays with 51bb1a4093 ("mm/page_alloc: add freepage > on isolate pageblock to correct buddy list") and related patches. As explained > above, the check wouldn't be able to catch them reliably anyway. For the same > reason false positives can happen, although they are harmless, as the > move_freepages() call would just move the page to the same freelist it's > already on. So removing the test is not a bug fix, just cleanup. After this > patch, we assume that all PageBuddy pages are on the correct freelist and that > the races were really fixed. A truly reliable verification in the form of e.g. > VM_BUG_ON() would be complicated and is arguably not needed. > > The second test (page_count(page) == 0 && get_freepage_migratetype(page) > == MIGRATE_ISOLATE) is probably supposed (the code comes from a big memory > isolation patch from 2007) to catch pages on MIGRATE_ISOLATE pcplists. > However, pcplists don't contain MIGRATE_ISOLATE freepages nowadays, those are > freed directly to free lists, so the check is obsolete. Remove it as well. > > Signed-off-by: Vlastimil Babka > Cc: Joonsoo Kim > Cc: Minchan Kim > Cc: Michal Nazarewicz > Cc: Laura Abbott > Cc: Naoya Horiguchi Looks good to me. Reviewed-by: Naoya Horiguchi -- 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/