Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1011598imu; Thu, 20 Dec 2018 08:43:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/WH0TlgsUy+EPzv/cWI7+keNhJHDGHbDJyVjxLCgsFUeh6qJ4SeCR4yVXuVFDhZsTn5hLWC X-Received: by 2002:a62:870e:: with SMTP id i14mr25608050pfe.41.1545324203485; Thu, 20 Dec 2018 08:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545324203; cv=none; d=google.com; s=arc-20160816; b=V9rPuXvHO1cSJeAsES/LT+3blZUbFu3mHkqr7ZdcKayUxfE7TT0TSLPlg8QHLzajt/ orebjV1AhVw3nGdgWOCsO/iMj6R14ZcCMxUIciWgkTDPuRDZyOOS3fCBvLpBSIaZsE9m 6Hj+z5tKrZ/Bey4t8hVKwlQbyPNINm75slxIw01/con5EZy9twqH6p8is+46g9E2sIS9 ALHZSe2xaBNXV35QwNkkaWdKlHFy+X/w3zNVNaSzqnCeoGTOGbx4Ki5e5a1jC8dI7R0Y CsSsQf8LcfDABoJ6ftIVQ4Nc4xLmjs792vza4JDAgkm8LnoFhPYIRfetEVOtORKUuXlK 6ZdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=IX8ez7y6TR8MADtQ0EGhPnK3q1faD4NcCPIJc+kaW5A=; b=MebNVdWzWtDp3087dh6lH3IkwrUXiZbOmVrrR54He/jhafa8KBRjbrOINqwyOlivFI lpPi+RHZssxWF2Y4TC9e8UCW7BlJwFIVmNREJcCGNb7bFWPEW5zK+k3OXxt1vutaTL6H aAgHkSphnBD9vFNcuoIh/F9C30iEsA36aJqhy+1v4H4QMWO4MC5o2pxPVPBN8/iKzarQ MF0KPLvI9iEH5KXUkthFxyn27ZITXR2edz+/dYHSKYqkIdc1H/LbWdII0QK6W40djdI8 pHaOzoZpbSWXtpxdrovZfgtiSYg529zyyi2mYoKeucVfI0KrJ9eZF/yn3nuTwvPOe+Q0 9E2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc16si8170059plb.377.2018.12.20.08.43.08; Thu, 20 Dec 2018 08:43:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732015AbeLTPwx (ORCPT + 99 others); Thu, 20 Dec 2018 10:52:53 -0500 Received: from nat.nue.novell.com ([195.135.221.2]:56289 "EHLO suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728172AbeLTPwx (ORCPT ); Thu, 20 Dec 2018 10:52:53 -0500 Received: by suse.de (Postfix, from userid 1000) id 774FF3CB1; Thu, 20 Dec 2018 16:52:51 +0100 (CET) Date: Thu, 20 Dec 2018 16:52:51 +0100 From: Oscar Salvador To: Wei Yang Cc: Michal Hocko , 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: <20181220155247.qbyptzk35xr7ey72@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> <20181220134132.6ynretwlndmyupml@d104.suse.de> <20181220142124.r34fnuv6b33luj5a@d104.suse.de> <20181220153237.bhepsqw27mjmc4g5@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181220153237.bhepsqw27mjmc4g5@master> 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 03:32:37PM +0000, Wei Yang wrote: > Now let's go back to see how to calculate new_iter. From the chart > above, we can see this formula stands for all three cases: > > new_iter = round_up(iter + 1, page_size(HugePage)) > > So it looks the first version is correct. Let us assume: * iter = 0 (page first of the pageblock) * page is a tail * hugepage is 2mb So we have the following: iter = round_up(iter + 1, 1<