Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp55787pxv; Wed, 14 Jul 2021 22:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM50FHmv+AWzWypB/HUdk6ghueWk14sSUJsas3lOQTVc36ezXqJAPB0pKjZAMtpHokrjDw X-Received: by 2002:a05:6e02:106d:: with SMTP id q13mr1411737ilj.164.1626327920723; Wed, 14 Jul 2021 22:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626327920; cv=none; d=google.com; s=arc-20160816; b=iXezvz4kcCPDuhqx1SA59OQBiUDpaJ+SJObO2P+OwY2xLLccFqdobTvcJuioC4Axn6 aEXI2TRRlayMwQrDsW6FZk4d79gFUXKDg+dBLs/BOP/QnqKW2G5U/w6y4Jm1J+xtAP+u gpwoJY+t+k8lMFbqyg/PcnGLCcooYJ874ShM1p5KY4w2R/bE/Kew+Eo9VGsNhz2aCDjA CKfla5r3k+5vrlEvaXvyJ9un6nQK9+eVB0TWJiVDDD4t5Vud0YMTZjZxR26+pxYD04Cr KKbFK3W1eEW+w0AEaMg9lDReCGWel4SSn4l6rsExtORReMHY1ouU6GXK+ih/ivmahN1k xtFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5ILLJtmg4y7//Nl5cqO6Dt5oKOASFCS0mS2xCX9QyaA=; b=FCRLyvdJoxeOiGJWzQP5O4hNQeGuGszv5UIlFTNaS3GhacBl9A5s2Kam3WrzdQVaqe ZDTwPP0n1ZZui0stB3gEibTJzUM7fXLEdK7bJ4ulBYE/rdbDMVafXu+OIpnB7EmR2Jju mQkCGw15zPna+IyWThV08QKxshCSoH6n/pIGGudf9H0ThFJkK6F9DeP49F16Ddg4DOkq GfvzZahFedM43ofrebsHJopdTNIG7oqE32XK4DFbsRTcfZ6B/mTO1rcymA0HbbsJ0HWp QG4Fc7vtrjBwMPpTPqnwtxIZ7xpaonl5IgPptXdaJgeGvIIiJXxpdl0+EVymkeBX6cYc ESMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rssLRkif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 17si1442755iln.161.2021.07.14.22.45.08; Wed, 14 Jul 2021 22:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rssLRkif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239737AbhGOFa5 (ORCPT + 99 others); Thu, 15 Jul 2021 01:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238186AbhGOFa4 (ORCPT ); Thu, 15 Jul 2021 01:30:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97BF3C06175F; Wed, 14 Jul 2021 22:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=5ILLJtmg4y7//Nl5cqO6Dt5oKOASFCS0mS2xCX9QyaA=; b=rssLRkif3t/tSVMHXk5c7aqrPF tmQzfdg5A7AVrJdCKgh6hqc3VrLK5+CXT/LRghngVX1rUsJvmB3sCMEXBrczqRSQ3UVQ/oboWCUlW O+v3hWasBVRHwszi7py/QLZ2F642acp6xDEL/WOiZvf/MrYaB26iPSdfSx1jkbGmez1q/v+reqoW1 +n00MTXt0Wfeodco8WSHQ+ijBd94fFdDGSX7O/gxAcauUcyJS6SZrILn+4i1HsDQAzJsQKkz6JhXe LmvIMAK8Mmb5sluf4xgp/VdtsNZ0/v4pGyYqPw9Vp0k8XmfB7srRXdrDdf2exrmol83pWZ2j87k/y YQ0Il39g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3ttl-0031BC-3m; Thu, 15 Jul 2021 05:27:10 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v14 136/138] mm/vmscan: Optimise shrink_page_list for smaller THPs Date: Thu, 15 Jul 2021 04:37:02 +0100 Message-Id: <20210715033704.692967-137-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715033704.692967-1-willy@infradead.org> References: <20210715033704.692967-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A THP which is smaller than a PMD does not need to do the extra work in try_to_unmap() of trying to split a PMD entry. Signed-off-by: Matthew Wilcox (Oracle) --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 8b17e46dbf32..433956675107 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1496,7 +1496,8 @@ static unsigned int shrink_page_list(struct list_head *page_list, enum ttu_flags flags = TTU_BATCH_FLUSH; bool was_swapbacked = PageSwapBacked(page); - if (unlikely(PageTransHuge(page))) + if (PageTransHuge(page) && + thp_order(page) >= HPAGE_PMD_ORDER) flags |= TTU_SPLIT_HUGE_PMD; try_to_unmap(page, flags); -- 2.30.2