From patchwork Mon Sep 24 14:14:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10612501 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 24A0814DA for ; Mon, 24 Sep 2018 14:15:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B226299A7 for ; Mon, 24 Sep 2018 14:15:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D45929B62; Mon, 24 Sep 2018 14:15:06 +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 A20CE299A7 for ; Mon, 24 Sep 2018 14:15:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 654168E001E; Mon, 24 Sep 2018 10:15:04 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 603838E0001; Mon, 24 Sep 2018 10:15:04 -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 4F4A88E001E; Mon, 24 Sep 2018 10:15:04 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by kanga.kvack.org (Postfix) with ESMTP id 2AF248E0001 for ; Mon, 24 Sep 2018 10:15:04 -0400 (EDT) Received: by mail-oi0-f70.google.com with SMTP id p14-v6so19647305oip.0 for ; Mon, 24 Sep 2018 07:15:04 -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=45+6A/vybWfGFLy9jjXJ2lHn1uUw/PTlCeRFFb8+qVs=; b=I/48Z1CWVpdf4es6S2bZ0NxCy6owHgmhWgSTz9KI1Cntp3JvwxgXhHXdvip+HBL6di IGxTmbMwqQPsExLxkf+bIiIW73KY2TdClnA/bu82oejutHtllUZlEflq/lQq9lggDT+L WH10iQOebFggPEcRASWebR45Iq2PJi2Tw39vcbLVfM3w/Xu/DBtElVmz+yb+eN9jHqZu puzgC/EciRoIdzBAd8zTAcDJyPjyqHIcER+Ke4XsJKcvVZ1kXFBhnuFtqGsJP2PWBmnh lViX0tcZ8rR3DfwPvrGNxunqRGBGpBElEAGoJ17+QiLOsCyI7GNMHNpX6SLc90/qlJcq 63Fg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Gm-Message-State: ABuFfoi3RUF7EoB+KdBGtc2n7CP3ZX1j6/at20jjGxGtnRvqXwrSGTcB e2xTrO8ZLpnomrMorDHtL59OtqRiEnL+SKncgrpqdDP4eiNZicLZriJr8W1U6osPt3jeiff3MDI drK3RvxrZVGGiwU7Y+I2t9rppxBDoyMuMuYYFZi2H4QSmcKKcol2ko2CTSnzF0a2f9A== X-Received: by 2002:a9d:3788:: with SMTP id x8-v6mr7024169otb.171.1537798503887; Mon, 24 Sep 2018 07:15:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV61bfu9Hcl9NecBy4Ym7ZxFe8Kpf2ccpqZeg7VO+Ud8j/XDSj3GTHEYQLkL0ZcR0ZvWpSZFw X-Received: by 2002:a9d:3788:: with SMTP id x8-v6mr7024132otb.171.1537798503278; Mon, 24 Sep 2018 07:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537798503; cv=none; d=google.com; s=arc-20160816; b=Vi4eSP912HD2dU3uN4kjScn/byI1+ZaLXYo666Mx72FAMVBoPPiyzZzuZFqruQBW9r IyjH7XYkIRegkwOWwwwTfOr8ovRBse04JLkrWT7Uodn7XHGlKLzvhFsPZSkyoQIRg7V1 aKLaP97GxYC2/VWks3o78sMN1MOZWzS3ucfbSansUyI20QVo349OsEdTWN9zZ1Q5pJbf 3obcZKntDvblWEt6rkDH+GDvECJ9g80e9ggUXY6Z/qxyJUc2l+pIVPg842404FFt33pX oUFOOpxCNHAZnB1CKYFrYaVKO8ZkrWmrRGB2ztxYiSzWOPB7GpHu9MaszAxvHkb1TOet Xrrg== 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; bh=45+6A/vybWfGFLy9jjXJ2lHn1uUw/PTlCeRFFb8+qVs=; b=evEjQjbL7HaTvi1r+ffAnh5SnFS4CCa46Fc7uV8WOuIfwnDBUtLmJDnm8Lez4FU+8H 6Z/6KunN346FRh9ywylIC+U0Q6tZrrjH+PAT3pZPeSiQwmvqnkY1TBfTb610hfx87Fai 7hrxCdhkqNgYX8aZ6t6MZeWceaEqHIsPjy7Gr8RV5+4dhllA3j+2E26n5JfUrBg3d4mf SobcZAeT1n+VOEI1bcHjaUpcNtmUO/s4qSodICly5UVO93RBDjtkZKtF9EJ+ijC6Uu5c dImxXWc4z1wSBdMCiwY5hdBaTT2mMEtPw8kageBffKDVRTZLpwMNTFAzFoLx5OnTD1Ib PByg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id c69-v6si15900901oib.38.2018.09.24.07.15.02 for ; Mon, 24 Sep 2018 07:15:03 -0700 (PDT) Received-SPF: pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 75D0480D; Mon, 24 Sep 2018 07:15:02 -0700 (PDT) Received: from p8cg001049571a15.arm.com (unknown [10.163.1.125]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F266D3F5B7; Mon, 24 Sep 2018 07:15:00 -0700 (PDT) From: Anshuman Khandual To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: mhocko@kernel.org, akpm@linux-foundation.org Subject: [PATCH] mm/migrate: Split only transparent huge pages when allocation fails Date: Mon, 24 Sep 2018 19:44:55 +0530 Message-Id: <1537798495-4996-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 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 unmap_and_move[_huge_page] function fails due to lack of memory, the splitting should happen only for transparent huge pages not for HugeTLB pages. PageTransHuge() returns true for both THP and HugeTLB pages. Hence the conditonal check should test PagesHuge() flag to make sure that given pages is not a HugeTLB one. Fixes: 94723aafb9 ("mm: unclutter THP migration") Signed-off-by: Anshuman Khandual Acked-by: Michal Hocko --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index d6a2e89..d2297fe 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1411,7 +1411,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, * we encounter them after the rest of the list * is processed. */ - if (PageTransHuge(page)) { + if (PageTransHuge(page) && !PageHuge(page)) { lock_page(page); rc = split_huge_page_to_list(page, from); unlock_page(page);