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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 59014C43331 for ; Thu, 2 Apr 2020 23:37:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 01A9A2077D for ; Thu, 2 Apr 2020 23:37:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01A9A2077D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 73B6B8E0008; Thu, 2 Apr 2020 19:37:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6EC2E8E0007; Thu, 2 Apr 2020 19:37:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 602958E0008; Thu, 2 Apr 2020 19:37:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id 488028E0007 for ; Thu, 2 Apr 2020 19:37:24 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0226A180AD817 for ; Thu, 2 Apr 2020 23:37:24 +0000 (UTC) X-FDA: 76664528808.26.spot44_5d9d00a28bb61 X-HE-Tag: spot44_5d9d00a28bb61 X-Filterd-Recvd-Size: 3206 Received: from out4436.biz.mail.alibaba.com (out4436.biz.mail.alibaba.com [47.88.44.36]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 23:37:22 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R521e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07488;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TuS8nQo_1585870627; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TuS8nQo_1585870627) by smtp.aliyun-inc.com(127.0.0.1); Fri, 03 Apr 2020 07:37:09 +0800 Subject: Re: [PATCH] mm: thp: don't need drain lru cache when splitting and mlocking THP To: Daniel Jordan Cc: kirill.shutemov@linux.intel.com, hughd@google.com, aarcange@redhat.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1585337380-97368-1-git-send-email-yang.shi@linux.alibaba.com> <20200402230411.7ckwkmd6wwtqfkm2@ca-dmjordan1.us.oracle.com> <20200402231731.32imzorzucpj4s6w@ca-dmjordan1.us.oracle.com> From: Yang Shi Message-ID: Date: Thu, 2 Apr 2020 16:37:06 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20200402231731.32imzorzucpj4s6w@ca-dmjordan1.us.oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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 4/2/20 4:17 PM, Daniel Jordan wrote: > On Thu, Apr 02, 2020 at 07:04:11PM -0400, Daniel Jordan wrote: >> On Sat, Mar 28, 2020 at 03:29:40AM +0800, Yang Shi wrote: >>> Since the commit 8f182270dfec ("mm/swap.c: flush lru pvecs on compound >>> page arrival") THP would not stay in pagevec anymore. So the >>> optimization made by commit d965432234db ("thp: increase >>> split_huge_page() success rate") doesn't make sense anymore, which tries >>> to unpin munlocked THPs from pagevec by draining pagevec. >>> >>> And draining lru cache before isolating THP in mlock path is unnecessary >>> either. >> Can we get some of that nice history in this part too? >> >> Draining lru cache before isolating THP in mlock path is also unnecessary. >> b676b293fb48 ("mm, thp: fix mapped pages avoiding unevictable list on mlock") >> added it and 9a73f61bdb8a ("thp, mlock: do not mlock PTE-mapped file huge >> pages") accidentally carried it over after the above optimization went in. >> >>> Cc: Kirill A. Shutemov >>> Cc: Hugh Dickins >>> Cc: Andrea Arcangeli >>> Signed-off-by: Yang Shi >> Since we don't mlock pte-mapped THP, it seems these huge pages wouldn't ever be >> in the pagevecs if I'm understanding it all. > Actually pte-mapped THP doesn't matter for this, both paths always drain when > they're working with pmd-mapped THP. Actually either pte-mapped or pmd-mapped doesn't matter, as long as it is compound page the lru cache would be flushed immediately upon the arrival of the compound page.