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 DDBB7C10DCE for ; Wed, 18 Mar 2020 18:33:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A39BB20787 for ; Wed, 18 Mar 2020 18:33:22 +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="k34A8qiX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A39BB20787 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 3CE9D6B0073; Wed, 18 Mar 2020 14:33:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 37F6C6B0075; Wed, 18 Mar 2020 14:33:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 295566B0078; Wed, 18 Mar 2020 14:33:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 0D98B6B0073 for ; Wed, 18 Mar 2020 14:33:22 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B38CE180AD81D for ; Wed, 18 Mar 2020 18:33:21 +0000 (UTC) X-FDA: 76609330602.16.knee62_3a5f4f5684b59 X-HE-Tag: knee62_3a5f4f5684b59 X-Filterd-Recvd-Size: 4666 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Mar 2020 18:33:20 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id z25so35641691qkj.4 for ; Wed, 18 Mar 2020 11:33:20 -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=ip23Q/fmH9GkZLli1PvyNY1tJYowB5KnpO5h7I2g+T8=; b=k34A8qiXPlwViOmgLKOUThMMETnc0hJLj8etiqMsluruL0R6jNrkbNsCeGRjctAXkP 8oTIRM/OspYFKGtQmtiNJhkH7LuJG84hQ+YpG8iEZ1T49eOycdy7gwweDP8iSdy47rXT lzPRSzFh6dlljvS7JefASvHrBwuxxif86KRYq1CYP0SXYHB2yB5L2BDosVffNoqa42od osT67blOOEwHzhNefYIMwYd4mUhkqyMwiOk8irb2Icx99Z4WhvblIWOc5zCOrurl0L0H SJAGyOLo+NWGyyBzMDjLGUMeJM08pNVBQtUi9VpPgg8WK1VrpJDfay77ln7BBpimFq/7 hCcw== 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=ip23Q/fmH9GkZLli1PvyNY1tJYowB5KnpO5h7I2g+T8=; b=lxdDRTDKS1rucUZ+i5dUGX0s154UutqTA8T68Px5zk+NzJvAfK4ITRJ16hKgFusaOL zmUtwtkRWLDlan9aIs/1yON6mhn9ii3ej1R9hDOFyXNA+ooiFhdaZlRaEEODhnX/oag2 XhzREEADIYea6RVmfX3EXKi0h6Pzd3K0FQ4d1bgsVMpnYLo3kEguPJbJCxLN3NCWKR4/ 93w5bLQlbaua8phDMlOs3Rrq38wdKqRAGOxsmlaSE5Er5eKv4Axsp8YeqTTjqw0uqywG FYK8W3I0gRfYxQeYPY7/pvrXHiIDDOkdJO0KAQM7wZSCWmbQvwwQmEXNL+7NHg0ig/F8 ZiDw== X-Gm-Message-State: ANhLgQ2xUnawM59ARVy2xWfLczIsqMeVAtWytB0CPemwxfjf401pV3qy 53DywqUBUP76uQaGgGKPZ+UVXw== X-Google-Smtp-Source: ADFU+vu7GryYNKb43tvvadTPFd4tNQYK1tv0MLcVZ+z57z+2qPdzTSPqxt8vCt8xmtB5WFAiLQ5tnw== X-Received: by 2002:a37:47d3:: with SMTP id u202mr5383770qka.264.1584556400310; Wed, 18 Mar 2020 11:33:20 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:a9a9]) by smtp.gmail.com with ESMTPSA id l16sm5318954qtc.73.2020.03.18.11.33.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 11:33:19 -0700 (PDT) Date: Wed, 18 Mar 2020 14:33:18 -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 v3 4/9] mm/swapcache: support to handle the value in swapcache Message-ID: <20200318183318.GD154135@cmpxchg.org> References: <1584423717-3440-1-git-send-email-iamjoonsoo.kim@lge.com> <1584423717-3440-5-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1584423717-3440-5-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 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 value. > 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. > @@ -155,24 +163,33 @@ int add_to_swap_cache(struct page *page, swp_entry_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 = swap_address_space(entry); > int i, nr = hpage_nr_pages(page); > pgoff_t idx = swp_offset(entry); > XA_STATE(xas, &address_space->i_pages, idx); > > + /* Do not apply workingset detection for the hugh page */ > + if (nr > 1) > + shadow = 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. Also, s/hugh/huge/ The rest of the patch looks straight-forward to me.