Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp963714imu; Thu, 20 Dec 2018 08:02:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/UnuXgpvyWfH172mc86OqC2Sfv/e0FrPcSCbPnZ98QQK3ICpPimYFUgp0ypAz4N/NBPlWH9 X-Received: by 2002:a62:3141:: with SMTP id x62mr24653365pfx.12.1545321769103; Thu, 20 Dec 2018 08:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545321769; cv=none; d=google.com; s=arc-20160816; b=cKNnxWbjCvJXwnGOmEUYK38JZ+f3AzQ9GK7UgqSsDifgXzeixmvaqjcs4eLwRke0ph H60pvxvjy3JAd9XMRkeVWw0PQZdcGAVzGUs2m9Fxt3KrxIeEaMyybAMc0eApji7QZigd vIbF4jGY/+J4RWqkj3T0oc7TOlpWAreoWSDJdJtjLzOOSx514uSCr+YwGhPhJmWhnbt8 2+p+hsDGtMfnlGt+QQRzIihKYLGgetgtWXuAYJh4e0we8MeenXnnFBeyq/jnnLOuPr3h iAumRtLVj8CCTUcLqIrgGjOZbBEzAeCoFTlAj9dfLIoJ5Wc60YvKrPf/JfwPh+81dZ3q xhsA== 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=ci7nXdNXxTUKZbJYYNYc0pAaAKQeodbH2D7t2OMZ+N0=; b=UYj1m6Q69DmtddJfSXnqZQPAuO+JvShyiCOHconFu3p/vLLp/yktpcychPxB8j1MNG OtX0unvdcuBPsZftFDCfwCo/fWOaXLSoagR9zcRKetP6nCi+LY107kFn1bOCikH4d3FT AlYR7e+vb6RXf1ST/MY9OYpBXl5Z2Ui0kEooxwmi94lpVD5i3h+BDJhIgMC1ZDsYHMHg cMC42ePv9YIdzR1A7D6kmMxCT04rf0AO3WwgJQSUuVG1PbEVLjoByy5Td+vToMmyfICe vwgQEKr7fcL6uU/NMtZpVnNZU+iZPDINtvxSdyTGKTbVV+INOFNcRZzUN7PKTRjiaIoD iWiQ== 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 w190si18807152pgd.338.2018.12.20.08.02.32; Thu, 20 Dec 2018 08:02:49 -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 S1732092AbeLTMtb (ORCPT + 99 others); Thu, 20 Dec 2018 07:49:31 -0500 Received: from nat.nue.novell.com ([195.135.221.2]:5172 "EHLO suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728966AbeLTMtb (ORCPT ); Thu, 20 Dec 2018 07:49:31 -0500 Received: by suse.de (Postfix, from userid 1000) id CDFC13CA4; Thu, 20 Dec 2018 13:49:28 +0100 (CET) Date: Thu, 20 Dec 2018 13:49:28 +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: <20181220124925.itwuuacgztpgsk7s@d104.suse.de> References: <20181217225113.17864-1-osalvador@suse.de> <20181219142528.yx6ravdyzcqp5wtd@master> <20181219233914.2fxe26pih26ifvmt@d104.suse.de> <20181220091228.GB14234@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181220091228.GB14234@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 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; continue; } Thanks! -- Oscar Salvador SUSE L3