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.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 793FEC2BA1A for ; Tue, 7 Apr 2020 02:22:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C751206C0 for ; Tue, 7 Apr 2020 02:22:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C751206C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DF9748E0005; Mon, 6 Apr 2020 22:22:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA90B8E0001; Mon, 6 Apr 2020 22:22:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE5EA8E0005; Mon, 6 Apr 2020 22:22:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id BB2718E0001 for ; Mon, 6 Apr 2020 22:22:02 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7A5B8180AD806 for ; Tue, 7 Apr 2020 02:22:02 +0000 (UTC) X-FDA: 76679458884.19.trick29_1198204c5fb0f X-HE-Tag: trick29_1198204c5fb0f X-Filterd-Recvd-Size: 2146 Received: from r3-23.sinamail.sina.com.cn (r3-23.sinamail.sina.com.cn [202.108.3.23]) by imf41.hostedemail.com (Postfix) with SMTP for ; Tue, 7 Apr 2020 02:22:00 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([114.246.227.120]) by sina.com with ESMTP id 5E8BE3C200005377; Tue, 7 Apr 2020 10:21:57 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 64220954919855 From: Hillf Danton To: Joonsoo Kim Cc: Andrew Morton , Linux Memory Management List , LKML , Johannes Weiner , Michal Hocko , Hugh Dickins , Minchan Kim , Vlastimil Babka , Mel Gorman Subject: Re: [PATCH v5 05/10] mm/swap: charge the page when adding to the swap cache Date: Tue, 7 Apr 2020 10:21:44 +0800 Message-Id: <20200407022144.11164-1-hdanton@sina.com> In-Reply-To: <20200406115804.4440-1-hdanton@sina.com> References: <1585892447-32059-1-git-send-email-iamjoonsoo.kim@lge.com> <20200406115804.4440-1-hdanton@sina.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000014, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 7 Apr 2020 09:42:54 +0900 Joonsoo Kim wrote: >=20 > 2020=3DEB=3D85=3D84 4=3DEC=3D9B=3D94 6=3DEC=3D9D=3DBC (=3DEC=3D9B=3D94)= =3DEC=3D98=3DA4=3DED=3D9B=3D84 8:58, Hi=3D > llf Danton =3DEB=3D8B=3D98=3DEC=3D9D=3DB4 =3DEC=3D9E=3D= 91=3DEC=3D84=3DB1: > > > > > > On Fri, 3 Apr 2020 14:40:43 +0900 Joonsoo Kim wrote: > > > > > > @@ -153,11 +165,16 @@ int add_to_swap_cache(struct page *page, swp_= entr=3D > y_t entry, > > > xas_unlock_irq(&xas); > > > } while (xas_nomem(&xas, gfp)); > > > > > > - if (!xas_error(&xas)) > > > + if (!xas_error(&xas)) { > > > + mem_cgroup_commit_charge(page, memcg, false, compound= ); > > > > Add a tp > > trace_mm_add_to_swap_cache(page); >=20 > Please let me know the reason of this comment. It is derived from=20 trace_mm_filemap_add_to_page_cache(page); in __add_to_page_cache_locked().