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=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS 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 00A1AC38A2A for ; Fri, 8 May 2020 21:51:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AFC4921974 for ; Fri, 8 May 2020 21:51:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="rSGufhOW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFC4921974 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4BF0E90001E; Fri, 8 May 2020 17:51:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4944190001C; Fri, 8 May 2020 17:51:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D24590001E; Fri, 8 May 2020 17:51:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 2717F90001C for ; Fri, 8 May 2020 17:51:42 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DAA9C180AD811 for ; Fri, 8 May 2020 21:51:41 +0000 (UTC) X-FDA: 76794899202.07.mist73_6613b5aa6cc1a X-HE-Tag: mist73_6613b5aa6cc1a X-Filterd-Recvd-Size: 4374 Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 May 2020 21:51:41 +0000 (UTC) Received: by mail-qv1-f66.google.com with SMTP id di6so1475798qvb.10 for ; Fri, 08 May 2020 14:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hKXRONb+n2QBaUWyV/lYpYzKCQdxSGuUXqvfdv5OsKY=; b=rSGufhOWI5GJ6rCz1J39rS/t2dS6ZoQ36aA2y3RXn5bAZ7046RBX6rQnu8ISFEZaMD MH3QH8Zj79L5MHtEygX2sQIkEpEfpHec8ju4KgtrK9eU1RZhdZ2ADOsWM9iz88vgttuh lIhGIaHkK5GccMZd4UVybv9snSfren/bg4uecEExUUcmw5JEP2cbA+xbtKbRVjuz2FQ4 5zJAHOSx0PxNJo9D0F6/NfqJoHwOJJQB/+dObv66HynblLg5aIM6hTSAhuPo4+e/VtTq KBTGSBVIHMtUAqfiBAW8agqP824GFhS2GZ9MnXXsirMXAHLSoEyNDOrCQaUbdjxmCZw+ Susw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hKXRONb+n2QBaUWyV/lYpYzKCQdxSGuUXqvfdv5OsKY=; b=oyjIO4OZC7YfHBQLiyJeqtp/H8jEd6QKjtCOW8ElheP1E1IcYhTxRzyWwG2vX1EFjC tJyK/97Ga+V4ad6zxf+IvyO6A3HHMhbkt7Erfnxu+Iej1EBQW2fVuJVf5dmky51+g5xF MSu4n4WgetX0qeK6h7a/sTiipZjmCWDuiSUAjTU+5Vc6ZvoFeCcvy2RcQLEBcl6nmbH9 KvB53BUdgrNoM1bV+nZXTFPNJlMiCIXrWdW4OEaZnNROV1n8rvWGPn40g7wPSFooPCnc hnEgC1+wE/VeBFXN5OYX5nHBlvb/XNVAlk9NvWVcZ23dVcuvlTkIAFA1z9+p+iicMUHt O/dg== X-Gm-Message-State: AGi0PubUFUR3YZG2/u2ZeLm2s13idgF1WeRgb0/T2WawMu4xLaGFqGU3 dxoR0bwjFYmVI0JlWYJTUvsqQQ== X-Google-Smtp-Source: APiQypL2QQXpmSyCMyeb86k1mqtxlrryhZ7iuR/Zzeb58Ec8aokdSWY0L39I7tQhUSNR2pzmPjJlSQ== X-Received: by 2002:a0c:e549:: with SMTP id n9mr4873559qvm.214.1588974700726; Fri, 08 May 2020 14:51:40 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:2627]) by smtp.gmail.com with ESMTPSA id g16sm2123740qkk.122.2020.05.08.14.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 14:51:40 -0700 (PDT) Date: Fri, 8 May 2020 17:51:22 -0400 From: Johannes Weiner To: Shakeel Butt Cc: Mel Gorman , Roman Gushchin , Michal Hocko , Andrew Morton , Yafang Shao , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] mm: swap: fix update_page_reclaim_stat for huge pages Message-ID: <20200508215122.GB226164@cmpxchg.org> References: <20200508212215.181307-1-shakeelb@google.com> <20200508212215.181307-3-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200508212215.181307-3-shakeelb@google.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: On Fri, May 08, 2020 at 02:22:15PM -0700, Shakeel Butt wrote: > Currently update_page_reclaim_stat() updates the lruvec.reclaim_stats > just once for a page irrespective if a page is huge or not. Fix that by > passing the hpage_nr_pages(page) to it. > > Signed-off-by: Shakeel Butt https://lore.kernel.org/patchwork/patch/685703/ Laughs, then cries. > @@ -928,7 +928,7 @@ void lru_add_page_tail(struct page *page, struct page *page_tail, > } > > if (!PageUnevictable(page)) > - update_page_reclaim_stat(lruvec, file, PageActive(page_tail)); > + update_page_reclaim_stat(lruvec, file, PageActive(page_tail), 1); The change to __pagevec_lru_add_fn() below makes sure the tail pages are already accounted. This would make them count twice. > #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > > @@ -973,7 +973,7 @@ static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec, > if (page_evictable(page)) { > lru = page_lru(page); > update_page_reclaim_stat(lruvec, page_is_file_lru(page), > - PageActive(page)); > + PageActive(page), nr_pages); > if (was_unevictable) > __count_vm_events(UNEVICTABLE_PGRESCUED, nr_pages); > } else {