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 16B84C30658 for ; Fri, 5 Jul 2024 09:23:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8ADC56B009A; Fri, 5 Jul 2024 05:23:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 836B06B009B; Fri, 5 Jul 2024 05:23:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D6BE6B00A1; Fri, 5 Jul 2024 05:23:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4F4AC6B009A for ; Fri, 5 Jul 2024 05:23:44 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id EC78C417B5 for ; Fri, 5 Jul 2024 09:23:43 +0000 (UTC) X-FDA: 82305161526.29.442D49B Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf10.hostedemail.com (Postfix) with ESMTP id D0636C0005 for ; Fri, 5 Jul 2024 09:23:41 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720171409; 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; bh=PF661dOMkqzOlRP37cCRbYhCMpVC7f4sJKcEu4MdGlY=; b=Wh9qf1kVHCr3HVa7135iHv5K1ZO+KffMgraTtiFvR2S4w5mPRd4bWCw/Voyy6pb1B2FO4R nD65vjmIb503rx/ZK6q1BfxVFk+VFASPtWOj0KIskAoOuZ8CCp1TAmf0LR3gMk7VIYEwvt 77vDLdLxT62jLthmol9SHiTt7qTDWQE= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720171409; a=rsa-sha256; cv=none; b=4FSCSw4BpA3iRs1xRJA6onAMZuuSmVMOpb6JrAn9HRN9befxvT6LopgApuWk+gOoWROPoa 155qFlj9iDnXBZty7klhMAhBNLfDnJacCAYGn7u0HoeHCoe3zAsDpzgyAv38Fe7KUhorpB dLXM9XYHgCuFagqOxN5DwWxZWpbD/JI= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B266367; Fri, 5 Jul 2024 02:24:06 -0700 (PDT) Received: from [10.57.74.223] (unknown [10.57.74.223]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BCEA23F762; Fri, 5 Jul 2024 02:23:38 -0700 (PDT) Message-ID: <16ef3751-1837-4485-bf9b-33b0e709528f@arm.com> Date: Fri, 5 Jul 2024 10:23:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 0/6] add mTHP support for anonymous shmem Content-Language: en-GB To: David Hildenbrand , Baolin Wang , Matthew Wilcox Cc: akpm@linux-foundation.org, hughd@google.com, wangkefeng.wang@huawei.com, ying.huang@intel.com, 21cnbao@gmail.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: <27beaa0e-697e-4e30-9ac6-5de22228aec1@redhat.com> <6d4c0191-18a9-4c8f-8814-d4775557383e@redhat.com> <32f04739-0cd0-4a9e-9419-c5a13c333c28@redhat.com> <8d3804ad-14c8-4041-8f52-58fd9dd8d4b4@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: D0636C0005 X-Stat-Signature: ukoi5s385a1ropndn366iustrmkm57ki X-HE-Tag: 1720171421-565801 X-HE-Meta: U2FsdGVkX18BK7R1yHT8c7pbXqB3FvNVZSF2mIhaVwZpYQnn63StkhDKQp3LYjDICMzmBCqvagvDS8QnRUx+kI4uE7+BXUaCnMAsyM3mJ3voKZYRz/zrry6qrnMIwWypoeZnp/OJrAsU3xS61K9UD89DLxmJiYURK/zal1do/asnce2JahY6D3suJeB7IH7S7jBPtdjQrfZ/IfNpiKLgvu8U94BqzGwenxXKu1z4sTBMxZmhXWmoUzRRcKdTkQbT3B970P0tO0nzAq90wwa6SwW/ttmnlQuBRpRvQuvfxNPimePfex2qaav0lf1gfFwFSSPv1e/k5beME63bH7bkXmzOxO1ZEveve8a1jfqqXw70lI9RQe2r6p1uJMi4gix0FGle9JFJ38Y1JdeB2N4uB/Qgd9h4JVk7FGyM2/zHjZqoB/1sqct/ZyVTXHpWXpF8kw37lfsxnLhJNzsWDs/lgwt5FJj+FDM6DW61x/fjYy0Z04h0KFBzI91mN9veapNXQcGGSHjw+uKRez6g6AZr5H25vAWnABTjTr9A5ZPm8raurdbAndYydBeHIwbEeht83zyY2vdXbWb4MiwYvHE0rOyiQo5GM5OYyx1B7j4852z6PHUZQ0558tAfq5dfd4WieUi3ubsI/KAy1xzmw2EyvG6C7cmQop+vkROixhgb24J+IGduV9Kgf10SVz4mh7iWihKP+Zv34p1U8b+w+zPiQxFSjLGBPXoy+7+zpeTbbEb1eboI7h6dwOs75v7tio+tvrdMEvnD/B7+YWqu0d2vS3KKOiUMLAYxONqoaFoGVhgNS6DXjZmRlv4dc4T5O410f+LQUSM7EADG8bb9M2mkiLdN6p4vyD0cnmVnT2o6NrgXx0Qv0wv+roBa5Abl814RdOl8dZtPB+Ox7j69XDw3ojXHkPbehr0LgPB5hEVumkvYYuVu1ab3hFDW1Rtv7XKL9EL4caNWgy76Hvl/8tQ Alqd/vhy vlUh8iKoBl5TYXUEOwGUgxvM0WeOOp5vcjVi6PkvkOMicPyZ352EEylAKOJNaDtTNk/baIFPpdTWeEwuBbFI2B848+GeLGqUR1TeCAluf+AHuSXltUc6Clj3DLV8S/SvZh7MY0mN29yj/xhayVSkaUHHviEm/FV9CudSvrh5kZTJkbM3xL0GsUenWJwsxbwAPD92VfjNsMDDMWAhyfINb38MYBIWVjUhg7hsqU9Wwyk1JNTVYw0oT7KmUkCAXcoW/hk6Y 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 05/07/2024 10:16, David Hildenbrand wrote: > On 05.07.24 11:13, Ryan Roberts wrote: >> On 05/07/2024 09:59, David Hildenbrand wrote: >>> On 05.07.24 10:45, Ryan Roberts wrote: >>>> On 05/07/2024 06:47, Baolin Wang wrote: >>>>> >>>>> >>>>> On 2024/7/5 03:49, Matthew Wilcox wrote: >>>>>> On Thu, Jul 04, 2024 at 09:19:10PM +0200, David Hildenbrand wrote: >>>>>>> On 04.07.24 21:03, David Hildenbrand wrote: >>>>>>>>> shmem has two uses: >>>>>>>>> >>>>>>>>>       - MAP_ANONYMOUS | MAP_SHARED (this patch set) >>>>>>>>>       - tmpfs >>>>>>>>> >>>>>>>>> For the second use case we don't want controls *at all*, we want the >>>>>>>>> same heiristics used for all other filesystems to apply to tmpfs. >>>>>>>> >>>>>>>> As discussed in the MM meeting, Hugh had a different opinion on that. >>>>>>> >>>>>>> FWIW, I just recalled that I wrote a quick summary: >>>>>>> >>>>>>> https://lkml.kernel.org/r/f1783ff0-65bd-4b2b-8952-52b6822a0835@redhat.com >>>>>>> >>>>>>> I believe the meetings are recorded as well, but never looked at recordings. >>>>>> >>>>>> That's not what I understood Hugh to mean.  To me, it seemed that Hugh >>>>>> was expressing an opinion on using shmem as shmem, not as using it as >>>>>> tmpfs. >>>>>> >>>>>> If I misunderstood Hugh, well, I still disagree.  We should not have >>>>>> separate controls for this.  tmpfs is just not that special. >>>> >>>> I wasn't at the meeting that's being referred to, but I thought we previously >>>> agreed that tmpfs *is* special because in some configurations its not backed by >>>> swap so is locked in ram? >>> >>> There are multiple things to that, like: >>> >>> * Machines only having limited/no swap configured >>> * tmpfs can be configured to never go to swap >>> * memfd/tmpfs files getting used purely for mmap(): there is no real >>>    difference to MAP_ANON|MAP_SHARE besides the processes we share that >>>    memory with. >>> >>> Especially when it comes to memory waste concerns and access behavior in some >>> cases, tmpfs behaved much more like anonymous memory. But there are for sure >>> other use cases where tmpfs is not that special. >>> >>> My opinion is that we need to let people configure orders (if you feel like it, >>> configure all), but *select* the order to allocate based on readahead >>> information -- in contrast to anonymous memory where we start at the highest >>> order and don't have readahead information available. >> >> That approach is exactly what I proposed to start playing with yesterday [1] for >> regular pagecache folio allocations too :) > > In German, there is this saying "zwei Dumme ein Gedanke". > > The official English alternative is "great minds think alike". > > ... well, the direct German->English translation definitely has a "German touch" > to it: "two stupid ones one thought" I definitely prefer the direct translation. :)