Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2257230ybb; Thu, 2 Apr 2020 16:39:34 -0700 (PDT) X-Google-Smtp-Source: APiQypI/3KYmWmdDzmfJS3HiVgVlZyk3H47+X2FnFSBkUXFuEqPSuM8oi3ymJJrDE8l3JJ+UKsUz X-Received: by 2002:a9d:4e3:: with SMTP id 90mr4545552otm.261.1585870774222; Thu, 02 Apr 2020 16:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585870774; cv=none; d=google.com; s=arc-20160816; b=kSZH7h9FtwqNEnW7W/N6McVBCVZmZyhjjzfEHv8QkLA/OLFw5QkOs+p43nI/UT8WNL G3sVxETCLxs/iGO70QVJYuvVpSuP7ODgr8yhzMXd7yo/KwtnO6OTZceETLXo3ULD8cCF LgS1h7H+VSZC2xBZ//D+CC5gNCMF5IDb3KKnFiiB5Pn4tjSeviqCx12JHWAUsuUoNj+v QnDuN4L6Q+dtlei5Kk7ah/cr2lPoQo0HuOj/Te133pc6QU3xAi2H31IRCaII8YkKCtdi RWcXRdR0VDfZzdqi8NAg7LKCF2bLo+3I3NtHf4x0MHrLudlNLHcOdpz+RsIaaKL+Q+3W jfeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=V2VAdd73pfIRk9bHlrMlQMtpQtbbj0V3JOCnvVt69Yc=; b=E9nAcVGnUf1wG0szby7jTc6PQDzMX+gaECi1wJ4OnnLyJHcFszo5hoelVkzEN3F1HA suwWz2XwpXlKuG5gDQkfAVtzmHw/559fhVlesgzItBE17lKRqF5B3HOUVOXZM85VuiV8 npB3vZKx59hB7noyo87s/zLBuMuWLR3A3ZFfbTNKdlEj27VZXRHDqD+lxrPbe+e/06vq qhaeJbJSyK/AeYkklE7zlcYfANOIGoWc1pFr2P8TnSibjx3TiOD6bVyXe+0orRROJna8 crlIiBYpRO8W9WgrpTdbqZU25DfqtYJM9w8bHl/NHTSTVtu4M3g0ZB1NR123X+wyzB1d 7sfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t132si2867024oih.173.2020.04.02.16.39.20; Thu, 02 Apr 2020 16:39:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390246AbgDBXhN (ORCPT + 99 others); Thu, 2 Apr 2020 19:37:13 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:46011 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390227AbgDBXhM (ORCPT ); Thu, 2 Apr 2020 19:37:12 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.