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 1B7D4C17460 for ; Tue, 5 Nov 2019 14:11:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BE33C21D6C for ; Tue, 5 Nov 2019 14:11:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE33C21D6C 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 3C98C6B0003; Tue, 5 Nov 2019 09:10:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 379F36B0006; Tue, 5 Nov 2019 09:10:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B73D6B0007; Tue, 5 Nov 2019 09:10:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id 1599D6B0003 for ; Tue, 5 Nov 2019 09:10:59 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id D8B61180AD830 for ; Tue, 5 Nov 2019 14:10:58 +0000 (UTC) X-FDA: 76122410196.09.gun84_817592b78057 X-HE-Tag: gun84_817592b78057 X-Filterd-Recvd-Size: 2927 Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 14:10:55 +0000 (UTC) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4FECBFF0A0B6A4FEE6C7; Tue, 5 Nov 2019 22:10:43 +0800 (CST) Received: from [127.0.0.1] (10.133.219.218) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Tue, 5 Nov 2019 22:10:38 +0800 Message-ID: <5DC182DD.5010304@huawei.com> Date: Tue, 5 Nov 2019 22:10:37 +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> <5DC16B0A.6070605@huawei.com> <20191105124549.GN22672@dhcp22.suse.cz> In-Reply-To: <20191105124549.GN22672@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 20:45, Michal Hocko wrote: > 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? page reclaim can see !page_evictable() means some race still exist in the kernel. Is there any race window . PageLocked will prevent the cases in shmem ?