From patchwork Thu Jun 21 23:15:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 10480929 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E17E9604D3 for ; Thu, 21 Jun 2018 23:16:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1E101FFB2 for ; Thu, 21 Jun 2018 23:16:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4B6228F76; Thu, 21 Jun 2018 23:16:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FEB61FFB2 for ; Thu, 21 Jun 2018 23:16:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 17EF86B0006; Thu, 21 Jun 2018 19:16:18 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 10A286B0008; Thu, 21 Jun 2018 19:16:18 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9BBA6B000A; Thu, 21 Jun 2018 19:16:17 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id AEFC96B0006 for ; Thu, 21 Jun 2018 19:16:17 -0400 (EDT) Received: by mail-pg0-f72.google.com with SMTP id n20-v6so222030pgv.14 for ; Thu, 21 Jun 2018 16:16:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=WZHWpk1kfLU4xp8jHQyKMe70mPgE71ofBxlBD6FYgRY=; b=rc9C0wIcWANpRwd1kJrm6qrXhRSdbKOuhfcm3tX9SEkmSPPIwzDzmLy27nffhBf96+ Xwpnc0si6XTAGUy+CEOTVZogEpeRFmGVUqxMnR7lmFiiWQtloDD7qt6vxyF4JsfUdC1O oo9IgRGppT8fgTVVsqTxFAkolJ5roTFznBpnjeIJOlaISVe78E6tVUcnZSg2BjX4urWz PWHvF3fiB9oIRoJCeh+X+vQtIxZb22T8PcqqxPjutuS2Y2ROF8mewDuBknfK7SiK2ScZ NdZF57sHlZg7xOZC5IeOsb18ohtSVq14bAGGZM2uFtR6UMyJ7krlQUNsI9AigY7UFJiN rBeg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Gm-Message-State: APt69E0YvhAd77UUqctdy2QPSq/HNWm1JEnTlei6VAYmNVA8ZBewXCdo IIolLzoxqzMSweXVvbwWL2G4op65bNF0Nn8ME246SxwMCoTYVVLVYPlKgpoMr6nNtx7kr7YZg9i EnhSDStNYnEFc/EmZoMDuszWDINDloHGAzZcjcKl8K3duYC5wWwpG0J/epE5W86ia5w== X-Received: by 2002:a17:902:8a4:: with SMTP id 33-v6mr30075389pll.343.1529622977422; Thu, 21 Jun 2018 16:16:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLRjQ9NbYdm/YNjN3rutDy5WXwoTm/DI0Qz2CK4hxiCeHLXX+3VDUbFkLPN5Z42G3xWMYtA X-Received: by 2002:a17:902:8a4:: with SMTP id 33-v6mr30075330pll.343.1529622976431; Thu, 21 Jun 2018 16:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529622976; cv=none; d=google.com; s=arc-20160816; b=lmYtRvb0qhbfcuUYhqXrwqyMFp8zrfZphgZQVfGP8JiH9Pq4cfJQBKsnGAJCW1xNv+ tEjvWs3osJ0/fGy+zx1+94ub5bnf4C8vyyNavS1g+zblCeJo80b1JC9V0F0NIIQaw30Y HqNcHmtiSZjJNc5/smT9sLuJOvJVkmqpNdg6HgmIgr8l5Q0opX2/WdFBleDz0wJQCrxK xIb72qMUMCRiHNDNhJ0ZYyfm5OcHCXTwtwyR6dcnMhrea3FjH9HIHUhMwE4ZUv7lQblQ lQFDBlj2LjlQDWvgh71qMCJjdgh5PMSAD9wcZa8BguiFd75eRokoBOfCQeG6K00XBxgI vLVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=WZHWpk1kfLU4xp8jHQyKMe70mPgE71ofBxlBD6FYgRY=; b=a6eaR8rrPv3KI5rlx8cN2C695nCUfbbgO6o4/bYPRe+SC4d5/otz8wCbTqWv5v1igW rdRh/BfNaUlWboUy9c6aHH2rdfaftn29sPVvmpq44NyEgGGLLu2Sw/OxUTNtYFDYtSFR tnfr8OCL1HOFDthyg96uB2Xxv+r4zERLCDHoiVXFBG6e4yryjlcxfSrsWJCtTojM174M VrDUoqNKLBWEScaFM4PfxjXE3o0JfgSZP43iO//RlJlijZN+/oY4AadQxd2NBcJDRJos ZOZDEfTby1RBCkjH3oYwbNbeA36VxiYtA0AjqmmLXj+7GR5M0S52GmvTyl/pucUxlECu WzPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out4436.biz.mail.alibaba.com (out4436.biz.mail.alibaba.com. [47.88.44.36]) by mx.google.com with ESMTPS id q2-v6si5857757plh.136.2018.06.21.16.16.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 16:16:16 -0700 (PDT) Received-SPF: pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) client-ip=47.88.44.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of yang.shi@linux.alibaba.com designates 47.88.44.36 as permitted sender) smtp.mailfrom=yang.shi@linux.alibaba.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R121e4; CH=green; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e07486; MF=yang.shi@linux.alibaba.com; NM=1; PH=DS; RN=7; SR=0; TI=SMTPD_---0T389Jdj_1529622950; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0T389Jdj_1529622950) by smtp.aliyun-inc.com(127.0.0.1); Fri, 22 Jun 2018 07:16:01 +0800 From: Yang Shi To: hughd@google.com, kirill.shutemov@linux.intel.com, vbabka@suse.cz, akpm@linux-foundation.org Cc: yang.shi@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v2 PATCH 2/2] mm: thp: inc counter for collapsed shmem THP Date: Fri, 22 Jun 2018 07:15:49 +0800 Message-Id: <1529622949-75504-2-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1529622949-75504-1-git-send-email-yang.shi@linux.alibaba.com> References: <1529622949-75504-1-git-send-email-yang.shi@linux.alibaba.com> 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: X-Virus-Scanned: ClamAV using ClamSMTP /sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed is used to record the counter of collapsed THP, but it just gets inc'ed in anonymous THP collapse path, do this for shmem THP collapse too. Signed-off-by: Yang Shi Cc: Hugh Dickins Cc: Kirill A. Shutemov Cc: Vlastimil Babka Acked-by: Kirill A. Shutemov --- v1 --> v2: * Seperate from the previous patch per Kirill's comment mm/khugepaged.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 9b0ec30..4018826 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1521,6 +1521,8 @@ static void collapse_shmem(struct mm_struct *mm, unlock_page(new_page); *hpage = NULL; + + khugepaged_pages_collapsed++; } else { /* Something went wrong: rollback changes to the radix-tree */ shmem_uncharge(mapping->host, nr_none);