From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6297FC43387 for ; Thu, 20 Dec 2018 13:41:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3651C2084A for ; Thu, 20 Dec 2018 13:41:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733201AbeLTNlf (ORCPT ); Thu, 20 Dec 2018 08:41:35 -0500 Received: from nat.nue.novell.com ([195.135.221.2]:25867 "EHLO suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729096AbeLTNle (ORCPT ); Thu, 20 Dec 2018 08:41:34 -0500 Received: by suse.de (Postfix, from userid 1000) id D995E3CA7; Thu, 20 Dec 2018 14:41:32 +0100 (CET) Date: Thu, 20 Dec 2018 14:41:32 +0100 From: Oscar Salvador To: Michal Hocko Cc: Wei Yang , akpm@linux-foundation.org, vbabka@suse.cz, pavel.tatashin@microsoft.com, rppt@linux.vnet.ibm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm, page_alloc: Fix has_unmovable_pages for HugePages Message-ID: <20181220134132.6ynretwlndmyupml@d104.suse.de> References: <20181217225113.17864-1-osalvador@suse.de> <20181219142528.yx6ravdyzcqp5wtd@master> <20181219233914.2fxe26pih26ifvmt@d104.suse.de> <20181220091228.GB14234@dhcp22.suse.cz> <20181220124925.itwuuacgztpgsk7s@d104.suse.de> <20181220130606.GG9104@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181220130606.GG9104@dhcp22.suse.cz> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 02:06:06PM +0100, Michal Hocko wrote: > On Thu 20-12-18 13:49:28, Oscar Salvador wrote: > > On Thu, Dec 20, 2018 at 10:12:28AM +0100, Michal Hocko wrote: > > > > <-- > > > > skip_pages = (1 << compound_order(head)) - (page - head); > > > > iter = skip_pages - 1; > > > > -- > > > > > > > > which looks more simple IMHO. > > > > > > Agreed! > > > > Andrew, can you please apply the next diff chunk on top of the patch: > > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 4812287e56a0..978576d93783 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -8094,7 +8094,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, > > goto unmovable; > > > > skip_pages = (1 << compound_order(head)) - (page - head); > > - iter = round_up(iter + 1, skip_pages) - 1; > > + iter = skip_pages - 1; > > You did want iter += skip_pages - 1 here right? Bleh, yeah. I am taking vacation today so my brain has left me hours ago, sorry. Should be: diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4812287e56a0..0634fbdef078 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8094,7 +8094,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, goto unmovable; skip_pages = (1 << compound_order(head)) - (page - head); - iter = round_up(iter + 1, skip_pages) - 1; + iter += skip_pages - 1; continue; } -- Oscar Salvador SUSE L3