From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965662AbdEWCv3 (ORCPT ); Mon, 22 May 2017 22:51:29 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:34571 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965648AbdEWCvW (ORCPT ); Mon, 22 May 2017 22:51:22 -0400 Date: Mon, 22 May 2017 19:51:12 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Xishi Qiu cc: Hugh Dickins , Andrew Morton , Tejun Heo , Michal Hocko , Johannes Weiner , Mel Gorman , Michal Hocko , Vlastimil Babka , Minchan Kim , David Rientjes , Joonsoo Kim , aarcange@redhat.com, sumeet.keswani@hpe.com, Rik van Riel , Linux MM , LKML , zhong jiang Subject: Re: mm, something wring in page_lock_anon_vma_read()? In-Reply-To: <59239C4C.5020709@huawei.com> Message-ID: References: <591D6D79.7030704@huawei.com> <591EB25C.9080901@huawei.com> <591EBE71.7080402@huawei.com> <591F9A09.6010707@huawei.com> <591FA78E.9050307@huawei.com> <5922B3D4.1030700@huawei.com> <59239C4C.5020709@huawei.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 May 2017, Xishi Qiu wrote: > On 2017/5/23 3:26, Hugh Dickins wrote: > > I mean, there are various places in mm/memory.c which decide what they > > intend to do based on orig_pte, then take pte lock, then check that > > pte_same(pte, orig_pte) before taking it any further. If a pte_same() > > check were missing (I do not know of any such case), then two racing > > tasks might install the same pte, one on top of the other - page > > mapcount being incremented twice, but decremented only once when > > that pte is finally unmapped later. > > > > Hi Hugh, > > Do you mean that the ptes from two racing point to the same page? > or the two racing point to two pages, but one covers the other later? > and the first page maybe alone in the lru list, and it will never be freed > when the process exit. > > We got this info before crash. > [26068.316592] BUG: Bad rss-counter state mm:ffff8800a7de2d80 idx:1 val:1 I might mean either: you are taking my suggestion too seriously, it is merely a suggestion of one way in which this could happen. Another way is ordinary memory corruption (whether by software error or by flipped DRAM bits) of a page table: that could end up here too. Hugh