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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E31F4C25B7E for ; Sun, 2 Jun 2024 04:15:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D10C6B009A; Sun, 2 Jun 2024 00:15:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 691F06B009E; Sun, 2 Jun 2024 00:15:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 56F4B6B00A0; Sun, 2 Jun 2024 00:15:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3A8856B009A for ; Sun, 2 Jun 2024 00:15:51 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DB146A1349 for ; Sun, 2 Jun 2024 04:15:50 +0000 (UTC) X-FDA: 82184635260.13.FDFAC1F Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf19.hostedemail.com (Postfix) with ESMTP id F29A41A0009 for ; Sun, 2 Jun 2024 04:15:47 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=TSsMipuv; spf=pass (imf19.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717301749; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=H/RSLeYXVTSGVuTsSLN6zoli4sMA0dh6fPFicS8Jvbs=; b=2oHyh0OFj2OtAwg+qLUdSCeIUJE4TmSpxV2PEeDMXHlEi+JndXznxmeCYPj0G+1bAgxcnK 3n4aTNiSdEczujXR3YOHFnSFhAa/rYZ4qAqX+wjww/9WBGYdGS16AM77WZPgnEDndxR0Bm 9bvK8hkXVSLRaYQOAu+CqWs7YO5kn3w= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717301749; a=rsa-sha256; cv=none; b=Q+lgj/EMaFGVPQjtaYNXWUjobTdChXhSa8zTh9oPYGVpLd1Qwufpuuvtwtt6fu4QvJyLxO uD91l0F/ED/Ii0J0nuUzOPAyqeDAKSWLlR9ybqVI2W15EH2Dcbl2VgPsj2amp+8wPDlUJx aRTJYI0I6pxUBZZwq3cVW/TK5f0D7Uw= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=TSsMipuv; spf=pass (imf19.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1717301743; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=H/RSLeYXVTSGVuTsSLN6zoli4sMA0dh6fPFicS8Jvbs=; b=TSsMipuvMLDDvz9m6R1SwzusmaZ3bKkcp8uXLY3PdcQlvG5beL458cQgvTBfdwExfriVNaeGmuto7yzKVNaxNU7kUa7l6DEzhfFVqFwA0NglJekebHsEa8xq4ac6W5Wv7wLg480ugAir/sKfWWAinX++bzty16xZHHjkvM/AYuQ= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R781e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067113;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0W7do2aB_1717301741; Received: from 192.168.0.106(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W7do2aB_1717301741) by smtp.aliyun-inc.com; Sun, 02 Jun 2024 12:15:42 +0800 Message-ID: Date: Sun, 2 Jun 2024 12:15:40 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/6] add mTHP support for anonymous shmem To: David Hildenbrand , akpm@linux-foundation.org, hughd@google.com Cc: willy@infradead.org, wangkefeng.wang@huawei.com, ying.huang@intel.com, 21cnbao@gmail.com, ryan.roberts@arm.com, shy828301@gmail.com, ziy@nvidia.com, ioworker0@gmail.com, da.gomez@samsung.com, p.raghav@samsung.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <502fb3df-b42b-4f0c-a98d-348c3d544721@redhat.com> From: Baolin Wang In-Reply-To: <502fb3df-b42b-4f0c-a98d-348c3d544721@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspam-User: X-Stat-Signature: 9tms1uhdbhc9umwowzcucaqbtsra5jba X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: F29A41A0009 X-HE-Tag: 1717301747-867019 X-HE-Meta: U2FsdGVkX18ZGTcpFbt43prafZL/DLCM+tQSoWgMGMr2de2NrSsvDVDH0lGgEchXbaDQ1DAT12LV7GX35H7aQwIYdViMdZOylfQvLTNVMs9F98q9WLsy0sfPsSKozUZL84+t3JYeN7ybNpW6qcq0s7aO+WpfwWHoAV8GcfZfWbaVY4Ltyg05dKsu9xZt0hetcG2m/7Vwwpe1O9H7+TwLSDAGNNPBuPPUu5HHgxh+OEV4ZLbPlHp+tnFpcjq1kD7IxT+EdN/0mgLYf7BGROLmWQdvSRl7fE+4PEFhZ0In2OahwLbFQh2ZGMnjMLwH2u18ettjy6zobGoQvFjuzjB0wgrgpH4OdKogDz0kZGnGYRgIcjidQ4JXz5ITGyqO9bi7lzQI2hzR3XIQRKLxCBzF39TxWEPixfJ4KzwFPJYbhkkhnnuXWWlUh2puM1xMMb5Rt6+BIxDVYee1I697nwzwzArtNB///fl2o7uUAbdUf7+gXhYlJaoESfOl//Yi9/Ei6J4nRX4EAWSRu9QpENktb+p3dvnkPLiip3wjTXgnWc37QjB6zR0iOavlbupy+ewnIPEeh1Go3Mpfs/ULqtWxLGAeynI5Cx4rVOylyCE2+SEan2h8aObGJQSpBvFtXOv/yOL+jI1m9m5+Hxo9nmiWy8Qd/ScyWfA9TAVGWTiZeuZwv3yyohcKeqFwUJclveFO64cPBxIPBgH5ZegpGBwF2ZBy14kubv3mZRmLJCdgyQdSuaOU57ATWc4RhGhWxtuWuZRpu0atNGUnskv034eO5Z1EZqaAhTbww0A8tquPMGPVntrp7O7H4a0fTFnOTtM23R+n7QvNAeuxKlEozhedJ+JeZS5moUBmq/1EBOZg0OwYgpc/XujxGDE+T6fZKDIqn9w3H1bYmNeecJrCp7gDCE86qCnzfj7W00qopGCtZXuLqPb3Fnbhmxvp2XHs4CCFEQ6bU5GunLiWN30Z0VN fa3lZqFW RcUQ6FmbNooFYBj7eLLHJE7Hlr2kjbsD1rkKQxfvp8mrSeC6kfOTH2nk9iy3mVxvOC+BPRBvDJsBSGZAfl52/zllnBCANUt05U0yk+YY7ujSJY1QaMq2OjrTWQE7zIFrm7QnBB1EbYqMLi4apPRgROVlvTtXTehfybigkG+FcOHXRLexZGfsUg7eKoTzj0Grkfno255+0h4u7KyzCqhflMqqR6LHwooRBiGdLN+APVTPzYa23UeAvyJZTFB4K0UoysLM8VdLULXLeev8= 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: List-Subscribe: List-Unsubscribe: On 2024/5/31 19:13, David Hildenbrand wrote: >>> >>> As a default, we should not be using large folios / mTHP for any shmem, >>> just like we did with THP via shmem_enabled. This is what this series >>> currently does, and is aprt of the whole mTHP user-space interface >>> design. >>> >>> Further, the mTHP controls should control all of shmem, not only >>> "anonymous shmem". >> >> Yes, that's what I thought and in my TODO list. > > Good, it would be helpful to coordinate with Daniel and Pankaj. > >> >>> >>> Also, we should properly fallback within the configured sizes, and not >>> jump "over" configured sizes. Unless there is a good reason. >>> >>> (3) khugepaged >>> >>> khugepaged needs to handle larger folios properly as well. Until fixed, >>> using smaller THP sizes as fallback might prohibit collapsing a >>> PMD-sized THP later. But really, khugepaged needs to be fixed to handle >>> that. > >>> (4) force/disable >>> >>> These settings are rather testing artifacts from the old ages. We should >>> not add them to the per-size toggles. We might "inherit" it from the >>> global one, though. >> >> Sorry, I missed this. So I thould remove the 'force' and 'deny' option >> for each mTHP, right? > > Yes, that's my understanding. But we have to keep them on the top level > for any possible user out there. OK. >>> >>> "within_size" might have value, and especially for consistency, we >>> should have them per size. >>> >>> >>> >>> So, this series only tackles anonymous shmem, which is a good starting >>> point. Ideally, we'd get support for other shmem (especially during >>> fault time) soon afterwards, because we won't be adding separate toggles >>> for that from the interface POV, and having inconsistent behavior >>> between kernel versions would be a bit unfortunate. >>> >>> >>> @Baolin, this series likely does not consider (4) yet. And I suggest we >>> have to take a lot of the "anonymous thp" terminology out of this >>> series, especially when it comes to documentation. >> >> Sure. I will remove the "anonymous thp" terminology from the >> documentation, but want to still keep it in the commit message, cause I >> want to start from the anonymous shmem. > > For commit message and friends makes sense. The story should be > "controls all of shmem/tmpfs, but support will be added iteratively. The > first step is anonymous shmem." Sure. Thanks.