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, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 45CAAC4332D for ; Thu, 19 Mar 2020 06:01:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 06D5920732 for ; Thu, 19 Mar 2020 06:01:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rGUmJAis" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06D5920732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 85A5B6B0003; Thu, 19 Mar 2020 02:01:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 809846B0005; Thu, 19 Mar 2020 02:01:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71F0D6B0006; Thu, 19 Mar 2020 02:01:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 57D586B0003 for ; Thu, 19 Mar 2020 02:01:15 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 01810824556B for ; Thu, 19 Mar 2020 06:01:15 +0000 (UTC) X-FDA: 76611064110.26.field37_622d926c1085c X-HE-Tag: field37_622d926c1085c X-Filterd-Recvd-Size: 5015 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Thu, 19 Mar 2020 06:01:14 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id s11so1441127qks.8 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=RhTMWZ5KdFNmQBfs7uRgy1MQANtYQkg960Lhy8q/Npcl0g1VvI9ifEHIXbuMcL+3vS KPThaEa49mDjZuQtuCAK+j9fsyIc2WKtDvZwpEd+FvkpTiDmLi2ILH3lkaymuWsCXzXk 006cvxDx8FQ52Ylv4AuhTFJIO0muRJK5dgQ+l/EkkqkCJjIxo7xHZaaqkUbIohj952Oc 3xDZV/rLgOFzTYfVThGiwm451yitKZaCDyU3lRiW7xDSTvAHvlkX3JB1aFficfbzQ8Xn sP5H3dAYpwlpUxsPKlIlI7nmxgo+JHDQqbFFCm8CWo56sdk9TMVXRyUDJWIZpQ1iW0lj JCcA== X-Gm-Message-State: ANhLgQ0flHhOxvj+rLI1k7M8VTwUPGMEezjZ1VLmk50PyIs0JeQveCTE oRyl4LZ2KzmHbYkSePYLLBr0jn0vWx/r2zg9GCg= X-Google-Smtp-Source: ADFU+vtlCKIt8CYc1mLZdtKBx+I3STE84KKoWJY9XTbvMMi5W52y+DXmlXlks513cy5hVUjF9+9MDEeuW3cYcb8lHzk= 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 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: 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.