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=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,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 46B95C4741F for ; Fri, 30 Oct 2020 14:55:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8BD112076E for ; Fri, 30 Oct 2020 14:55:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BD112076E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BADD56B0036; Fri, 30 Oct 2020 10:55:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B36D06B005C; Fri, 30 Oct 2020 10:55:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FE166B0075; Fri, 30 Oct 2020 10:55:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 6DC546B0036 for ; Fri, 30 Oct 2020 10:55:48 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0489534A3 for ; Fri, 30 Oct 2020 14:55:48 +0000 (UTC) X-FDA: 77428891176.09.mass39_260b11c27296 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id D9386180AD806 for ; Fri, 30 Oct 2020 14:55:47 +0000 (UTC) X-HE-Tag: mass39_260b11c27296 X-Filterd-Recvd-Size: 3134 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Fri, 30 Oct 2020 14:55:47 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 035CCAC12; Fri, 30 Oct 2020 14:55:46 +0000 (UTC) Subject: Re: [PATCH] mm/compaction: count pages and stop correctly during page isolation. To: Michal Hocko , Zi Yan Cc: Andrew Morton , linux-mm@kvack.org, Rik van Riel , linux-kernel@vger.kernel.org References: <20201029200435.3386066-1-zi.yan@sent.com> <20201030094308.GG1478@dhcp22.suse.cz> <6CAAB1FC-2B41-490B-A67A-93063629C19B@nvidia.com> <20201030133625.GJ1478@dhcp22.suse.cz> <400B3460-65C0-4C48-A7EA-1A9F5780EC9C@nvidia.com> <20201030144917.GK1478@dhcp22.suse.cz> From: Vlastimil Babka Message-ID: Date: Fri, 30 Oct 2020 15:55:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3 MIME-Version: 1.0 In-Reply-To: <20201030144917.GK1478@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000025, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 10/30/20 3:49 PM, Michal Hocko wrote: > On Fri 30-10-20 10:35:43, Zi Yan wrote: >> On 30 Oct 2020, at 9:36, Michal Hocko wrote: >> >> > On Fri 30-10-20 08:20:50, Zi Yan wrote: >> >> On 30 Oct 2020, at 5:43, Michal Hocko wrote: >> >> >> >>> [Cc Vlastimil] >> >>> >> >>> On Thu 29-10-20 16:04:35, Zi Yan wrote: >> >>> >> >>> Does thp_nr_pages work for __PageMovable pages? >> >> >> >> Yes. It is the same as compound_nr() but compiled >> >> to 1 when THP is not enabled. >> > >> > I am sorry but I do not follow. First of all the implementation of the >> > two is different and also I was asking about __PageMovable which should >> > never be THP IIRC. Can they be compound though? >> >> __PageMovable, non-lru movable pages, can be compound and thp_nr_page cannot >> be used for it, since when THP is off, thp_nr_page will return the wrong number. >> I got confused by its name, sorry. > > OK, this matches my understanding. Good we are on the same page. > >> But __PageMovable is irrelevant to this patch, since we are using >> __isolate_lru_page to isolate pages. non-lru __PageMovable should not appear >> after isolate_succes. thp_nr_pages can be used here. > > But this is still not clear to me. __PageMovable pages are isolated by > isolate_movable_page and then jump to isolate_succes. Does that somehow > changes the nature of the page being compound or tat thp_nr_page would > start working on those pages. Agreed that page movable can appear after isolate_success. compound_nr() should work for both. Note that too_many_isolated() doesn't see __PageMovable isolated pages, as they are not counted as NR_ISOLATED_FILE/NR_ISOLATED_ANON, AFAIK. So in that sense they are irrelevant to the bug at hand... for now.