Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1228914imu; Thu, 20 Dec 2018 12:26:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/VR0Wyxjp33nQEqihJNgIeXfbZ1zHy9nRxHS0FsCcjoCLTPN8vY++2L9pwJJnxSL1GV1IkP X-Received: by 2002:a62:44d8:: with SMTP id m85mr26029079pfi.164.1545337572472; Thu, 20 Dec 2018 12:26:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545337572; cv=none; d=google.com; s=arc-20160816; b=HaB1AUfj2IAO1akV7AvC62NK9KZ+D2VULDORh7NS2Iz7BF29tlUJfwfEnVhAmfLTGV kzwfmqHYVOpZJBlM1qsYj2PNKRaGZH4Nq388Nisx52PNFtxVx5/w3WImvDckB1V+Be3b kvkIREumudmcnupmy6DQrcN14epESeHMdZOHzGGslBNNhwONFWEFsrf+ntESN2hww6Sq R7VSry+caGfxnMyKULWozwZy6aolFg6GlpYdNioL58GO607Jh0QzeC0tEpW9W39/AELS OAadbNNeHbcfOZbCcNTUaC9ATDJOfte9A9uk7LfMeM4EYP/B4b8ufWxCDQ2ZJS3XHwVc ptwg== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=QE1hGNye3NyJwWEBXrscsu1nNVxI1i6vduJfzWWgiO0=; b=MRnkLx9OV7AQQ1XfdSLsFK8rLb9TAcrw7CtJ6LqwGN6UrevyquUfAz1McHsKq/l9lB 6ehpEAikN22upa+06r6Ix5H8pvrJsTqA2RUliQ8pU/QMEQcA2a8Ndwf+8U+Oyn9Hx7iB W9Xe7MobB1SZNnycamVoK81tfFL+NGKpApVfk1191vMD8InhOxiouYKvpLojJqerFXPV Z0Dfqcths2y/9LP4nS/4rTe1OjSaqIn03vPH0JvaGfokUpsNQGZKo9gcfJP8Fe2yagNX Rj+lPOvnC8ssgZtpO/XGwWXQKpZ8/Pk7PFdDqzsoiffTym+DcpCPen4SI+BbJNKMBI5E vJ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VgC+ots+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i17si15964827pgk.233.2018.12.20.12.25.51; Thu, 20 Dec 2018 12:26:12 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VgC+ots+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732290AbeLTNJC (ORCPT + 99 others); Thu, 20 Dec 2018 08:09:02 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:40076 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730526AbeLTNJC (ORCPT ); Thu, 20 Dec 2018 08:09:02 -0500 Received: by mail-ed1-f68.google.com with SMTP id g22so1680904edr.7 for ; Thu, 20 Dec 2018 05:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QE1hGNye3NyJwWEBXrscsu1nNVxI1i6vduJfzWWgiO0=; b=VgC+ots+pyiAM8qTnx3LQaKyojQIH6txasK4VpFNlSsf3KEB83qpwitvg+5BimYRlR WWFPYWIq6a6BdwU5kBRSrGlbUtF9LyZ7FclCBjESSVWyS3s0+th7jB7ot4725JoBs9RU kYv7NRJdRbUTkPFeOjCJ6YVKGBlPd+WEHLgbE9GSQ890jyPbrTmgdIhAaFqBkD6pvh/6 xp0+aat88GHtw+PuACnOH9TkX+oaZY5nxvWKG0e0oZPliEGyq9y4YB0DbH2tnKwUQ1Z3 aPHZlNbb6c7tEkJArWeGYaOtiW4iYAghMBqN0nqFiiN30SjrGpdeG1cJWciTn+/USPhZ VSpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=QE1hGNye3NyJwWEBXrscsu1nNVxI1i6vduJfzWWgiO0=; b=fzfapo5TUHNuQY+krjZv+b2LKIqXE8Lm6oe9yTUlzpeQe0KbotoobbVTx6iRmoCilK AB48gEtKhQTlSBDxuosZooKaIfI68cHGMOUR3hjpALUFSyCl7hCwneKyHf1oZ9bStzhx 2HAFqeQIjOHI4oCyJXMxdt5SWaaTNLeS282oekr0G7KzTx3hNaBShA3chPvgn4RukckF +d//8OIX5rlHTct0M91cy/os57fYrmU3RM21H6BIQP/RPBsDIzaHYEZ6MJLO7C4twhu0 wusIaVaLuhCj8lktcwc67/kx4nLTzNJWYp/FwUM7X/H8qkEmCR+lFRwbPAXtgXfdeMxW 2nVQ== X-Gm-Message-State: AA+aEWZf4pe+sxmGXY5im/5hblO9il+Q19lHCMaeo0LXFkBeq635vJr/ hpk5IX5VYehkUfTGjcE7300= X-Received: by 2002:a17:906:d191:: with SMTP id c17-v6mr19426835ejz.27.1545311339186; Thu, 20 Dec 2018 05:08:59 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id t9sm6039963edd.25.2018.12.20.05.08.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 05:08:58 -0800 (PST) Date: Thu, 20 Dec 2018 13:08:57 +0000 From: Wei Yang To: Oscar Salvador Cc: Michal Hocko , 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: <20181220130857.yrzv5wzmiw7jbycb@master> Reply-To: Wei Yang 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: NeoMutt/20170113 (1.7.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 01:49:28PM +0100, 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; This complicated the calculation. The original code is correct. iter = round_up(iter + 1, 1< continue; > } > >Thanks! >-- >Oscar Salvador >SUSE L3 -- Wei Yang Help you, Help me