Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp146167pxv; Thu, 15 Jul 2021 00:50:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMlqQ7P53FWOcYEwPcLA7qpFxjvpyvnQ0FCBd0Apr+2cAgMxX/FE5gxzEr8Pz4nlTdiGcZ X-Received: by 2002:a17:907:1c9f:: with SMTP id nb31mr4079769ejc.342.1626335445049; Thu, 15 Jul 2021 00:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626335445; cv=none; d=google.com; s=arc-20160816; b=x2TtzSyTFTfgm4wGrdyGOU9vlEPBZ15SbnoycRPgpMbUa+X6o+RQOvig1L7PtU9xCB 57WPO7t00GX+frT0Uk1/fXohPhfjMnWyIL3U0VIuwmXDSF2JDpPVZVSFkB+7qzglmrb5 Z/wsM0oqeSuEObifrRJ2YWWI2LFV3p8WGDp6kZsOMugwISFcWCmnPS7k6lmomdHWSjBb 4TkDfRylFhuR5pyxeZknQqduzeXYd/iW8ekq+YapYOdLrj1w5olihjSQk/o6qU3UXD5F t1yl7U9AL3JJNxteibHeZB0bWHRA9ojiikA7zXg7n+20PZZLeDqYZVRldKTlhH0xCGJO ckmQ== 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=FvnKvrUT2fNk7/OyTjb1Ax4qDl3oGlD3/8sIT3O/4a8=; b=fIs2sPvg0isP2L55+8LoWH41OMQjk1j5miM8GO9UbZJxNUCmPysZFwQlaFcmdzp8Xb CiSZMwHPeZ5qUzCWr60OVucdWbcMU41orxBikLhThfOmmsiMhWyZ1DAtQpoR5DxXSOTE vrDrjOZ4Po75WBRYVkOqn5Cs0O/AzidcgxDDv5buStWAS3GNpTuKJfwtue/ATPGTZKBo nZBs9FnVb8Yfn7HOeUWeWURe92Iegniw6FZZwlNJO00O8fzSVyx0tsDUZwUW7mIb5aR5 xJ9ZM/mgUSI2ez4oIXIBqFjTg6iII/pxHcmMvQTAKFDlt48hTMj1edYNXNmXDX4Tl5Kr 82xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=izkbNEHl; 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 lf5si6396701ejc.236.2021.07.15.00.50.19; Thu, 15 Jul 2021 00:50:45 -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=izkbNEHl; 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 S239124AbhGOF1d (ORCPT + 99 others); Thu, 15 Jul 2021 01:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235312AbhGOF1d (ORCPT ); Thu, 15 Jul 2021 01:27:33 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E719C06175F; Wed, 14 Jul 2021 22:24:40 -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=FvnKvrUT2fNk7/OyTjb1Ax4qDl3oGlD3/8sIT3O/4a8=; b=izkbNEHl+SIVNYKgt/mAEKaORv dk2/V/5ap64GEm2xYJiEfKnOPQsspNnlH7PnSkAmoTclYx7DfWr+QTftRAD57aysxz3g4CIXPNwMD FlBHsG60DSGcqQgh7uZIto4htO0BXbz0hWHBvc3PDd95CLGWRUU+yFiOkQU+1MJZ/FQdB+XptFF2l I+kPEEbN7ILEdF9YY16un0Z4+I6/ne7rw94akq7knkqkhL8NZhkmQq2LR6jYCCbWga+Ad1XbTwbFK 12idSWixEs1ivcfHNq1InSzZfhmmLM8dq93S87Q35QGLebRmLkoy08PLvnrnQUMJR1ZXe8K1gYspL k5LgalPQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3tqK-00310g-Gq; Thu, 15 Jul 2021 05:23:38 +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 132/138] mm/vmscan: Free non-shmem THPs without splitting them Date: Thu, 15 Jul 2021 04:36:58 +0100 Message-Id: <20210715033704.692967-133-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 We have to allocate memory in order to split a file-backed page, so it's not a good idea to split them. It also doesn't work for XFS because pages have an extra reference count from page_has_private() and split_huge_page() expects that reference to have already been removed. Unfortunately, we still have to split shmem THPs because we can't handle swapping out an entire THP yet. Signed-off-by: Matthew Wilcox (Oracle) --- mm/vmscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7a2f25b904d9..8b17e46dbf32 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1470,8 +1470,8 @@ static unsigned int shrink_page_list(struct list_head *page_list, /* Adding to swap updated mapping */ mapping = page_mapping(page); } - } else if (unlikely(PageTransHuge(page))) { - /* Split file THP */ + } else if (PageSwapBacked(page) && PageTransHuge(page)) { + /* Split shmem THP */ if (split_huge_page_to_list(page, page_list)) goto keep_locked; } -- 2.30.2