From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A04CC3A5A8 for ; Wed, 4 Sep 2019 18:25:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2759120870 for ; Wed, 4 Sep 2019 18:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567621523; bh=POVv77FAGLE3oY4C5hekS+tznimgFvbt1kJ+1AMw6nM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IaYprnMpDRKjlR106Nqi6caT3pDi6Wz0P5scz8m8JqvrYKq/yb/FeDhzP+TMiRXAL 1kBEeaxVFS6qMDnCLXQj3smH3HweV0FeeYrEZtRG056s0RpiWyLbZmiaM7QbjdG9ZP T7Mo9HtheRKCNJ6d1CaZr6Nx2qdD7DlwOkPmQzQU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387770AbfIDSAP (ORCPT ); Wed, 4 Sep 2019 14:00:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:39382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388358AbfIDSAN (ORCPT ); Wed, 4 Sep 2019 14:00:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2240022CF7; Wed, 4 Sep 2019 18:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620012; bh=POVv77FAGLE3oY4C5hekS+tznimgFvbt1kJ+1AMw6nM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fmua2HsMQkTO4IcusoO7bXuyjnxgZYujgPoQP4YtPG/oKRcsxTpX4a5fnyRjqwceF g6zelQqGYrS6EgZW17wHx71+bjnR6TRb04uZcmvUQhhbLmg/2f4k7/tMYJUzToF3vH qnCpDiSLUYFmKT4LwdYD0AfXvkGj85CQzvGdCHG0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Kirill A. Shutemov" , Vlastimil Babka , Michal Hocko , Mel Gorman , Matthew Wilcox , Andrew Morton , Linus Torvalds Subject: [PATCH 4.9 41/83] mm, page_owner: handle THP splits correctly Date: Wed, 4 Sep 2019 19:53:33 +0200 Message-Id: <20190904175307.434935113@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175303.488266791@linuxfoundation.org> References: <20190904175303.488266791@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vlastimil Babka commit f7da677bc6e72033f0981b9d58b5c5d409fa641e upstream. THP splitting path is missing the split_page_owner() call that split_page() has. As a result, split THP pages are wrongly reported in the page_owner file as order-9 pages. Furthermore when the former head page is freed, the remaining former tail pages are not listed in the page_owner file at all. This patch fixes that by adding the split_page_owner() call into __split_huge_page(). Link: http://lkml.kernel.org/r/20190820131828.22684-2-vbabka@suse.cz Fixes: a9627bc5e34e ("mm/page_owner: introduce split_page_owner and replace manual handling") Reported-by: Kirill A. Shutemov Signed-off-by: Vlastimil Babka Cc: Michal Hocko Cc: Mel Gorman Cc: Matthew Wilcox Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/huge_memory.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -1950,6 +1951,9 @@ static void __split_huge_page(struct pag } ClearPageCompound(head); + + split_page_owner(head, HPAGE_PMD_ORDER); + /* See comment in __split_huge_page_tail() */ if (PageAnon(head)) { page_ref_inc(head);