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=-15.1 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 E4E1DC433E6 for ; Mon, 31 Aug 2020 14:44:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A1ECA20767 for ; Mon, 31 Aug 2020 14:44:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CYK5uN2c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1ECA20767 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 366146B005C; Mon, 31 Aug 2020 10:44:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 315DE6B005D; Mon, 31 Aug 2020 10:44:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B6876B0062; Mon, 31 Aug 2020 10:44:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id 03A896B005C for ; Mon, 31 Aug 2020 10:44:47 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B1BA41E12 for ; Mon, 31 Aug 2020 14:44:47 +0000 (UTC) X-FDA: 77211135414.17.screw19_0d084ec27090 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 101E6180D0181 for ; Mon, 31 Aug 2020 14:44:46 +0000 (UTC) X-HE-Tag: screw19_0d084ec27090 X-Filterd-Recvd-Size: 4207 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Mon, 31 Aug 2020 14:44:46 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id y17so3632013lfa.8 for ; Mon, 31 Aug 2020 07:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LO0Fe9S4KXntDSdPtGJ0g7vkmoOwVpiEPeR5HEYJGqs=; b=CYK5uN2cdn+PR1F+kdmzuT1zEVTHfVMmBiA8cTXpVQn9DRC+ZJaVejbpm21TqkNO3o g9I0P1rDgyPEpnLbyfL4lYLtTbIHpikbHvEHLOVFWlIT49rbPIGIifEjZQs1qvDYMPCv mRPgPXtftSSVxLGt3w97d9vsBVWrAgJeFVeFnPYQKthNEjF5a1CCE3J38KBc7D/dMf7O tRukyS/rk++VOyl9IJUtMJx1JTeK/wt1X+m5mDiF0FKxO0DQ1ou/r3ZEmZXd1cN6kaUP 0D1JTuqRJFIB6NtzxK4RCqi7D4DX8ULJAf199cWTOZKeb0Gd7++pQ7IrRlV9LQGIoXEO n8CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LO0Fe9S4KXntDSdPtGJ0g7vkmoOwVpiEPeR5HEYJGqs=; b=ckhlRHhWWjgXGlrC/j1zIlrX0VMh5QKsszN1y8CLqPXNayKE4JGcEp5eVt3CpTQOuZ WPooNBvQLWJlo7iZ40ze2VCJKP1GcM9VC9LXIvrdVkLLrkoY4LYk8CEhgpG6/APIDC+w bq87kJar/qBu7PAvLs9d2sqiwVUIcNHYGLCLvNoB7uvfKUoG9vR3o6331AnHXYw6xXWW oU00lSeW2jPFq+oBgHSxLY7Mdo4uZR00MIHf3GlcVArzHlvDmpUrjDoEfoVWODDhmZeh dxFJD1jNKvtzyMER84oFU+6x71ZsM+qJOIOG03B0kbYzIF/sVhoKJT3o5Gq/twe1IQSp BMmw== X-Gm-Message-State: AOAM530xky/g29OzvyyiZT3hkiurTFvKz8GAvHqYRC7ZeU2u37KXSgvj xPEHYdVsa3tXO9Wyu9TlPmlpYgRc3dINT4Z3er5qyw== X-Google-Smtp-Source: ABdhPJwO4rm8CgWBhE1kUdAsFzVfjoQWIqLLSp92sStxvVNvA18Wt+IiMA3i3b0ha2ZJ6tsqC+o1QOEY4SVcpXebS4k= X-Received: by 2002:a19:c8c6:: with SMTP id y189mr850506lff.125.1598885084870; Mon, 31 Aug 2020 07:44:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shakeel Butt Date: Mon, 31 Aug 2020 07:44:33 -0700 Message-ID: Subject: Re: [PATCH 4/5] mm: fix check_move_unevictable_pages() on THP To: Hugh Dickins Cc: Andrew Morton , Alex Shi , Johannes Weiner , Michal Hocko , Mike Kravetz , Matthew Wilcox , Qian Cai , Chris Wilson , Kuo-Hsin Yang , LKML , Linux MM Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 101E6180D0181 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On Sun, Aug 30, 2020 at 2:08 PM Hugh Dickins wrote: > > check_move_unevictable_pages() is used in making unevictable shmem pages > evictable: by shmem_unlock_mapping(), drm_gem_check_release_pagevec() and > i915/gem check_release_pagevec(). Those may pass down subpages of a huge > page, when /sys/kernel/mm/transparent_hugepage/shmem_enabled is "force". > > That does not crash or warn at present, but the accounting of vmstats > unevictable_pgs_scanned and unevictable_pgs_rescued is inconsistent: > scanned being incremented on each subpage, rescued only on the head > (since tails already appear evictable once the head has been updated). > > 5.8 commit 5d91f31faf8e ("mm: swap: fix vmstats for huge page") has > established that vm_events in general (and unevictable_pgs_rescued in > particular) should count every subpage: so follow that precedent here. > > Do this in such a way that if mem_cgroup_page_lruvec() is made stricter > (to check page->mem_cgroup is always set), no problem: skip the tails > before calling it, and add thp_nr_pages() to vmstats on the head. > > Signed-off-by: Hugh Dickins Thanks for catching this. Reviewed-by: Shakeel Butt