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=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, FSL_HELO_FAKE,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 85784CA9EC7 for ; Wed, 30 Oct 2019 18:42:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 486C720856 for ; Wed, 30 Oct 2019 18:42:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lb5xCFfo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 486C720856 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 DD7F06B0005; Wed, 30 Oct 2019 14:42:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D876E6B0007; Wed, 30 Oct 2019 14:42:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9D286B0008; Wed, 30 Oct 2019 14:42:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0123.hostedemail.com [216.40.44.123]) by kanga.kvack.org (Postfix) with ESMTP id A9DF86B0005 for ; Wed, 30 Oct 2019 14:42:15 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 3D28F1803A183 for ; Wed, 30 Oct 2019 18:42:15 +0000 (UTC) X-FDA: 76101321030.26.elbow07_8803d2b416618 X-HE-Tag: elbow07_8803d2b416618 X-Filterd-Recvd-Size: 5642 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Oct 2019 18:42:14 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id v19so2196260pfm.3 for ; Wed, 30 Oct 2019 11:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oGLSEI0vXWtWZcd/C/pKmpauR4rn8KbFvSauqoiXCVQ=; b=lb5xCFfovMLlTgd365Gh1FcK55SjFmjb2O980EceNrG7eY3RYyDRnvQihegG0jfLR9 WBWwu4tLhgweH5UVKZMBD2DjhH7xGV/7DnRESTItxORH+IE670bohbbQPrVVRBlPNEIE uZeu0S71r/5XUsMCjms40u4+9Nr1xR/lIq7pNbYocx79JGw5cB+CigOE9AnbnKB8ym/d GrwRE5kI2kZzNXrV3CMM+jN/Ay8/5PRmVjUrQGDanHrQAUNsuM9YrD2XMk06Pw4gdLue 4jADnFkRZp7mHmYtchLvvbu3p037lA920mCP+3YzL0VHfhM67ZSgJqQ+zNOBGNeVCzea lj3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=oGLSEI0vXWtWZcd/C/pKmpauR4rn8KbFvSauqoiXCVQ=; b=GhVg8vrQZPSdGVI9MIq17Z2rzAo0l+vD8ymrm9qE0bvJJXn+bo6Vv+wKo7t0mNEbSi 4jFbBJFZWq5qp7GPR0EyBQRhWYVpHenmi99nkfkGZBtnSvF2Yj1BQVPugQr5ICiHe4Pr jDX8EQ8sz2J1LdUYJJAopKnnyEz+lNYXkNm4N+NxMEgJ2EEHOKjkPx5W+BSU5MN1pu41 s7ChzxBurv8F6Alc6UEozToMw2Aw6bNXiluDyQDSRlfnwXmwVwMCNUHRkjspQA3BCuKo wslFLvzf9qdy91zcOiCAbQj4GQsmvpGcL2oKvKpR01jaJKzh8rjUxrzciK6eBGRdnUHz OK1Q== X-Gm-Message-State: APjAAAUS2z59RUcYynub66eU2Xfa8q7QLUZW0CmdTssE0A8c5DRtMXbP YYJIs6R0RIxSh/yOcT29YXC22Kd0 X-Google-Smtp-Source: APXvYqwJt0f/IMC20GAIjpKnSW1C9DHsPz9AySbwf/yPIli6RZiXDIO3XBKlRxxIULzO7dosJIJGkg== X-Received: by 2002:a63:3f8e:: with SMTP id m136mr965783pga.213.1572460933362; Wed, 30 Oct 2019 11:42:13 -0700 (PDT) Received: from google.com ([2620:15c:211:1:3e01:2939:5992:52da]) by smtp.gmail.com with ESMTPSA id s12sm664292pgf.36.2019.10.30.11.42.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 11:42:12 -0700 (PDT) Date: Wed, 30 Oct 2019 11:42:10 -0700 From: Minchan Kim To: Michal Hocko Cc: zhong jiang , akpm@linux-foundation.org, hannes@cmpxchg.org, ktkhai@virtuozzo.com, linux-mm@kvack.org Subject: Re: [PATCH] mm: fix unevictable page reclaim when calling madvise_pageout Message-ID: <20191030184210.GB57267@google.com> References: <1572275317-63910-1-git-send-email-zhongjiang@huawei.com> <20191029081102.GB31513@dhcp22.suse.cz> <5DB806D1.8020503@huawei.com> <20191029094039.GH31513@dhcp22.suse.cz> <5DB81838.6020208@huawei.com> <20191030165239.GA167773@google.com> <20191030174533.GL31513@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191030174533.GL31513@dhcp22.suse.cz> 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 Wed, Oct 30, 2019 at 06:45:33PM +0100, Michal Hocko wrote: > On Wed 30-10-19 09:52:39, Minchan Kim wrote: > > On Tue, Oct 29, 2019 at 06:45:12PM +0800, zhong jiang wrote: > > > On 2019/10/29 17:40, Michal Hocko wrote: > > > > On Tue 29-10-19 17:30:57, zhong jiang wrote: > > > >> On 2019/10/29 16:11, Michal Hocko wrote: > > > >>> [Cc Minchan] > > > > [...] > > > >>> Removing a long existing BUG_ON begs for a much better explanation. > > > >>> shrink_page_list is not a trivial piece of code but I _suspect_ that > > > >>> removing it should be ok for mapped pages at least (try_to_unmap) but I > > > >>> am not so sure how unmapped unevictable pages are handled from top of my > > > >>> head. > > > >> As to the unmapped unevictable pages. shrink_page_list has taken that into account. > > > >> > > > >> shinkr_page_list > > > >> page_evictable --> will filter the unevictable pages to putback its lru. > > > > Ohh, it is right there at the top. Missed it. The check has been added > > > > by Nick along with the BUG_ON. So it is sounds more like a "this > > > > shouldn't happen" bugon. I wouldn't mind to remove it with that > > > > justification. > > > As you has said, Minchan fix the same kind of bug by checking PageUnevictable (I did not notice before) > > > Wait for Minchan to see whether he has better reason. thanks, > > > > madvise_pageout could work with a shared page and one of the vmas among processes > > could do mlock so it could pass Unevictable LRU pages into shrink_page_list. > > It's pointless to try reclaim unevictable pages from the beginning so I want to fix > > madvise_pageout via introducing only_evictable flag into the API so that > > madvise_pageout uses it as "true". > > > > If we want to remove the PageUnevictable VM_BUG_ON_PAGE in shrink_page_list, > > I want to see more strong reason why it happens and why caller couldn't > > filter them out from the beginning. > > Why is this preferable over removing the VM_BUG_ON condition? In other > words why should we keep PageUnevictable check there? I don't think it's reasonable to pass unevictalbe LRU pages into shrink_page_list so wanted to know what race is here what we are missing to remove the BUG_ON since mlock is heavily complicated. > > -- > Michal Hocko > SUSE Labs