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 75690C25B74 for ; Fri, 10 May 2024 18:54:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8AE26B011A; Fri, 10 May 2024 14:54:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3B266B011B; Fri, 10 May 2024 14:54:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C29906B011C; Fri, 10 May 2024 14:54:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A14DC6B011A for ; Fri, 10 May 2024 14:54:10 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 502441A16BF for ; Fri, 10 May 2024 18:54:10 +0000 (UTC) X-FDA: 82103386260.26.B3979A8 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf13.hostedemail.com (Postfix) with ESMTP id A137A20010 for ; Fri, 10 May 2024 18:54:08 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=QlT4L3vG; spf=none (imf13.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715367248; a=rsa-sha256; cv=none; b=smYIg2RM75XMb6e8KtnuNl7Qp+zeKnGz5M3HCg6FXnjZ67hpR6Vp5+AKU5HO8SdnEauxcs RCrB9//+WN/xFJE2Ceso01fh3hiOC8Pv1oM/56yDtJxiNE4U0o8yYEemgz00YckYXtEXD0 AeGDwpbqzSWNMAYh/v3lNU2iaOfVaKE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=QlT4L3vG; spf=none (imf13.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715367248; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IendhRezRdHkCFfFsZTgYGRwbs6ppEzGZGzENXeNAlY=; b=qhp38enJo2YNwr3qlymHHjb1uay3JbxGPKXgulzz5MhZlHB5V2AzFk/5jIyD6QqDx4Hb6o /ymfKskSIISG183Eg1gIbvh5fKliNYmv7Q5XWNMhBHEEQiYvsobtWNbHGNXPw2oHSVjJt7 3QpVRwfgsOGv0M7G4FbZfaBxdPjhHUc= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IendhRezRdHkCFfFsZTgYGRwbs6ppEzGZGzENXeNAlY=; b=QlT4L3vGo5BrUtvEY1sfaC06j7 To1YWpICqsmeQ609slk/5cgfCAReOS553T/uzYN3F0aMh6cgEm3exzjNMR7B2WFOrXcSYGX+3yB7o r0WqXAinAy3ItWy6mo7YlGNIezhpxG16dFJ3gZh1Y0DEPGv2CyFhyW2mKWCO2k/pfWFGOHIGo10YD ymHGxYCFNEOg2CrRU6zPUNhic1J7oovXxEmJ0nJOo/2W6+ONVa6P+NvbHTkNm6jl82No+JfNjaY/p n9ufYyaf9xxVbyolbD8JeMkS0eQ/X8hSmDt9QNe/jq4wzIRfUp8dRZbZ9IcusIR/OSvaQPfabAKy0 dQg5K0Hw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5VNP-00000006BoA-0F3k; Fri, 10 May 2024 18:53:51 +0000 Date: Fri, 10 May 2024 11:53:51 -0700 From: Luis Chamberlain To: David Hildenbrand , Hugh Dickins Cc: Matthew Wilcox , Christoph Lameter , Christoph Hellwig , Dave Chinner , Daniel Gomez , Baolin Wang , "akpm@linux-foundation.org" , "hughd@google.com" , "ioworker0@gmail.com" , "wangkefeng.wang@huawei.com" , "ying.huang@intel.com" , "21cnbao@gmail.com" <21cnbao@gmail.com>, "ryan.roberts@arm.com" , "shy828301@gmail.com" , "ziy@nvidia.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Linux FS Devel Subject: Re: [PATCH 0/8] add mTHP support for anonymous shmem Message-ID: References: <23ea6dbd-1d4e-4aeb-900b-646db880cfb6@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23ea6dbd-1d4e-4aeb-900b-646db880cfb6@redhat.com> X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A137A20010 X-Stat-Signature: 5a48ks8b5sthpcjig3tffk6wpq575j5q X-HE-Tag: 1715367248-266654 X-HE-Meta: U2FsdGVkX19eT+xxcC1VTIpHquhU9DZDZdQecxjxWHndt/He3Bd72gWhZufyiTuqsZXetS0KN949E1c4ySSYyG/dpbH3QQxNyIeOufLml3XpHzUcLcWtKU1EvPvCc3ma1sq18va4Py9XgV0IZbDGmzTHeFOYdvLgE0ALUdCANn7mlPchzT57+wMNspB4ndaj+KwNDwiymjl5pJ0k/chKHSGso7sW8nu0j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iSpMZlaDmFuS61y8nJSVTo1Wmice4U+z 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 Thu, May 09, 2024 at 07:48:46PM +0200, David Hildenbrand wrote: > On 08.05.24 21:23, Luis Chamberlain wrote: > > From my perspective the more shared code the better, and the more shared > > paths the better. There is a chance to help test swap with large folios > > instead of splitting the folios for swap, and that would could be done > > first with tmpfs. I have not evaluated the difference in testing or how > > we could get the most of shared code if we take a mTHP approach or the > > iomap approach for tmpfs, that should be considered. > > I don't have a clear picture yet of what might be best for ordinary shmem > (IOW, not MAP_SHARED|MAP_PRIVATE), and I'm afraid there is no easy answer. OK so it sounds like the different options needs to be thought out and reviewed. > As long as we don't end up wasting memory, it's not obviously bad. Sure. > But some > things might be tricky (see my example about large folios stranding in shmem > and never being able to be really reclaimed+reused for better purposes) Where is that stated BTW? Could that be resolved? > I'll note that mTHP really is just (supposed to be) a user interface to > enable the various folio sizes (well, and to expose better per-size stats), > not more. Sure but given filesystems using large folios don't have silly APIs for using which large folios to enable, it just seems odd for tmpfs to take a different approach. > From that point of view, it's just a filter. Enable all, and you get the > same behavior as you likely would in the pagecache mode. Which begs the quesiton, *why* have an API to just constrain to certain large folios, which diverges from what filesystems are doing with large folios? > > Are there other things to consider? Does this require some dialog at > > LSFMM? > > As raised in my reply to Daniel, I'll be at LSF/MM and happy to discuss. I'm > also not a SHMEM expert, so I'm hoping at some point we'd get feedback from > Hugh. Hugh, will you be at LSFMM? Luis