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 71444C6FD18 for ; Tue, 18 Apr 2023 21:20:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07A3A8E0003; Tue, 18 Apr 2023 17:20:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 002D28E0001; Tue, 18 Apr 2023 17:20:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE5A98E0003; Tue, 18 Apr 2023 17:20:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C76E08E0001 for ; Tue, 18 Apr 2023 17:20:08 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8B6B81A039B for ; Tue, 18 Apr 2023 21:20:08 +0000 (UTC) X-FDA: 80695779696.14.B1FE9DA Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf19.hostedemail.com (Postfix) with ESMTP id EBFB91A0006 for ; Tue, 18 Apr 2023 21:20:06 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1L14NJ+l; spf=none (imf19.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=1681852807; 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=3Km/vnh/sBC4DQYO69Q00ljyDReo/R1BeGSdOPULOKw=; b=Vgk6rWToi+Nxk6WMIHsjl7vanATjjEJRzkJSVUm4ix3BX1DUjOnkYTj8mXSvVOp5PKU3F5 nlWE0Usyb/6cqmul30bgpcWQQWHSfgaWHy5AnQemAYJzcY4hyAzQrUUV240BEyYFB58nWs KHuHYYrTaFdcNqu9vnVH58meL/pbUxM= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1L14NJ+l; spf=none (imf19.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=1681852807; a=rsa-sha256; cv=none; b=Y7mvrQ8moc/cf/3JOjX52gwgf71HdNgypzQm/+hzxiOSN1LVMOYCfhuJj78ufk4UOE0Ast lp8j8uS7l+chdzXBCJHsl+CLIMkcP6krjagyfDDGzw7V2p2InfjBuZhZS/GmJCdC4ECUDu Wo8qCvdK2zmZA/V8qy0ocr59UYSUAq4= 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=3Km/vnh/sBC4DQYO69Q00ljyDReo/R1BeGSdOPULOKw=; b=1L14NJ+lXlSRxbmu5FayimPVss bavZ6XsrainBIv/5bbMp3rBuUpTS3nQl+23Ul819ig5kO7uZAjLFcxDNOL0tNvLePvbwUuCG3pPTR 4b1IIK8sejumG/QXJ1HuwBqTUUV/NaxX/YGGbqDkbk0zRph/UfJ6IlC8kk9s4IZE5fTfrdlTponOK qOX7dWJyeft5qvMgd1rlX2Npl/Y0nyX4gWgL2NZo56NopoNeGgdfOVJQzHFpwbx/dFYbYGuh+tp7Z FbccCeJ2adPHUoMzGKF4bY/db598SuCcpN0MslTePYUdyT+VFw/8RbXQEQJiKsWikTVsJ89d/IDLS h1pGV9KQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1posk5-003MpZ-21; Tue, 18 Apr 2023 21:20:01 +0000 Date: Tue, 18 Apr 2023 14:20:01 -0700 From: Luis Chamberlain To: Hugh Dickins Cc: akpm@linux-foundation.org, willy@infradead.org, brauner@kernel.org, linux-mm@kvack.org, p.raghav@samsung.com, da.gomez@samsung.com, a.manzanares@samsung.com, dave@stgolabs.net, yosryahmed@google.com, keescook@chromium.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, David Hildenbrand Subject: Re: [PATCH v2 5/6] shmem: update documentation Message-ID: References: <20230309230545.2930737-1-mcgrof@kernel.org> <20230309230545.2930737-6-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: EBFB91A0006 X-Stat-Signature: wuiyaceth8sbp9ic7356wi6phk4rgnsx X-Rspam-User: X-HE-Tag: 1681852806-881423 X-HE-Meta: U2FsdGVkX1+9D4O5r20ZAyk5NyyydOxWdTzc245O6PMWeaK/N5g68MqaAOYp2djJi0gzAXUJim2FF5F2VrTm80n1QO+fJ9nD3jYSYRuP5skus2hlwBeWoCslLBTqNCTvFGen2Dn3IvfSHmtomXFUA5nirp2TEPBo1tbvWiw1aZZzdW00E5LYr5eIMW7+70a14FWU1epJtFd/BG4Heu3Id9r3lrjK/h++Wt8yhNYQZLwQNG0Usnkdjzn+6S3vGgPo8nM77PdiahQs/MAN8A3beYr0gPN83oQcpLOo8OBJem3UfzcZuzeTJN/G0HixebeHC3GoLlf0IreEn7z1dgU8D5IgcGwVuwCm12RaJBjJ9IkrQpnRNylRcP/fmiVh3zTFkiLrI8enp4Ij56dPAgEnlgS7a+fWNTSdVCQNXxOOLiUFGduRHsCGqj9CwIhv1JGaDCvH3GnIUkR9yLxrfWS3kMRzGg4AFMc4c7Qa4xfqqaNku2+gsvhlhbVo0TbKOxT4kMZ4nMjc19NcJllaPVETR9ipRV09I05XnHUEqvZneWowBgLeWfwlcaoSgwPkyXoz9uwSY0bzqUq4LWhNwnNM2YJBmBFvsa71kFCQ1FrafSdRMTJArbDyWYavduEyoUxiy1V8JesZLKK5HGCfzxxJGMtRaVocrRaX6Bzjm/+dQSxDaK81q8xZkQpgLbGMbzS7+SbpAp27D41hwop5Wmwz9U+p3VKKYl49yR3bS95mFouAS3Zf2GUnVro9Ec+1X35logw9c1v3vrYzBIp+NF61zX6ml7glG3ICZH1qKi+2e0tMrBIV5FiS5ar/ufVOQGNWM1DB07gc7FsYhne4gWL1pEJj7l+m//lx71x+8Jaj24xXYkV1uSoCCQicuQLXnYB7gQ78DTYSnj7unHocA2lgN3zppe3SDNnn5QPToxbplA5EcwsX7kKOHb9qzSJMQDJgB/70P7GpVepiCHE7kZn 6cPjVj0o 9+lhdDIQDb6dudeQfg2mOpTBo3vkY4r6UtGbG3x/g/Vu3qpSVQoc1pCRv89mWNJOhW7efcKx8JaGb1eED3AsdNgUeYkMCetjFdkP+a2N+Ai8bQiLk5cSgDHhqxoBpJdZYZ4BtY9UBevctrKBBgUFWrxuHlbo74e5p7/n0mt6rmBEEYyUiz51co8Dw7lfJNS9htY6MdrgT63f+6lhLkayKQV+RQGoLf4jS5fh09vAAnu3m0YVFsVwCqoH5RVMLsrSmIcR3Y1kJUocqfFeHc1R2wvcA9w9fSdzKy+YVeHmh+HZehvJ8turWcGrjvfZFxzMFHds0WVAAt1assw8= 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 Mon, Apr 17, 2023 at 10:29:59PM -0700, Hugh Dickins wrote: > On Thu, 9 Mar 2023, Luis Chamberlain wrote: > > > Update the docs to reflect a bit better why some folks prefer tmpfs > > over ramfs and clarify a bit more about the difference between brd > > ramdisks. > > > > While at it, add THP docs for tmpfs, both the mount options and the > > sysfs file. > > Okay: the original canonical reference for THP options on tmpfs has > been Documentation/admin-guide/mm/transhuge.rst. You're right that > they would be helpful here too: IIRC (but I might well be confusing > with our Google tree) we used to have them documented in both places, > but grew tired of keeping the two in synch. You're volunteering to > do so! so please check now that they tell the same story. Hehe. Sure, we should just make one point to the other. Which one should be the authoritive source? > But nowadays, "man 5 tmpfs" is much more important (and that might > give you a hint for what needs to be done after this series goes into > 6.4-rc - and I wonder if there are tmpfs manpage updates needed from > Christian for idmapped too? or already taken care of?). Sure, what's the man page git tree to use? I can do that once these documents are settled as well. I'll send fixes. > There's a little detail we do need you to remove, indicated below. > > > +====== ============================================================ > > +huge=0 never: disables huge pages for the mount > > +huge=1 always: enables huge pages for the mount > > +huge=2 within_size: only allocate huge pages if the page will be > > + fully within i_size, also respect fadvise()/madvise() hints. > > +huge=3 advise: only allocate huge pages if requested with > > + fadvise()/madvise() > > You're taking the source too literally there. Minor point is that there > is no fadvise() for this, to date anyway. Major point is: have you tried > mounting tmpfs with huge=0 etc? I did propose "huge=0" and "huge=1" years > ago, but those "never" went in, it's "always" been the named options. > Please remove those misleading numbers, it's "huge=never" etc. Will do. > > +== ============================================================ > > +-1 deny: disables huge on shm_mnt and all mounts, for > > + emergency use > > +-2 force: enables huge on shm_mnt and all mounts, w/o needing > > + option, for testing > > Likewise here, please delete the invalid "-1" and "-2" notations, > -1 and -2 are just #defines for use in the kernel source. ok! > And the description above is not quite accurate: it is very hard to > describe shmem_enabled, partly because it combines two different things. > It's partly the "huge=" mount option for any "internal mount", those > things like SysV SHM and memfd and i915 and shared-anonymous: the shmem > which has no user-visible mount to hold the option. But also these > "deny" and "force" overrides affecting *all* internal and visible mounts. I see thanks. Luis