Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4496910ybz; Tue, 21 Apr 2020 01:30:54 -0700 (PDT) X-Google-Smtp-Source: APiQypJHewaJN75bh+iaTQb042v/hu9ogTwuin1KUgoAefvNQL6asukwAj/PS+8yJhOEA4HkyXSf X-Received: by 2002:a17:906:b896:: with SMTP id hb22mr6487824ejb.209.1587457854453; Tue, 21 Apr 2020 01:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587457854; cv=none; d=google.com; s=arc-20160816; b=ReWCUpgDR4sUDYGyrr2yTU/sj++5458W9KhCFuTL66SJp6XUhOUQaqkpkDs9L+dfcu R9lbYrIzk+ACj0mcFzWUFjYmiT/oM9PC5AIhCmPJZlTStM/r0QWf8dM7GITNOYDPAeTg sGR8j66ZEyDY9BdqKrEBQSUIDWjWzQNNU35sZ3kDFirnGjXe7cclbNw8fvKGxkklQbck qlbGT4AWicEP1T2y/uZ0My2soOHWHGEq9A1ZwnLqjuNDIh6CN36J9eS5fR9OMOEde4lR SLGktM32BhfZJfURMzNRpmt1ccSavfOYHf/VbGl0+xE3D2HhsyC0KmbVdDXQgQj+pBGv ZytA== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=fc7MyXQkMOBheFyhUlHYz8XayhRTtcrMwTzzvWmVAQ4=; b=M9VIGq8dxFLhkyDej6x9R3SBSDVv8KbZDdywL5M301IHmP0q2ILcAnJ+wPPRbaRHeJ aJe1OP3oTYrkv3GavzV4eXDS+cQT9r7q+RreDZilbSmsb9XYROliujOENqyC1PU9mL8Q hR58F/h3IyIiH65qC0JG/Rfxe+1057SD6MSpa59/J04Wb9NDCfTjR3AwObxB3JQCyyxG HJkBC+fKtVTm9tv2Brg/X+fdsxx2S75cw5b98JKQc6ARgiNiswbiJXHylkf681kllwWf 9BbBB/oMmt8s8GQa6hknfQbkU/06BOGPg1ZiT+ZuHP7A5jwphMFi4eZpFmId/QDRg/09 vCYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx18si1211821edb.73.2020.04.21.01.30.30; Tue, 21 Apr 2020 01:30:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728178AbgDUI3c (ORCPT + 99 others); Tue, 21 Apr 2020 04:29:32 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:40828 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbgDUI3b (ORCPT ); Tue, 21 Apr 2020 04:29:31 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R681e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0TwDHj5a_1587457757; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0TwDHj5a_1587457757) by smtp.aliyun-inc.com(127.0.0.1); Tue, 21 Apr 2020 16:29:17 +0800 Subject: Re: [PATCH 01/18] mm: fix NUMA node file count error in replace_page_cache() To: Johannes Weiner , Joonsoo Kim Cc: Shakeel Butt , Hugh Dickins , Michal Hocko , "Kirill A. Shutemov" , Roman Gushchin , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com References: <20200420221126.341272-1-hannes@cmpxchg.org> <20200420221126.341272-2-hannes@cmpxchg.org> From: Alex Shi Message-ID: Date: Tue, 21 Apr 2020 16:28:10 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200420221126.341272-2-hannes@cmpxchg.org> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2020/4/21 ????6:11, Johannes Weiner ะด??: > When replacing one page with another one in the cache, we have to > decrease the file count of the old page's NUMA node and increase the > one of the new NUMA node, otherwise the old node leaks the count and > the new node eventually underflows its counter. > > Fixes: 74d609585d8b ("page cache: Add and replace pages using the XArray") > Signed-off-by: Johannes Weiner Reviewed-by: Alex Shi > --- > mm/filemap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/filemap.c b/mm/filemap.c > index 23a051a7ef0f..49e3b5da0216 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -808,11 +808,11 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask) > old->mapping = NULL; > /* hugetlb pages do not participate in page cache accounting. */ > if (!PageHuge(old)) > - __dec_node_page_state(new, NR_FILE_PAGES); > + __dec_node_page_state(old, NR_FILE_PAGES); > if (!PageHuge(new)) > __inc_node_page_state(new, NR_FILE_PAGES); > if (PageSwapBacked(old)) > - __dec_node_page_state(new, NR_SHMEM); > + __dec_node_page_state(old, NR_SHMEM); > if (PageSwapBacked(new)) > __inc_node_page_state(new, NR_SHMEM); > xas_unlock_irqrestore(&xas, flags); >