Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp972013imu; Thu, 20 Dec 2018 08:08:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/X5ByYRdAcjIxi2vzAajUZzaQKqXnA/sF5BBWT/XzJb9aQEcYDRYExl7ebwTukpH71AKL5d X-Received: by 2002:a62:53c5:: with SMTP id h188mr24569873pfb.190.1545322121649; Thu, 20 Dec 2018 08:08:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545322121; cv=none; d=google.com; s=arc-20160816; b=LJkQjl9PSAlbzGOIp6m4IEHsP1qpq20Vf+kWpfPdmCk95pt1bSPReAaJAEkwwoxfD/ QtYLYljk1Vmxqdr/3+1J71A+QIa7cibc1w/RvzlTj3L/9+OZP3lS7I3h/BdJeC7BBFS5 d5f2SI4pu9QJ7y67mEn7U+UHzmljqlvvSfD2DvH+FkxuiDInQKdpvB3AXx99g1WLKFFB v0Uy+AL0/Ob2p0UO5s27Jqk015OASrXElE78EkUuXiikmt+8VR1QYyYCC61fiJeUrlQ9 dQGCB5wWoWloi2AiR0HIitZ+kw/k/evuP8Z0aQ0UTZ/DPgeSYv/wsER9HfhQe1rCUMzW PWUQ== 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=AU8hMZE0VsrHZpugADtBtbSZAm9x4okpJ0tQTX4PqsQ=; b=d40Cat5HNI7B3hfpq2lAjobZZvbHY3XAXFjB4IKAsKNgtt+evJ2ycG6nwTaVBVEle9 MSvhYFjEmitdFiqv9yBFnUDKgIKnudzJjt9s6TmXvqGmik8AFrLsnuJnQtxvU9KxP55V s3ucecqofus7rOuhka0XlGw3QrTmULNcrR4KDN3LAKu1X5K6JkINyFxUg8Bjgd+ZTZVl wRGePJbDfiT/ZRQ+MiKSCly6DQ7iYLpzPc2FFIQZBKPou/NMNxDsqrZ0Y10GhnfZwP0d pzrPqhcvZWxpwZhCCcRCOt1Qmzkc230jD2EBCDyCTwC9urgCDDbbzQ9erbejpHJPHS73 6VAw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si18859986plg.318.2018.12.20.08.08.25; Thu, 20 Dec 2018 08:08:41 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732743AbeLTNGJ (ORCPT + 99 others); Thu, 20 Dec 2018 08:06:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:34460 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728803AbeLTNGJ (ORCPT ); Thu, 20 Dec 2018 08:06:09 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8DFB7ADF3; Thu, 20 Dec 2018 13:06:07 +0000 (UTC) Date: Thu, 20 Dec 2018 14:06:06 +0100 From: Michal Hocko To: Oscar Salvador 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: <20181220130606.GG9104@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181220124925.itwuuacgztpgsk7s@d104.suse.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? -- Michal Hocko SUSE Labs