From patchwork Fri Aug 24 06:33:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 10574833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B14F51579 for ; Fri, 24 Aug 2018 06:33:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EEED2C26C for ; Fri, 24 Aug 2018 06:33:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92F3E2C5EC; Fri, 24 Aug 2018 06:33:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 986372C26C for ; Fri, 24 Aug 2018 06:33:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A4FB6B2875; Fri, 24 Aug 2018 02:33:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 856246B2887; Fri, 24 Aug 2018 02:33:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 745426B2C76; Fri, 24 Aug 2018 02:33:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f71.google.com (mail-oi0-f71.google.com [209.85.218.71]) by kanga.kvack.org (Postfix) with ESMTP id 4740B6B2875 for ; Fri, 24 Aug 2018 02:33:36 -0400 (EDT) Received: by mail-oi0-f71.google.com with SMTP id y135-v6so1166595oie.11 for ; Thu, 23 Aug 2018 23:33:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=Ga5pCY3bpXN0q39vdLob60f45aQP2LFqqQoe7caW7j4=; b=At5DjFdQrQGy4hVSAlVO2WYfyhfKeQbtLs67ZtJqh/qr6IBqc7FYHwcp5md4WgYW8y 9zObmM91dlkIUFzOcyIa+hFCglO9EcEq476C+eMT0nm16vBEaMxJEEiA1ZmnQkdFtLLG OnQLl352VSvweQcDqzP0ysTsqIDp+/PnrMe2dMZfLb+lQOExqI+IId3gqcpZ4O+DtAFt S4XeJOLSx3go7l6gfYwaVGNbC61CVomeufYsMsPfHNNGO8MlPvjpHhqpO3Xdjj3i/sxP RPEsI//Gqi1K6duUaEFgAkltN04B8QnokQlEHk2eskIXagmlQQ3vW1/mvpYo8YskVf7h sU0A== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: APzg51BohCtCH6b/ZyAA8EMpwc9O6QPMbbSlSPikum23l+m19DsKap9Z 8MyBYBDKcH6/G3PzMgVNfbNIQ1bUWsfXfF28R+nSaOyGC83mcCvmOn+Nmcy7i2pZROtCrBHbgoQ YB59MCSTUidAbSIsZPKqYGFoni/+v/t18E3tMy6uWNHUsO9ZrnAYLcAETSKoyknI8RA== X-Received: by 2002:aca:d452:: with SMTP id l79-v6mr283370oig.222.1535092415910; Thu, 23 Aug 2018 23:33:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaE7VnTZpS/nBd1kkCIjLg1ZdbnP77Hd0WSNsUhEfrYHeX5fazn46cMdtIm/n7RdYJHvalz X-Received: by 2002:aca:d452:: with SMTP id l79-v6mr283331oig.222.1535092415058; Thu, 23 Aug 2018 23:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535092415; cv=none; d=google.com; s=arc-20160816; b=Wo6lqFiDwXItnVzfurdoFCdUi3yIrcPHevG3Q82k8wnXLtTaeySPOU3UC5Vf5VR/FY W3atK+BHCBMfEiyvc+/gshbkQjtC+Pb14sigXsWPwc3/IysMGZqg3N3d3tYPKoBOeaTs ZP8JTuQQ6g07s7tsHynkezbfPM5hc7VIwOCNqL5mh+WJVq6Db808oXEXMYgOuHvYIB+J 1nqN0nIQRZtJbsIu/67kPt+lQmFih2e9l2xM+GDH5a1fjIzqAJFR76pNBWRK3z8OplJb CcT2TL+5Xn/UnjuNaWHFm3OBrIRXGIqf4dixD5U2QoCppQMjyxXmmebRtdoOu4lVn+9I 2/CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=Ga5pCY3bpXN0q39vdLob60f45aQP2LFqqQoe7caW7j4=; b=j/LzGXdopanxi2ciAJvggcKKCJb2jo7wdfJ5DT6vwT+KKUIG33987yyg6g00QKwHM0 HoJwJSxNFUKUixOt1gZURP0TO3ZH7ZluTMe4hcA7/601xCkwkqEV+XlXu3Gp1dxQKI88 w3wKdHx7W9V8JnEWn9WJ0yxtkSiJxCEMHT0zN0fC2rPYZS+aj0Yfrrv3QDGY4A6DIWxZ /SLgvUnwEouM5boZrudsALmuevR66b4CH9ejRrZYlwm7BZX5Bo9KKxvGYtujmbm8afiL HGEPqWESUg9hPilXsIO9VFHAr9FRUDQH0wP1LaSy9Vs/RfiqVaUcU195HJFs+u1K3t+1 iCaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id t196-v6si4616706oif.57.2018.08.23.23.33.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 23:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7O6TXmQ079822 for ; Fri, 24 Aug 2018 02:33:34 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2m2bb833se-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 24 Aug 2018 02:33:33 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Aug 2018 00:33:33 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 24 Aug 2018 00:33:29 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7O6XSh449152164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Aug 2018 23:33:28 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11A3E6E050; Fri, 24 Aug 2018 00:33:29 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 75BF36E04C; Fri, 24 Aug 2018 00:33:26 -0600 (MDT) Received: from skywalker.ibmuc.com (unknown [9.85.81.195]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 24 Aug 2018 00:33:26 -0600 (MDT) From: "Aneesh Kumar K.V" To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, mhocko@kernel.org, mike.kravetz@oracle.com, "Aneesh Kumar K.V" , Naoya Horiguchi Subject: [PATCH] mm/hugetlb: filter out hugetlb pages if HUGEPAGE migration is not supported. Date: Fri, 24 Aug 2018 12:03:14 +0530 X-Mailer: git-send-email 2.17.1 X-TM-AS-GCONF: 00 x-cbid: 18082406-8235-0000-0000-00000DF063C3 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009601; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01078035; UDB=6.00555865; IPR=6.00858010; MB=3.00022900; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-24 06:33:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18082406-8236-0000-0000-00004263106E Message-Id: <20180824063314.21981-1-aneesh.kumar@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-24_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808240070 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 we just check for Kernel config. The gigantic page size check is done in page_huge_active. Acked-by: Michal Hocko Reported-by: Haren Myneni CC: Naoya Horiguchi Signed-off-by: Aneesh Kumar K.V Reviewed-by: Naoya Horiguchi --- mm/memory_hotplug.c | 3 ++- mm/page_alloc.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 9eea6e809a4e..38d94b703e9d 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1333,7 +1333,8 @@ static unsigned long scan_movable_pages(unsigned long start, unsigned long end) if (__PageMovable(page)) return pfn; if (PageHuge(page)) { - if (page_huge_active(page)) + if (hugepage_migration_supported(page_hstate(page)) && + page_huge_active(page)) return pfn; else pfn = round_up(pfn + 1, diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c677c1506d73..b8d91f59b836 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7709,6 +7709,10 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, * handle each tail page individually in migration. */ if (PageHuge(page)) { + + if (!hugepage_migration_supported(page_hstate(page))) + goto unmovable; + iter = round_up(iter + 1, 1<