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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 848C8C43331 for ; Thu, 2 Apr 2020 15:14:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 471522074D for ; Thu, 2 Apr 2020 15:14:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="LhmJEj2+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 471522074D 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 D6CDC8E000A; Thu, 2 Apr 2020 11:14:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D1CD88E0007; Thu, 2 Apr 2020 11:14:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C0B968E000A; Thu, 2 Apr 2020 11:14:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id A9B558E0007 for ; Thu, 2 Apr 2020 11:14:16 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 54783180AD807 for ; Thu, 2 Apr 2020 15:14:16 +0000 (UTC) X-FDA: 76663260912.13.coat16_42500c9421b5e X-HE-Tag: coat16_42500c9421b5e X-Filterd-Recvd-Size: 5034 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 15:14:15 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id o10so4233585qki.10 for ; Thu, 02 Apr 2020 08:14:15 -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:content-transfer-encoding:in-reply-to; bh=6V8MAk4CYER6oFWyosg5mJivoo0UdSsXpVob3p2WcUA=; b=LhmJEj2+GFCFSn734TVbt4q8S+EnMVyq+aGwTZxgIJ7rMCzKGPFaOXro2rI/R8Jca4 xl5Lwphom5321zVvWuEqXxgsEqfCPgoU8+W40FM/m1KzHWFXOZFqZwAPVS5ArHoA0rt/ HGV4UHzmjo7hyT25K0DhY6eqidbUfdC+5glHUc8fDMfO2v9Iiyi0wqVj+ZL2nc2kL7WO 6S56NiRMmYvYL/lL02BDY8yTQtB0TZ9ZkqwTRHQNbXwcLTQNz+OvNTeg/yTDw+hJp/Le NJAz7e8i6Vrh4BiFxPWH03E4c17X4kD3msqGzZHxe1zBhSzlazbubV+eMxQI25Dxxvuv 16uA== 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:content-transfer-encoding :in-reply-to; bh=6V8MAk4CYER6oFWyosg5mJivoo0UdSsXpVob3p2WcUA=; b=fyb5RFZrz1Hax8PDN0MYXdhrGsGBVxRCWVJLmgrQJ7IcHNiv1c0+mx3pwxpka297Wn UJ/Zqv2BKTd2CofGHkKZNjKOif/EVlKuth4tAUerwlH1/hPf+y/pDRPugU942xHHq5la 7l/YwW1m5VcCToV9fKzLgRMKjWz4Zu4f3606V+XqcZwQWNIioFR/H55lwS44tHhlrhbi wVjze41OxeOdixIKSt3Vvv3GZOzq4jUkTDA9D00xBkIXgbhNUii+cgan/S5ai0rcMiP8 3mDEpDU1ZYc5DLgYi7rH1E0IULUwTN3RHZbyBo8/veLpiMpmnbWCQX+de93JgcLZfwzZ +q4g== X-Gm-Message-State: AGi0Pub65/5MWYgfCqafaRSvIIhZOfFJGJQJOhz9kLmufFBbm2qpSnHa 1jCUXd1Y1YfZ0SORcRd1Bkt1ug== X-Google-Smtp-Source: APiQypKPkLo7ddzwHeHCVfkAO70BWQ9FTcD4R/8meF875/CrwJY2zZWMhqG6DvbGAW5qAqDry8qRLA== X-Received: by 2002:a37:d244:: with SMTP id f65mr4075727qkj.373.1585840454760; Thu, 02 Apr 2020 08:14:14 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::11c9]) by smtp.gmail.com with ESMTPSA id 124sm3765499qkl.31.2020.04.02.08.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 08:14:14 -0700 (PDT) Date: Thu, 2 Apr 2020 11:14:13 -0400 From: Johannes Weiner To: Joonsoo Kim Cc: Andrew Morton , Linux Memory Management List , LKML , Michal Hocko , Hugh Dickins , Minchan Kim , Vlastimil Babka , Mel Gorman , kernel-team@lge.com, Joonsoo Kim Subject: Re: [PATCH v4 6/8] mm/swap: implement workingset detection for anonymous LRU Message-ID: <20200402151413.GC2089@cmpxchg.org> References: <1584942732-2184-1-git-send-email-iamjoonsoo.kim@lge.com> <1584942732-2184-7-git-send-email-iamjoonsoo.kim@lge.com> <20200323171744.GD204561@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable 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 Thu, Apr 02, 2020 at 02:50:28PM +0900, Joonsoo Kim wrote: > 2020=EB=85=84 3=EC=9B=94 24=EC=9D=BC (=ED=99=94) =EC=98=A4=ED=9B=84 3:2= 5, Joonsoo Kim =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > The problem looks not that easy. Hmm... > > > > In current code, there is a large time gap between the shadow entries > > are poped up and the page is charged to the memcg, especially, > > for readahead-ed pages. We cannot maintain the shadow entries of > > the readahead-ed pages until the pages are charged. > > > > My plan to solve this problem is propagating the charged mm to > > __read_swap_cache_async(), like as file cache, charging when > > the page is added on to the swap cache and calling workingset_refault= () > > there. Charging will only occur if: > > > > 1. faulted page > > 2. readahead-ed page with the shadow entry for the same memcg > > > > Also, readahead only happens when shadow entry's memcg is the same > > with the charged memcg. If not the same, it's mostly not ours so > > readahead isn't needed. > > > > Please let me know how you think of the feasibility of this idea. >=20 > Hello, Johannes. >=20 > Could you let me know your opinion about the idea above? > In fact, since your reply is delayed, I completed the solution about th= e > above idea. If you want, I will submit it first. Then, we could discuss > the solution more easily. It's probably easiest if you send out your implementation and we discuss it over the code. Thanks!