From patchwork Sun Jan 16 12:18:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12714545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9089AC4332F for ; Sun, 16 Jan 2022 12:18:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B02E26B0075; Sun, 16 Jan 2022 07:18:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 88CC96B0071; Sun, 16 Jan 2022 07:18:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61C716B0075; Sun, 16 Jan 2022 07:18:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id 2AF346B0073 for ; Sun, 16 Jan 2022 07:18:29 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D7A0C182056EC for ; Sun, 16 Jan 2022 12:18:28 +0000 (UTC) X-FDA: 79036053096.31.1A6FFCA Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 294DD140002 for ; Sun, 16 Jan 2022 12:18:27 +0000 (UTC) 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=nR4q6LlG4aGXJETtHyIwh712yfW3kU3d8of6ibolorw=; b=skxRut/WqIDWQi1x1bJxL7nfWV 4K6mG+tEfRQsHFAfjGW3fuPyDROkCHtjOfjP4uuuWO4XM5+QfRhizrFk7InpT7Sq27J+/yyk/52JX rR4Mqoh+iZpSzGel6T8UsGvic5F3Sp++fCGdjNDNFzpRmFoMx1f2lj53jsemOtjwcd7uzu5Po7hzH XyvIQRYQ2Zwjv6nULypWTl1m76xP3NtfqvalshW/TgMo3/RNflTq9jpSSe4hbC6H/txt9eS7p1MIJ vBr+m2tJcEwrwAfp46jfM+1jhLjyTag5Qj3xFH5Et8Mt53MXAj1ZwMi11KEtbNtZOInD+UAfrWOF6 6kkhnMkg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n94UM-007FUL-Hj; Sun, 16 Jan 2022 12:18:26 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 06/12] mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios Date: Sun, 16 Jan 2022 12:18:16 +0000 Message-Id: <20220116121822.1727633-7-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220116121822.1727633-1-willy@infradead.org> References: <20220116121822.1727633-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 294DD140002 X-Stat-Signature: iy33bt7bypbqhqobfusohp4rwx8ipteo Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="skxRut/W"; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-HE-Tag: 1642335507-43033 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: A large folio 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 45665874082d..3181bf2f8a37 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1754,7 +1754,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);