Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp429640ybk; Sat, 9 May 2020 07:09:32 -0700 (PDT) X-Google-Smtp-Source: APiQypIsP37QG2tVxgTm2T7guMJ7GR39wWaAbA1nuaUqzLv4UIg1WceLjoKRqlFz3mY/IGCCqflD X-Received: by 2002:a17:906:970e:: with SMTP id k14mr6275446ejx.202.1589033371984; Sat, 09 May 2020 07:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589033371; cv=none; d=google.com; s=arc-20160816; b=kwPgo+Vqx33csX4dN4Mqwea6IYOzMpYDZns5t76DwKCMFOwUhLe9g55uK5Sz7tZ2a8 gnIDGMGXpUkD9+lBY/2znd+NvwNrHuFjSJgUjBCOZdtxwA8cDOY3AT1723ECgnSXW3Rr qsBY3QCjG+YJ8oZASWHPV0AST5MQF1Ib9tHce8wZgidME+m/YOd+/wfTZ63aHFtkjbEd gxffNRvUEwNPAC3Gqtn6pI8cysR41WhNGw0n5jjZhLA12S3EroCdLJDDOzC+cGGpY27O +DSHllT6sDsjgMEmSHRGyj8CeZiqvy/7UpI4gZWGs5pDw+C+n7NrdR2olcFjwDVyDJ6P QTpw== 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=Jc93T48//PCz7sdPyS0gIAsQLpsU+tV5Kt0CzqYwNik=; b=RO8kXr22sUr/sh4hbVSEhZcPE2vKZ5KXPRw3H/KNy04qzdSv2ujAhcIaLmBwT9S8Hs hdAxRSl+GH3gJWOtnSXNFGUeG4d8N7Zw3svScMQPHJiyaWXlRDsxzYJYgj/kSp8bmZvF zgGUWoOctc6I1UWkGpotY96Bnb8wspm9Ay0U1TIiiMqXQp0f4BsJ24XxfcYusfNU9bHK DJfW/p/HZAltJ4JQEDs5XSEbUak8uBr2EiKtJvePZNpZyiVX6dmH9dzw91Fs+UNKxYUd QlIC+awiQTWmoLRrmDO2AhnQFu8YPkV92yNQUvXYEHBIv2p95kZbkQUgN3PyuXYHy5BH H5Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uF4uQoe+; 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 c4si2534720ejb.189.2020.05.09.07.09.08; Sat, 09 May 2020 07:09:31 -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=uF4uQoe+; 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 S1727933AbgEIOHD (ORCPT + 99 others); Sat, 9 May 2020 10:07:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727882AbgEIOHC (ORCPT ); Sat, 9 May 2020 10:07:02 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBE72C061A0C for ; Sat, 9 May 2020 07:07:01 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id a9so3684910lfb.8 for ; Sat, 09 May 2020 07:07:01 -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=Jc93T48//PCz7sdPyS0gIAsQLpsU+tV5Kt0CzqYwNik=; b=uF4uQoe+Y/Rjx41fEplRhUf+B9x5B5F/LKDeKQu+D8rktHPDMcvcrKJ2M9QRQslZfS pxpEfjWspPHF07KZa4jVhaeDrW9r2+L6O38kBjVzIONl+siiFRvZHre6UUqVfO5njY4B dclVPiAKKVgD9sk/qgxT+kxi1bWfRfD1eDSbafMPpBgtnE3jIzAu//+1lQ4e92NmJfmj LCTOgnamNTrgmOw5HmZ+CAhGi7SIJy6XSOZNlSbK8eezV94DWGSsmsC1Idq4uY50QrbP w0b4AnWsem9n7jdd6EvNgGuGM5FgnEYGAQe4NPYrBycRSJed3lj+S+y6HdS2UnvQtkqG 9oyQ== 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=Jc93T48//PCz7sdPyS0gIAsQLpsU+tV5Kt0CzqYwNik=; b=qwJY7vVxv9wjzzRQSb++TGEitonBsf4wnifWeknjdGBfxqSRYyCL8HW3np+DJL9Jfd kjTlzTjp1wjh2M2cxfW3Xx5+IGb8+1F5dxcX9NCGqpEcQjkfUMMgaCC+p67Pgm1ykhif 9ivdp9bEz2TnmBhc70X0P1b5oM0T5840ls9HTh9YPk9j26W4coHNQlx6kl3Rms9+qOwg NpeqFR/mmz/3VQ19gRRXl1Asom8yPd2WjZdpe4dZI9J0Kh09cz2NiXq0+DY1jHkmOxNA mDBXL9eEuqPbu8/DDrMKYU78tY5CVZ2bZON4EkvWl2GDk+uX4SayXd3v1UeqM4uAsibd N5vQ== X-Gm-Message-State: AOAM532nCaP0u74SOPV3766/X38RYVO9qYHb/Tp7LIdQowKTSEKUpgY4 t/gJG6Ksr+BWHmEn9rRY3D1naHCgROYeHzYVF5dKJA== X-Received: by 2002:a19:f512:: with SMTP id j18mr5027730lfb.33.1589033220016; Sat, 09 May 2020 07:07:00 -0700 (PDT) MIME-Version: 1.0 References: <20200508212215.181307-1-shakeelb@google.com> <20200508212215.181307-3-shakeelb@google.com> <20200508215122.GB226164@cmpxchg.org> In-Reply-To: <20200508215122.GB226164@cmpxchg.org> From: Shakeel Butt Date: Sat, 9 May 2020 07:06:48 -0700 Message-ID: Subject: Re: [PATCH 3/3] mm: swap: fix update_page_reclaim_stat for huge pages To: Johannes Weiner Cc: Mel Gorman , Roman Gushchin , Michal Hocko , Andrew Morton , Yafang Shao , Linux MM , Cgroups , LKML 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 Fri, May 8, 2020 at 2:51 PM Johannes Weiner wrote: > > 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. > What happened to that patch? Fell through the cracks? > > @@ -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. > Yes, you are right. I will just re-send your patch after rebase. > > #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 {