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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 3655DC54E8D for ; Mon, 11 May 2020 21:58:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0F0D620736 for ; Mon, 11 May 2020 21:58:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="sjnyo8wq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F0D620736 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 974CC900087; Mon, 11 May 2020 17:58:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 92646900036; Mon, 11 May 2020 17:58:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83B48900087; Mon, 11 May 2020 17:58:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id 695A8900036 for ; Mon, 11 May 2020 17:58:20 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2F2D940F4 for ; Mon, 11 May 2020 21:58:20 +0000 (UTC) X-FDA: 76805802360.28.salt70_2ba3c8a02675d X-HE-Tag: salt70_2ba3c8a02675d X-Filterd-Recvd-Size: 3841 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 May 2020 21:58:19 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7AE0B2070B; Mon, 11 May 2020 21:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589234298; bh=tXYiBL6lhcDBOgVrVzxBviFHcr3U2rw6/zqjTPOU8TU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sjnyo8wqX93srFtzj5MP4ju3f3Wtp95Z+K+KSj7HazuHN20Tj7yLVkftqG9hBG5pc Axod5Eghd8FqjYA6qjlCGMHXYjzGAETWnmRLy799ViXfYSO92sArbLrNAhnqTBdl6H 2CyOT9kpwpLrRF03R+uFYBWQGiLxKfcdNP3NOLgc= Date: Mon, 11 May 2020 14:58:17 -0700 From: Andrew Morton To: Shakeel Butt Cc: Mel Gorman , Johannes Weiner , Roman Gushchin , Michal Hocko , Minchan Kim , Rik van Riel , Linux MM , LKML Subject: Re: [PATCH] mm: fix LRU balancing effect of new transparent huge pages Message-Id: <20200511145817.a1379d6117b43c3f6474e199@linux-foundation.org> In-Reply-To: References: <20200509141946.158892-1-shakeelb@google.com> <20200511141122.9b03e2f0852b57b224eab066@linux-foundation.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Mon, 11 May 2020 14:38:23 -0700 Shakeel Butt wrote: > On Mon, May 11, 2020 at 2:11 PM Andrew Morton wrote: > > > > On Sat, 9 May 2020 07:19:46 -0700 Shakeel Butt wrote: > > > > > Currently, THP are counted as single pages until they are split right > > > before being swapped out. However, at that point the VM is already in > > > the middle of reclaim, and adjusting the LRU balance then is useless. > > > > > > Always account THP by the number of basepages, and remove the fixup > > > from the splitting path. > > > > Confused. What kernel is this applicable to? > > It is still applicable to the latest Linux kernel. The patch has > @@ -288,7 +288,7 @@ static void __activate_page(struct page *page, struct lruvec *lruvec, > > __count_vm_events(PGACTIVATE, nr_pages); > __count_memcg_events(lruvec_memcg(lruvec), PGACTIVATE, nr_pages); > - update_page_reclaim_stat(lruvec, file, 1); > + update_page_reclaim_stat(lruvec, file, 1, nr_pages); > } > } but current mainline is quite different: static void __activate_page(struct page *page, struct lruvec *lruvec, void *arg) { if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) { int file = page_is_file_lru(page); int lru = page_lru_base_type(page); del_page_from_lru_list(page, lruvec, lru); SetPageActive(page); lru += LRU_ACTIVE; add_page_to_lru_list(page, lruvec, lru); trace_mm_lru_activate(page); __count_vm_event(PGACTIVATE); update_page_reclaim_stat(lruvec, file, 1); } } q:/usr/src/linux-5.7-rc5> patch -p1 --dry-run < ~/x.txt checking file mm/swap.c Hunk #2 FAILED at 288. Hunk #3 FAILED at 546. Hunk #4 FAILED at 564. Hunk #5 FAILED at 590. Hunk #6 succeeded at 890 (offset -9 lines). Hunk #7 succeeded at 915 (offset -9 lines). Hunk #8 succeeded at 958 with fuzz 2 (offset -10 lines). 4 out of 8 hunks FAILED