Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1169219pxk; Mon, 31 Aug 2020 11:41:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwglidY4DNMj9OYnmhGJ1Wtubok71bLUq8i32ii5YMwr6jk5wQ35sEEz26blnHGyLtE+vAi X-Received: by 2002:a17:906:38c7:: with SMTP id r7mr2327203ejd.118.1598899277712; Mon, 31 Aug 2020 11:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598899277; cv=none; d=google.com; s=arc-20160816; b=DFFa+jE0rEL7DjqNORtlG07KFJJrUODt+B6r8BooTwUESpp+gDe0rQ7EzwRR9AFNph uRvdGxbLcG5hP8Rdn+ZavpAwZg/7uUeEuz8TGJjnN9c44N96HhZVmUWShjnu8rjJDVK3 RNwt56tYEcxIedRxqP9S5TqMZ7Y6pbJOAqBpdGQ1N2eAQLNZHXzrix5g0F8qJReOcZTQ HSr01c33U4H8Y+YsARsdNL8kFgSxJlhhzYHm4VboN1P4D06tuMTVbzKU4vcKX4T7nH6/ /JHz+r3rzFTAYXeAMXftxDFu4qSSbkaIps4dYttykVejq5I9HlCrHqlohezCQp+Qr2dD 8TKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LO0Fe9S4KXntDSdPtGJ0g7vkmoOwVpiEPeR5HEYJGqs=; b=xrWQcpAjBaz68gF0uLqrCnJH3ok83/X/Rc5Oe2yNE7QW8ba8iTi49OoyEU48EivmkS vMqbeCiCl/co4bfED5xla2o99aAB5p/Lhy8g9VFNtgl/aPsTLaPwSuYIM6Bw/TyceVCb QNsfjIoLwG6lnn1gr1YP4uzbwxFhYfKyiUSaV/J00uqfnQkFj6i6WmUaIV/Ouo4gceA1 zdWida3t4TFDwtCKPnWWY4mMkUIvkcJR8EV1xHfe3JTnlRGXoT+cXYW+MQOFz0toy3Ab l0ZOteOiby5eUtdaWP/oyrpkSfyhTDkHQxUgfhPljLgPcEVg2fSxXEG4q9da2oAmcF3n 4Dig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CYK5uN2c; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si5787826edq.141.2020.08.31.11.40.54; Mon, 31 Aug 2020 11:41:17 -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=@google.com header.s=20161025 header.b=CYK5uN2c; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbgHaOot (ORCPT + 99 others); Mon, 31 Aug 2020 10:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbgHaOor (ORCPT ); Mon, 31 Aug 2020 10:44:47 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8794C061573 for ; Mon, 31 Aug 2020 07:44:46 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id c15so3654767lfi.3 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=gAKzuf35uuTzaUmJ8/R7UByFexZGaY7e/R0DiXJxCtI9bDFJXrICVj8/MTgzDktE9W HKnoGQm49NS8fCCKbM/HmgZEFdf2aAkQ+BXLZhXby/ZMItXIrkIUdfdCRLbhCRBrNA+Z 30vbrqUI+XLSPzcXZ4WnhRVT5fKyIJMiz2rQB/Lrs/hBdP5m4rbkZSL1gzu5oi/PFjck EKcOK99YGvE2JFxm/CluAxDzwyvGS+ZeZNRy1a8W7jM3KTLLpjs7qlkLz4jAdBvCLiZA nEd9s0vab0wrfJ+o3E8sNBDlBDMblAV2LsD/oZ35xLDnD+a4NbjO1c2Bo4n9oPa2znBP PHqA== X-Gm-Message-State: AOAM532Fyfkp230HXoukc/IfbriWHl5BnKpNZVr6umVllewz4ByHOwSy MYBSfkGGfV/FncHAfmouVFwhX3yEvPAFxZQNvujYYA== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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