Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp922141ybh; Wed, 18 Mar 2020 11:34:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuZEBZ2q6jdUEVKRrSYe8Mb5esF+lp8yR9Youg8vZqKjNCxSm85KpM/Jts8usf3Z1nbXRL1 X-Received: by 2002:a05:6830:14cc:: with SMTP id t12mr4911484otq.118.1584556481593; Wed, 18 Mar 2020 11:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584556481; cv=none; d=google.com; s=arc-20160816; b=Hpv1lcoC10yjqP6y00nURSAuu9mAgVE1mK0D4aT2ilnqA92BVR1ySrRggiMB+fxRph xuPvUlXVxBExCwTrC9WPTigi2bYYucmwvBJaa+9OavkKAKjhzFCLBaFrOBSWNtWpgCD2 XtzAhuO7eLkZ97tgHIcSRKk992CJza1/dqPs05G7BtNXmpSPssFy/0kxI+Q8HBUcp0Ts 7iIbdn5+ST/2mPwNttDj2irg0Kc4XV3VmiryPFM2QFpUbn0gGeDNSnqFXBotm5wz6dLw 4U3dd3uRmjzb877PbuLWm2C+F4rnURe2BdNO2EcdAcZ3jwuFabRL0uq5S4UsosjmkP1Z 6kWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ip23Q/fmH9GkZLli1PvyNY1tJYowB5KnpO5h7I2g+T8=; b=fszOisbFiVJBg1EYGqswIM/nnwFbLwqFOVg1pLzL2OoKxEbzudHsogDc7ZEUZDl2wf ngYfH/1pKNJolB5CLZnfsh+D8Uk7yg6F15MipynNzceYXaRYmn1CADcBlLoy8l7Vhbem C5WE0mWUrYos0Qm+07U/svcE4ss10xOwQc+qaytlVvOU7WwB7TGzxpUaxiYF9CqJaefo ZTt6Jf41hVcLljIItSniCQ5KqKs4Vpc3CVirZuqFD5FCKZW/mbKSxU48R2kWX7jATm02 0OYxq+WyY3mpy5cdk4KPW5uHvj2dErDfOAACOZvZSjkx6HQSg08gW44m/HgVK7x8/WhQ o1Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=k34A8qiX; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si3997911otk.127.2020.03.18.11.34.28; Wed, 18 Mar 2020 11:34:41 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=k34A8qiX; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbgCRSdX (ORCPT + 99 others); Wed, 18 Mar 2020 14:33:23 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:34631 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbgCRSdW (ORCPT ); Wed, 18 Mar 2020 14:33:22 -0400 Received: by mail-qk1-f195.google.com with SMTP id f3so40528908qkh.1 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=r/4oaSgkXdEAhq6qrp+tzRkaoqZE6oOGVrpCademVg34GY8vtVqbJTl0F8ieTLAsQz Fhp7qKmwjQGIONMR5kL0TFyLJoahk1Ewyg1BV+KjtiS20S+EffJ7nbm2BRU59T5AxVNI gkwxYx8iA3Mg8rKMHUieHsTy5XC3dVDVCIQJ99eJKBFZnAmsF6sWGRyGT6fyEyY4Muav DYo/wU+giBjPUpHhTT6/GQiK6Ahlj98yvy7UGMLBQmSSULf2OgClM95RrNBL+Qw/uk68 LMJ7tMCXL4RWD+9SPwcKHNfUCkONhgVtJn3n6HRchVqo9TG39ji93ErOp3sT+X83hX3x acGA== X-Gm-Message-State: ANhLgQ1mSGdJ9f1DmDQ4KSzt3f3Ptfvscfme0ec5SRzpWGxE8bKZVtGf SHsy73EU4qVy+yZYzw7lz4nNzw== 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.