Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp284988ybg; Wed, 18 Mar 2020 23:02:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtLoDjtBPIE3o6UgyVv/ClcBvjcVikriutQW15EgbNXh43j9tyk9M/VjSftKyOvScHrDt9o X-Received: by 2002:aca:fc88:: with SMTP id a130mr1114679oii.89.1584597726343; Wed, 18 Mar 2020 23:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584597726; cv=none; d=google.com; s=arc-20160816; b=vyFqxXVkFpJDaPAaznThIVXtHYa+k64Cn/HXaYvDNIXvFqSTYILWNpczM0ftqUaXq6 lA0xfj6qHRloQXilAl13lLlpEjI6CEmNoxhQKZ9HuRIiCYbq0KCYULad9ouQ6t880HZ0 DKAoXbhVtGkYqyCVSkVbYWhhjSULLEQWItdDWM1a0K8PeXcFzxSwa1UNZgqHxPnf5ggD vOuK7XG6XpOkDvZyAmCwNa6TYSMFCnNC5Z4NgPN+7HaKvG7aZBVJ81uqKu7Y9LPamM9A RKh/cpcduyUCcq4VpN3pL2kOlNNmUMdzzpbfO6zqwX1aWAiCdpXUeu1MA8Ta/Y7Ve2Tt m9/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=eCxSZQRC9mU6ikJj9Kf2AGR9r6dmYjhkzwdN+IOcnFY=; b=j35TSsaBU0Y77wYbPNT/U9diyeRxBT2ZC85g+I1v58VMaTvXrmDt7IF33lsYOwR1MU fizuUYL572B6VYSatpRGTrVsLniP8Qok4tsK1sFXnFUUoRAY6t6Q0+8rqLq3fcXcXpCb eOvIs2+WamkK7b0UJu77zylmn3m6gHUYTN5LqfqQ5B+1Qlh658qqKXX+Gw8yP2P+3DjP rFSUWNBeDkZsBukumgTs/4HyloAR3q/muRSPNyDtqvO1ur+cEZgqWAGIFSn9vL8YxcBO Kmmsrstg50spsKUQcvrDN2vwxvCFgkIuvIJPG0hMes2oXNSVxHTQyBTsreZGTDhZaHPG hpqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rGUmJAis; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si685096otr.193.2020.03.18.23.01.53; Wed, 18 Mar 2020 23:02:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rGUmJAis; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbgCSGBP (ORCPT + 99 others); Thu, 19 Mar 2020 02:01:15 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:35211 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726989AbgCSGBP (ORCPT ); Thu, 19 Mar 2020 02:01:15 -0400 Received: by mail-qk1-f194.google.com with SMTP id d8so1499147qka.2 for ; Wed, 18 Mar 2020 23:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=eCxSZQRC9mU6ikJj9Kf2AGR9r6dmYjhkzwdN+IOcnFY=; b=rGUmJAisnmikEgH17MaYp7Q5qSWFp9gsorLUBBhdz/QhY/IyZ3zL8fE6Mrwb2HbrvK b2WLU51qN7OZyVPpMx98aqTyOzmi5+5/fEkO36QEP1khJWiJAhYZngbkwKAMh9tSRKms AfZHxiVWEFqXdu/xGS0W3vC9m1WxLUllS3YlAPNa5yCTp9t4+oMxsTOj+av5155+MtEk 55YCA+xkjdZ3BvFqXglkGOfY5h/J6rUPiowWAIBqRWGibuZiVLGV0h8Mjt/ERIxiLCMl U86heWXmXtTxu3AoXF+pTaz/sW9hgRYWM1L3VahOpBmIMF5PZ5Oi2PHJ+PKBMYE94U0Q SJQg== 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:content-transfer-encoding; bh=eCxSZQRC9mU6ikJj9Kf2AGR9r6dmYjhkzwdN+IOcnFY=; b=gtLvt48EkINNJuzNQB205QLKlXLwxWWnvrWt1D55Y897ELrtV755xhWclrYdn3I0uK qg6/wf92xE7uHO1Lzalug/tlfS0YOknnAQIJ5/9lxARzs5cZ/V1E/5K95ruiFBHV2/YN MPzD1fMlRMO8OsVkNhsYyXMj1ja2onwaO/z97RasaZtv+LNl37rZJqmjL2eCJLaMhsOs MWwaVNQMiEDqk2SL7QYZgCWADjMKawcLWMUtS+z3BQI+4QNJ2yrTq4MfAgcPI/JG6i/P LiNkt5/JQlQvaa/pwRRfNOZ1PZUK3X3uRP2VQVP7NLZqBw7+ywNAtgqdSd7bZ3pV9AoB Y19w== X-Gm-Message-State: ANhLgQ2NZoXXpL2cfHoSwYXaZO5+ui6LWAnZuqTQT0hodPE1SF/Dbv45 EgW+pLEqlk9kFYu6NZ6H09rqiJmOzIGe+zYjdGM= X-Received: by 2002:a37:b4c1:: with SMTP id d184mr1490325qkf.452.1584597674075; Wed, 18 Mar 2020 23:01:14 -0700 (PDT) MIME-Version: 1.0 References: <1584423717-3440-1-git-send-email-iamjoonsoo.kim@lge.com> <1584423717-3440-5-git-send-email-iamjoonsoo.kim@lge.com> <20200318183318.GD154135@cmpxchg.org> In-Reply-To: <20200318183318.GD154135@cmpxchg.org> From: Joonsoo Kim Date: Thu, 19 Mar 2020 15:01:03 +0900 Message-ID: Subject: Re: [PATCH v3 4/9] mm/swapcache: support to handle the value in swapcache To: Johannes Weiner Cc: Andrew Morton , Linux Memory Management List , LKML , Michal Hocko , Hugh Dickins , Minchan Kim , Vlastimil Babka , Mel Gorman , kernel-team@lge.com, Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2020=EB=85=84 3=EC=9B=94 19=EC=9D=BC (=EB=AA=A9) =EC=98=A4=EC=A0=84 3:33, J= ohannes Weiner =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > On Tue, Mar 17, 2020 at 02:41:52PM +0900, js1304@gmail.com wrote: > > From: Joonsoo Kim > > > > Swapcache doesn't handle the value since there is no case using the val= ue. > > In the following patch, workingset detection for anonymous page will be > > implemented and it stores the value into the swapcache. So, we need to > > handle it and this patch implement handling. > > "value" is too generic, it's not quite clear what this refers to > here. "Exceptional entries" or "shadow entries" would be better. Okay. Will change it. > > @@ -155,24 +163,33 @@ int add_to_swap_cache(struct page *page, swp_entr= y_t entry, gfp_t gfp) > > * This must be called only on pages that have > > * been verified to be in the swap cache. > > */ > > -void __delete_from_swap_cache(struct page *page, swp_entry_t entry) > > +void __delete_from_swap_cache(struct page *page, > > + swp_entry_t entry, void *shadow) > > { > > struct address_space *address_space =3D swap_address_space(entry)= ; > > int i, nr =3D hpage_nr_pages(page); > > pgoff_t idx =3D swp_offset(entry); > > XA_STATE(xas, &address_space->i_pages, idx); > > > > + /* Do not apply workingset detection for the hugh page */ > > + if (nr > 1) > > + shadow =3D NULL; > > Hm, why is that? Should that be an XXX/TODO item? The comment should > explain the reason, not necessarily what the code is doing. It was my TODO. Now, I check the code and find that there is no blocker for the huge page support. So, I will remove this code and enable the workingset detection even for the huge page. > Also, s/hugh/huge/ Okay. > The rest of the patch looks straight-forward to me. Thanks.