From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933768AbdCHHI0 (ORCPT ); Wed, 8 Mar 2017 02:08:26 -0500 Received: from mx2.suse.de ([195.135.220.15]:60220 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756804AbdCHHIZ (ORCPT ); Wed, 8 Mar 2017 02:08:25 -0500 Subject: Re: [RFC v2 10/10] mm, page_alloc: introduce MIGRATE_MIXED migratetype To: Yisheng Xie , linux-mm@kvack.org, Johannes Weiner References: <20170210172343.30283-1-vbabka@suse.cz> <20170210172343.30283-11-vbabka@suse.cz> <2743b3d4-743a-33db-fdbd-fa95edd35611@huawei.com> Cc: Joonsoo Kim , David Rientjes , Mel Gorman , linux-kernel@vger.kernel.org, kernel-team@fb.com, Hanjun Guo From: Vlastimil Babka Message-ID: <0a7c2eb0-e01b-10b0-7419-e6e5b1fa0e0b@suse.cz> Date: Wed, 8 Mar 2017 08:07:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <2743b3d4-743a-33db-fdbd-fa95edd35611@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/08/2017 03:16 AM, Yisheng Xie wrote: > Hi Vlastimil , > > On 2017/2/11 1:23, Vlastimil Babka wrote: >> @@ -1977,7 +1978,7 @@ static void steal_suitable_fallback(struct zone *zone, struct page *page, >> unsigned int current_order = page_order(page); >> struct free_area *area; >> int free_pages, good_pages; >> - int old_block_type; >> + int old_block_type, new_block_type; >> >> /* Take ownership for orders >= pageblock_order */ >> if (current_order >= pageblock_order) { >> @@ -1991,11 +1992,27 @@ static void steal_suitable_fallback(struct zone *zone, struct page *page, >> if (!whole_block) { >> area = &zone->free_area[current_order]; >> list_move(&page->lru, &area->free_list[start_type]); >> - return; >> + free_pages = 1 << current_order; >> + /* TODO: We didn't scan the block, so be pessimistic */ >> + good_pages = 0; >> + } else { >> + free_pages = move_freepages_block(zone, page, start_type, >> + &good_pages); >> + /* >> + * good_pages is now the number of movable pages, but if we >> + * want UNMOVABLE or RECLAIMABLE, we consider all non-movable >> + * as good (but we can't fully distinguish them) >> + */ >> + if (start_type != MIGRATE_MOVABLE) >> + good_pages = pageblock_nr_pages - free_pages - >> + good_pages; >> } >> >> free_pages = move_freepages_block(zone, page, start_type, >> &good_pages); > It seems this move_freepages_block() should be removed, if we can steal whole block > then just do it. If not we can check whether we can set it as mixed mt, right? > Please let me know if I miss something.. Right. My results suggested this patch was buggy, so this might be the bug (or one of the bugs), thanks for pointing it out. I've reposted v3 without the RFC patches 9 and 10 and will return to them later.