Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2160772pxb; Tue, 12 Oct 2021 00:05:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9l52diZoFNvH92K3urGXHB+DJFGqIQ/TlcJ1fOdQKepM0upgtLnP1qmRhxcfOHQZkI73e X-Received: by 2002:a63:390:: with SMTP id 138mr21486841pgd.37.1634022351881; Tue, 12 Oct 2021 00:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634022351; cv=none; d=google.com; s=arc-20160816; b=QmR2ee5O+9yIXt7le4De0ytgQ+jvjYaaeHh5hubngwU8GCauPPjPQ3Kp19PbvL8oI+ 77dTB4PGux/4LJHvI6MWxyGcRS3gqfKW6f/wu4SgLYM1ZwdpZ5TH0k43n1vscYA/obsK g5hElNhvcld1b110tZ+IFp+PAbwr/aTu491MVvdK5eot3HzCE6sP+9glTuPV7ldvW6H4 oWFoY6cJgPIbboXsIWZA0G24E7QkRrdEKS/9c1Ym67oUwGRge/gD7thvcdVnihVjRaDs hkgVvCcjd7v0QhxD0ZdZTYYos0wVW13jwy6R3NKvn+Af1/MHt0EX3WPy2kmkRA4s4ld3 SarA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=NHJKYaK/+WH04YdCCzvjWRlJZJy2FAMHum/4QpP7xu8=; b=EfxDh8clSz0zdVPPKjmbkpRXQM5h++/46RavrAnMwVOmapr+YrNlhLZXTmyyMDEEjF zDLef5oNrhum0y0BB7k4LeBhVZNhMnljhY9f9MbcT/5a+s3+K3LLKoZ3EcbyD8F1r583 8MXCY0SpyXzvj++4DwyQ81iobfkUPOYzMgMaAIHKFXdxpAUMIiM/d7z30fLdjOAn/nR3 lfpBy4WB5/nZUje91NOJClOEoSWHjRMOWHcCCAgHd7cNbaBRVjhtLqwFC+5+gwMsUyak d1pZpR556FpktBxpkZt0TtX5ePjMi6DWbtzS1NFu7iY8dnBNO7GShNu2tzNuwx4+HwSO EifA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h2si14277635plf.219.2021.10.12.00.05.37; Tue, 12 Oct 2021 00:05:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233568AbhJLHG3 (ORCPT + 99 others); Tue, 12 Oct 2021 03:06:29 -0400 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:42925 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233194AbhJLHG1 (ORCPT ); Tue, 12 Oct 2021 03:06:27 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >