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.8 required=3.0 tests=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 EE5B4C3F2CD for ; Mon, 23 Mar 2020 17:43:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B4B6620722 for ; Mon, 23 Mar 2020 17:43:01 +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="dRfuJVBu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4B6620722 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 483616B0007; Mon, 23 Mar 2020 13:43:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40D656B0008; Mon, 23 Mar 2020 13:43:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AE7C6B000A; Mon, 23 Mar 2020 13:43:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 0F55D6B0007 for ; Mon, 23 Mar 2020 13:43:01 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B0ADB18333C1E for ; Mon, 23 Mar 2020 17:43:00 +0000 (UTC) X-FDA: 76627347720.21.space73_37539c6b57b06 X-HE-Tag: space73_37539c6b57b06 X-Filterd-Recvd-Size: 4893 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Mar 2020 17:43:00 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id k13so4473956qki.2 for ; Mon, 23 Mar 2020 10:42:59 -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=sMniDVy1p2OmkgYmHjBj3ZlNGasfwYaHXqTVFmvQbLo=; b=dRfuJVBuA+ZR77BKWjMOyDWr3ICK4jIJ0UyTL4MJvqSyyRnomtEsmYvBcJ6OC7FhqA sM2rUddls7HJuOME+yXGMsXrJ9kSQuidfOA12LHgYOI4HIo/heytF6mpojr296Px9Vlt tJn306ooDHJE5UnBOlw2QhnpEmkKG6D+gxVcVdG+qIy/54ewoxtsMwOAHmXx61aTzcfc PyzBxX0MFYW745TNGe4+VQKZgBFtz/AYKZgbsS4ttV5nEWmoOIDo3wBPcP1t2C0WbgvP O9b62I93Juv1ETY19O0ac4lApoMaP+Hm4GFvjuSsAphS9DJquc7mJNMwxTAGUq4TpfpD H13g== 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=sMniDVy1p2OmkgYmHjBj3ZlNGasfwYaHXqTVFmvQbLo=; b=R77VO+gJ65M+/Rk+2IIhZd/8Qws8C9DXU3p/ITGvHKK41t6rhtOCr4EJrP/euQnW3M mTMmxKj/B/umCFegj/oXdSk6rMBm0mLoP99ra7w6vN3cRt1aPc3bfGNyJV6DbIzeHv4b ezWV/X7nYkWbiVdhMnCJi5KYU0OIi4jAeu3c0IDLg382GnReTQFh2rzH8cOlblklNx68 4fGmXBZEaw8dj7DX1vGpbQqny0pAcjzGlbh/VEXP5cwHV7eiigLcEqg6YFD3U8aOAUFJ UwOTZF7iBu5yy91an5K0n6fR/47QepvSLNv6I1h71P0OANEoM1msmZ5ree9WlJtM8zZ5 fAtA== X-Gm-Message-State: ANhLgQ0A1kMpgUwbo0v2v58XgFE1R2Vp3VgEzUpT6fXBue9IrfmyKKbY xKavwl7tzRo0AKDChVtCYY5bEg== X-Google-Smtp-Source: ADFU+vstQOTUXltPJNCAeftURC+G/GHvMmKeGMWG/dYq7Xd6UmQjdy8N4OI2a+RoHEPxsCP0B2Aw9g== X-Received: by 2002:a37:8d42:: with SMTP id p63mr21664518qkd.182.1584985379276; Mon, 23 Mar 2020 10:42:59 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:a9a9]) by smtp.gmail.com with ESMTPSA id x74sm10784599qkb.40.2020.03.23.10.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 10:42:58 -0700 (PDT) Date: Mon, 23 Mar 2020 13:42:57 -0400 From: Johannes Weiner To: js1304@gmail.com Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Hugh Dickins , Minchan Kim , Vlastimil Babka , Mel Gorman , kernel-team@lge.com, Joonsoo Kim Subject: Re: [PATCH v4 8/8] mm/swap: count a new anonymous page as a reclaim_state's rotate Message-ID: <20200323174257.GF204561@cmpxchg.org> References: <1584942732-2184-1-git-send-email-iamjoonsoo.kim@lge.com> <1584942732-2184-9-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1584942732-2184-9-git-send-email-iamjoonsoo.kim@lge.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 Mon, Mar 23, 2020 at 02:52:12PM +0900, js1304@gmail.com wrote: > From: Joonsoo Kim > > reclaim_stat's rotate is used for controlling the ratio of scanning page > between file and anonymous LRU. All new anonymous pages are counted > for rotate before the patch, protecting anonymous pages on active LRU, and, > it makes that reclaim on anonymous LRU is less happened than file LRU. > > Now, situation is changed. all new anonymous pages are not added > to the active LRU so rotate would be far less than before. It will cause > that reclaim on anonymous LRU happens more and it would result in bad > effect on some system that is optimized for previous setting. > > Therefore, this patch counts a new anonymous page as a reclaim_state's > rotate. Although it is non-logical to add this count to > the reclaim_state's rotate in current algorithm, reducing the regression > would be more important. > > I found this regression on kernel-build test and it is roughly 2~5% > performance degradation. With this workaround, performance is completely > restored. > > v2: fix a bug that reuses the rotate value for previous page I agree with the rationale, but the magic bit in the page->lru list pointers seems pretty ugly. I wrote a patch a few years ago that split lru_add_pvecs into an add and a putback component. This was to avoid unintentional balancing effects of LRU isolations, but I think you can benefit from that cleanup here as well. Would you mind taking a look at it and maybe take it up into your series? https://lore.kernel.org/patchwork/patch/685708/