Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752902AbbELHyy (ORCPT ); Tue, 12 May 2015 03:54:54 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49075 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbbELHyx (ORCPT ); Tue, 12 May 2015 03:54:53 -0400 Message-ID: <5551B1CB.7070301@suse.cz> Date: Tue, 12 May 2015 09:54:51 +0200 From: Vlastimil Babka User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Joonsoo Kim , Andrew Morton CC: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mel Gorman , Johannes Weiner , Rik van Riel Subject: Re: [PATCH 1/3] mm/page_alloc: don't break highest order freepage if steal References: <1430119421-13536-1-git-send-email-iamjoonsoo.kim@lge.com> <5551B11C.4080000@suse.cz> In-Reply-To: <5551B11C.4080000@suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1608 Lines: 56 On 05/12/2015 09:51 AM, Vlastimil Babka wrote: >> { >> struct page *page; >> + bool steal_fallback; >> >> -retry_reserve: >> +retry: >> page = __rmqueue_smallest(zone, order, migratetype); >> >> if (unlikely(!page) && migratetype != MIGRATE_RESERVE) { >> if (migratetype == MIGRATE_MOVABLE) >> page = __rmqueue_cma_fallback(zone, order); >> >> - if (!page) >> - page = __rmqueue_fallback(zone, order, migratetype); >> + if (page) >> + goto out; >> + >> + steal_fallback = __rmqueue_fallback(zone, order, migratetype); Oh and the variable can be probably replaced by calling __rmqueue_fallback directly in the if() below. >> >> /* >> * Use MIGRATE_RESERVE rather than fail an allocation. goto >> * is used because __rmqueue_smallest is an inline function >> * and we want just one call site >> */ >> - if (!page) { >> + if (!steal_fallback) >> migratetype = MIGRATE_RESERVE; >> - goto retry_reserve; >> - } >> + >> + goto retry; >> } >> >> +out: >> trace_mm_page_alloc_zone_locked(page, order, migratetype); >> return page; >> } >> > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org > -- 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/