Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp757794imm; Wed, 22 Aug 2018 12:03:32 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyeJGMvkDmFVWs8z0PJGo2XSjgvWHka0uDdAmGjWXxZV+1YTOlR4JyALxFIzZI8/2ac7hyD X-Received: by 2002:a17:902:9a47:: with SMTP id x7-v6mr42698047plv.37.1534964612102; Wed, 22 Aug 2018 12:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534964612; cv=none; d=google.com; s=arc-20160816; b=rDsOBzW0kR+1p1/tELhoB8LKZapkCqTdluntYRRPTTGl0LP/rgfGeRmitZ0vXhE9VM MI9D3QFJZ73+wL7NtIQG/pqxvld4hXX5F8Va6Pr+4/Skih034z70XTVypWOtpTrUCgWm 9UqJRSn9iDTXuibJJssyg6nEzduFRii4orTkWfis5VOiu1YgbyYgCUbkaVr/vi8qEXHa etfkRImh5vPv3lE/n9eTeWIIvF2eeswLsnbpcgakVdYlD1P9r98EFtyKXGkfnnj8o2GV D+Gj0ewt9/yFSNI3t+CI6Hz6cNa+U0Hciamrl28VBpb4UiPlXVlYOsB/lC49MLahvXpH xBKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=1miKbo76WUBcWCSr9eE93KHKdKk4y34U/L7/M6u1eGU=; b=LhXHM+vb7lIMIfviZold5yr0QG/9LQsAO90h9PW7TDyyDxOfyf4gzEVyg/mX/Zh+ck Sjeg9FWEUt6Knsb3HRC14yLhPPsV9NFCN11SzRJ31YLfRwZVDliW0om9Qrl3vN7/ceRo pq+YrKrO5TzJZ2LBm+0CljCMw8liGAtMqRs+6nZ3+TNc/Eu6rIPQSy97gBfzPWF0YfJr 1clsHHGiaHHRrLGmxn+UrjVLhB9S2waLei1bHKrDq8Omxk6BjKuQLikLx6YPYuAcPrB6 e1jyUoaL9+uy6EWA0UFc2Ndv02se0MFq5L1PS7ygutHj51tMkqp7Mc3VFlG9Ldef10Bh 6fWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=Xgzo0ipo; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e94-v6si2264914plb.435.2018.08.22.12.03.15; Wed, 22 Aug 2018 12:03:32 -0700 (PDT) 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=@oracle.com header.s=corp-2018-07-02 header.b=Xgzo0ipo; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728062AbeHVW1X (ORCPT + 99 others); Wed, 22 Aug 2018 18:27:23 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:35538 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727844AbeHVW1X (ORCPT ); Wed, 22 Aug 2018 18:27:23 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7MIrUdd112181; Wed, 22 Aug 2018 18:58:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=1miKbo76WUBcWCSr9eE93KHKdKk4y34U/L7/M6u1eGU=; b=Xgzo0ipo5WvXMVbdFdtT0Cm9gzSxoPxlC0PHUCERhQNzIBs2zoGMxPjhDgUzQZP2PpfR JX47Ufi9BHyg8t+WhwjWm1w9rKQSF2ES4nQtQYBxGCVGG8AKWia3oXaqB8/1w0hXV6cj PRPvYdBNne7soqlAAq7aU4pM88ugUrMmnSYm09eI0PAP1EWknIc7eIXY0vzbjcURSzAc hrQCnnegGZIQVD8kXTCFWZMnLBcTv8I1NndV3UpEYMk1hbAZyU5gYkOkc4AxZzi+XLVC ajOsEwXQZ+lVy5YFIhk9biF4C6W4qYFf4PHGl+/Z6I8YqnkABO0lMIZM7R9s4rGgqtv5 eA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2kxavtv2f0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Aug 2018 18:58:07 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7MIw6lO017858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Aug 2018 18:58:06 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7MIw4oQ026234; Wed, 22 Aug 2018 18:58:04 GMT Received: from [192.168.1.164] (/50.38.38.67) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 22 Aug 2018 11:58:04 -0700 Subject: Re: Infinite looping observed in __offline_pages To: "Aneesh Kumar K.V" , Michal Hocko , Haren Myneni Cc: n-horiguchi@ah.jp.nec.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com, mgorman@suse.de References: <20180725181115.hmlyd3tmnu3mn3sf@p50.austin.ibm.com> <20180725200336.GP28386@dhcp22.suse.cz> <87bm9ug34l.fsf@linux.ibm.com> From: Mike Kravetz Message-ID: <54c72a22-a921-fc64-460d-f66985d0df4e@oracle.com> Date: Wed, 22 Aug 2018 11:58:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <87bm9ug34l.fsf@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8993 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808220186 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/22/2018 02:30 AM, Aneesh Kumar K.V wrote: > commit 2e9d754ac211f2af3731f15df3cd8cd070b4cc54 > Author: Aneesh Kumar K.V > Date: Tue Aug 21 14:17:55 2018 +0530 > > mm/hugetlb: filter out hugetlb pages if HUGEPAGE migration is not supported. > > When scanning for movable pages, filter out Hugetlb pages if hugepage migration > is not supported. Without this we hit infinte loop in __offline pages where we > do > pfn = scan_movable_pages(start_pfn, end_pfn); > if (pfn) { /* We have movable pages */ > ret = do_migrate_range(pfn, end_pfn); > goto repeat; > } > > We do support hugetlb migration ony if the hugetlb pages are at pmd level. Here I thought migration at pgd level was added for POWER? commit 94310cbcaa3c (mm/madvise: enable (soft|hard) offline of HugeTLB pages at PGD level). Only remember, because I did not fully understand the use case. :) > we just check for Kernel config. The gigantic page size check is done in > page_huge_active. > > Reported-by: Haren Myneni > CC: Naoya Horiguchi > Signed-off-by: Aneesh Kumar K.V > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index 4eb6e824a80c..f9bdea685cf4 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1338,7 +1338,8 @@ static unsigned long scan_movable_pages(unsigned long start, unsigned long end) > return pfn; > if (__PageMovable(page)) > return pfn; > - if (PageHuge(page)) { > + if (IS_ENABLED(CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION) && > + PageHuge(page)) { How about using hugepage_migration_supported instead? It would automatically catch those non-migratable huge page sizes. Something like: if (PageHuge(page) && hugepage_migration_supported(page_hstate(page))) { -- Mike Kravetz > if (page_huge_active(page)) > return pfn; > else > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 15ea511fb41c..a3f81e18c882 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7649,6 +7649,10 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, > * handle each tail page individually in migration. > */ > if (PageHuge(page)) { > + > + if (!IS_ENABLED(CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION)) > + goto unmovable; > + > iter = round_up(iter + 1, 1< continue; > } >