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 ED7E1C17466 for ; Tue, 5 Nov 2019 12:45:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C5C3521D7D for ; Tue, 5 Nov 2019 12:45:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5C3521D7D 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 394B46B0003; Tue, 5 Nov 2019 07:45:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3441F6B0006; Tue, 5 Nov 2019 07:45:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25AE36B0007; Tue, 5 Nov 2019 07:45:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 11A6E6B0003 for ; Tue, 5 Nov 2019 07:45:53 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id D3F561EFD for ; Tue, 5 Nov 2019 12:45:52 +0000 (UTC) X-FDA: 76122195744.02.tax67_8a9cf38012f1a X-HE-Tag: tax67_8a9cf38012f1a X-Filterd-Recvd-Size: 2441 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 12:45:52 +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 D43D5ADFE; Tue, 5 Nov 2019 12:45:50 +0000 (UTC) Date: Tue, 5 Nov 2019 13:45:49 +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: <20191105124549.GN22672@dhcp22.suse.cz> References: <1572616245-18946-1-git-send-email-zhongjiang@huawei.com> <20191101183220.GC29196@dhcp22.suse.cz> <5DBD3217.4070403@huawei.com> <20191105063353.GE22672@dhcp22.suse.cz> <5DC16B0A.6070605@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5DC16B0A.6070605@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 Tue 05-11-19 20:28:58, zhong jiang wrote: > On 2019/11/5 14:33, Michal Hocko wrote: > > 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. > > */ > But the detail still confuses me in __pagevec_lru_add_fn() to see PageMlocked in vmscan :-\ . Which part does confuse you exactly? -- Michal Hocko SUSE Labs