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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 9140AC54E8F for ; Mon, 11 May 2020 22:04:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D6EC2078A for ; Mon, 11 May 2020 22:04:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Mwkksggy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D6EC2078A 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 DDE9B900088; Mon, 11 May 2020 18:04:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D6F05900036; Mon, 11 May 2020 18:04:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2F40900088; Mon, 11 May 2020 18:04:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A78E6900036 for ; Mon, 11 May 2020 18:04:15 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 70A328248047 for ; Mon, 11 May 2020 22:04:15 +0000 (UTC) X-FDA: 76805817270.08.tramp62_5f53b0aa61b5a X-HE-Tag: tramp62_5f53b0aa61b5a X-Filterd-Recvd-Size: 5630 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 May 2020 22:04:14 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id o14so10243754ljp.4 for ; Mon, 11 May 2020 15:04:14 -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=olyg5BleQvWOok0H/W0T/3hEIKhdj40HkG84B1Qp8Mk=; b=MwkksggyB7hO8niRFHCNEvzqnttDKzZhbF6bX7zyQlg6Z9k9/odEcDN9Av/YYp7/FP lwQ8gEJ5veg1LluP89YM6zlDQfidZvcCHIg66ATTwEoLN/6GrDBuKhwyt2JM5HDx3CQo eg6QuRIFpfO3RxIuFhZvq7vuERLhBJjGZpAjj22HDfFNtgkafZ04l40Cift48ut2e3G6 VMQ6C9J/BoTu22NyRBOSNXiewfJvOO9coYK6Puw1+k7+U1PqivrEFSlD5TisyC0xLBvu b0cBtTTyods9Vl5xtjBMWC3+BDkx+jnYO4CpQKgH6i1w12zxdzo/cEcYXJUnrEEmYWaf sw+g== 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=olyg5BleQvWOok0H/W0T/3hEIKhdj40HkG84B1Qp8Mk=; b=egoph9EJGD6J/zR2FqUuqXEHSFpRKKo0aWggTilZAfoDdEkxUdk/DHkmsjoXXuqhmz 8LqDFuFQSCiyYpEYSUjkaa5V3vne+k8mgZiA8VLnpij/ujt719MgVncpOvtY74en4Gps XsF7J4JQ/RzPA9XexZt24NVyoc63XxjotUkU279S/Yk4CWTBafHMpGFdSBCBd0Dc3xvj /DJzC8OaIXrAByFoJp8r95Yfv8ijR8OZ9o/ObHtcVLks8+ghKihMa2dFxnDJCbBLLQin hGsd95FF9v2vRa25B+hMm2wFLN+35aTPNClb/T6ZW4w8ZKCnl8SeN3H6i6NqdEuqVGDs 8zrA== X-Gm-Message-State: AOAM532x8XQELcWDpf5/J7WPsksoJDZSXZFUFeMX7RAcouOcI34pOiZR knIXqdysKuRsXVLhkJUoK5U26AqEWwrn/SRvVPWFyg== X-Google-Smtp-Source: ABdhPJxEzF0xbkVw+pIhwSjLBsTmnQO4i4A9Izu9MStBQuQQYoj878fBgf2Bxsu4yCT20viSeq4ril4g+4u8nMV0Be4= X-Received: by 2002:a2e:1659:: with SMTP id 25mr9288748ljw.250.1589234653280; Mon, 11 May 2020 15:04:13 -0700 (PDT) MIME-Version: 1.0 References: <20200509141946.158892-1-shakeelb@google.com> <20200511141122.9b03e2f0852b57b224eab066@linux-foundation.org> <20200511145817.a1379d6117b43c3f6474e199@linux-foundation.org> In-Reply-To: <20200511145817.a1379d6117b43c3f6474e199@linux-foundation.org> From: Shakeel Butt Date: Mon, 11 May 2020 15:04:01 -0700 Message-ID: Subject: Re: [PATCH] mm: fix LRU balancing effect of new transparent huge pages To: Andrew Morton Cc: Mel Gorman , Johannes Weiner , Roman Gushchin , Michal Hocko , Minchan Kim , Rik van Riel , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" 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, May 11, 2020 at 2:58 PM Andrew Morton wrote: > > 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 > Oh sorry my mistake. It is dependent on the first two patches at [1]. Basically I replaced the third patch of the series with this one. I should have re-send them all together. [1] http://lkml.kernel.org/r/20200508212215.181307-1-shakeelb@google.com