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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 0DD0BC010CF for ; Tue, 5 Nov 2019 12:29:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ADDD8206B8 for ; Tue, 5 Nov 2019 12:29:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADDD8206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 12EFB6B0003; Tue, 5 Nov 2019 07:29:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B9376B0006; Tue, 5 Nov 2019 07:29:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE9466B0007; Tue, 5 Nov 2019 07:29:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0020.hostedemail.com [216.40.44.20]) by kanga.kvack.org (Postfix) with ESMTP id D4F966B0003 for ; Tue, 5 Nov 2019 07:29:09 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 8A96C8249980 for ; Tue, 5 Nov 2019 12:29:09 +0000 (UTC) X-FDA: 76122153618.04.pies83_89db6a8750837 X-HE-Tag: pies83_89db6a8750837 X-Filterd-Recvd-Size: 2523 Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 12:29:07 +0000 (UTC) Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id B771A79E079BB0850879; Tue, 5 Nov 2019 20:28:59 +0800 (CST) Received: from [127.0.0.1] (10.133.219.218) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Tue, 5 Nov 2019 20:28:58 +0800 Message-ID: <5DC16B0A.6070605@huawei.com> Date: Tue, 5 Nov 2019 20:28:58 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Michal Hocko CC: , , , Subject: Re: [PATCH v3] mm: fix trying to reclaim unevictable lru page when calling madvise_pageout References: <1572616245-18946-1-git-send-email-zhongjiang@huawei.com> <20191101183220.GC29196@dhcp22.suse.cz> <5DBD3217.4070403@huawei.com> <20191105063353.GE22672@dhcp22.suse.cz> In-Reply-To: <20191105063353.GE22672@dhcp22.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.133.219.218] X-CFilter-Loop: Reflected 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 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 :-\ .