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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 7BDF3CA9EC7 for ; Tue, 5 Nov 2019 06:33:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 543492084D for ; Tue, 5 Nov 2019 06:33:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 543492084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DF92A6B0003; Tue, 5 Nov 2019 01:33:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DAA786B0006; Tue, 5 Nov 2019 01:33:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBF126B0007; Tue, 5 Nov 2019 01:33:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id B40AA6B0003 for ; Tue, 5 Nov 2019 01:33:57 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 5EBA68249980 for ; Tue, 5 Nov 2019 06:33:57 +0000 (UTC) X-FDA: 76121258514.14.metal49_5cb05a3f3a612 X-HE-Tag: metal49_5cb05a3f3a612 X-Filterd-Recvd-Size: 2073 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 06:33:56 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D703DAD88; Tue, 5 Nov 2019 06:33:54 +0000 (UTC) Date: Tue, 5 Nov 2019 07:33:53 +0100 From: Michal Hocko To: zhong jiang Cc: akpm@linux-foundation.org, minchan@kernel.org, hannes@cmpxchg.org, linux-mm@kvack.org Subject: Re: [PATCH v3] mm: fix trying to reclaim unevictable lru page when calling madvise_pageout Message-ID: <20191105063353.GE22672@dhcp22.suse.cz> References: <1572616245-18946-1-git-send-email-zhongjiang@huawei.com> <20191101183220.GC29196@dhcp22.suse.cz> <5DBD3217.4070403@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5DBD3217.4070403@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Sat 02-11-19 15:36:55, zhong jiang wrote: > On 2019/11/2 2:32, Michal Hocko wrote: [...] > > But I would really appreciate to add a comment for the BUG_ON and > > explain why do we care about PageUnevictable so much when there is an > > explicit page_evictable check in the reclaim path. In other words a > > short summary of what Johannes explained in > > http://lkml.kernel.org/r/20191030193307.GA48128@cmpxchg.org. Maybe in a > > separate patch. Care to send one or should I send it? > Hi, Michal > > Actually, I am not very clear about the words Johannes had said. How the race to > tirgger, it will result in an PgeMlocked page can be visible in shrink_page_list. > > Could you elaborate the race in detail further ? I would go with the following comment /* * Page reclaim can see !page_evictable(), but it must not see pages that * have the PageUnevictable lru bit already set. See __pagevec_lru_add_fn() * for more details. */ -- Michal Hocko SUSE Labs