From patchwork Tue Jan 7 20:53:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 234264 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,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 A1CBFC33CA1 for ; Tue, 7 Jan 2020 21:25:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BC31206F0 for ; Tue, 7 Jan 2020 21:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578432326; bh=KxQqkjSP+KQQKGgW+0xbxHTcfTNBu7JiDtSMXcq+ViY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y7KDQL73mWgdODoPlZK/VdRL7E1zWFaLeuSV57Ly4dJBceBI4ROOIV/AiREYqhNRE tNaVJzLqkO8CVYLjIdbXHWxnI9elGmIukw7Cj+60PsjFdB25+7c6hHgjIGe1CYQeEQ 61saXrGqSKB6bJxntlgBUd5bNyLSXSvrkRIgc45M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbgAGVAB (ORCPT ); Tue, 7 Jan 2020 16:00:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:33908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728238AbgAGVAA (ORCPT ); Tue, 7 Jan 2020 16:00:00 -0500 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 9F4112081E; Tue, 7 Jan 2020 20:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578430800; bh=KxQqkjSP+KQQKGgW+0xbxHTcfTNBu7JiDtSMXcq+ViY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBwkvXxz75jXy+oCmFIgczFE5G9VG2RV2seTO/ttZCVje6dZrl3GDDFbvbP98PVcx Z7F1Q76orGufZbTIuOpDvMucVYdCj+0//5C+AdNPMiRb+FaFB490QrHsUd7+fc5Rmz Ai2eqUAlT+dU11kapCTIirXiKEHjs9C45w0T+/no= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chanho Min , Jinsuk Choi , Sergey Senozhatsky , Minchan Kim , Andrew Morton , Linus Torvalds Subject: [PATCH 5.4 084/191] mm/zsmalloc.c: fix the migrated zspage statistics. Date: Tue, 7 Jan 2020 21:53:24 +0100 Message-Id: <20200107205337.494599781@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107205332.984228665@linuxfoundation.org> References: <20200107205332.984228665@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chanho Min commit ac8f05da5174c560de122c499ce5dfb5d0dfbee5 upstream. When zspage is migrated to the other zone, the zone page state should be updated as well, otherwise the NR_ZSPAGE for each zone shows wrong counts including proc/zoneinfo in practice. Link: http://lkml.kernel.org/r/1575434841-48009-1-git-send-email-chanho.min@lge.com Fixes: 91537fee0013 ("mm: add NR_ZSMALLOC to vmstat") Signed-off-by: Chanho Min Signed-off-by: Jinsuk Choi Reviewed-by: Sergey Senozhatsky Acked-by: Minchan Kim Cc: [4.9+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/zsmalloc.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -2069,6 +2069,11 @@ static int zs_page_migrate(struct addres zs_pool_dec_isolated(pool); } + if (page_zone(newpage) != page_zone(page)) { + dec_zone_page_state(page, NR_ZSPAGES); + inc_zone_page_state(newpage, NR_ZSPAGES); + } + reset_page(page); put_page(page); page = newpage;