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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F4D4C433EF for ; Tue, 12 Oct 2021 07:04:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 20B5361078 for ; Tue, 12 Oct 2021 07:04:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 20B5361078 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=kvack.org Received: by kanga.kvack.org (Postfix) id 8A2B36B006C; Tue, 12 Oct 2021 03:04:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8530E900002; Tue, 12 Oct 2021 03:04:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 768236B0073; Tue, 12 Oct 2021 03:04:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 68AB16B006C for ; Tue, 12 Oct 2021 03:04:28 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2998D31E61 for ; Tue, 12 Oct 2021 07:04:28 +0000 (UTC) X-FDA: 78686897016.25.3255A7F Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf05.hostedemail.com (Postfix) with ESMTP id CEA4D507E8D4 for ; Tue, 12 Oct 2021 07:04:26 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=rongwei.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0UrYOY-L_1634022262; Received: from 30.240.98.196(mailfrom:rongwei.wang@linux.alibaba.com fp:SMTPD_---0UrYOY-L_1634022262) by smtp.aliyun-inc.com(127.0.0.1); Tue, 12 Oct 2021 15:04:23 +0800 Message-ID: <48159eb1-61f7-09df-9bea-5933a283f972@linux.alibaba.com> Date: Tue, 12 Oct 2021 15:04:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:93.0) Gecko/20100101 Thunderbird/93.0 Subject: Re: [PATCH 0/3] mm, thp: introduce a new sysfs interface to facilitate file THP for .text Content-Language: en-US To: Matthew Wilcox , Christoph Hellwig Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, song@kernel.org, william.kucharski@oracle.com, hughd@google.com, shy828301@gmail.com, linmiaohe@huawei.com, peterx@redhat.com References: <20211009092658.59665-1-rongwei.wang@linux.alibaba.com> From: Rongwei Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CEA4D507E8D4 X-Stat-Signature: kno896ffb9bjqhekb7w8wrkwh5cpepj5 Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf05.hostedemail.com: domain of rongwei.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=rongwei.wang@linux.alibaba.com X-HE-Tag: 1634022266-167895 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 10/12/21 9:50 AM, Matthew Wilcox wrote: > On Mon, Oct 11, 2021 at 09:06:37AM +0100, Christoph Hellwig wrote: >> Can we please just get proper pagecache THP (through folios) merged >> instead of piling hacks over hacks here? The whole readonly THP already >> was more than painful enough due to all the hacks involved. > > This was my initial reaction too. > > But read the patches. They're nothing to do with the implementation of > THP / folios in the page cache. They're all to make sure that mappings > are PMD aligned. Hi, Matthew In fact, we had thought about realizing this by handling page cache directly. And then, we found that we just need to align the mapping address and make khugepaged can scan these 'mm_struct' base on READ_ONLY_THP_FOR_FS. > > I think there's a lot to criticise in the patches (eg, a system-wide > setting is probably a bad idea. and a lot of this stuff seems to At the beginning, we don't introduce the new sysfs interface, just re-use 'transparent_hugepage/enabled'. But In some production system, they disable the THP directly, especially those applications that are sensitive to THP. So, Considering these scenarios, we had to design a new sysfs interface ('transparent_hugepage/hugetext_enabled'). And if you have other idea, we are willing to take to improve these patches. Thanks! > be fixing userspace bugs in the kernel). But let's criticise what's > actually in the patches, because these are problems that exist regardless > of RO_THP vs folios. >