linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Gomez <da.gomez@samsung.com>
To: Jan Kara <jack@suse.cz>
Cc: Hugh Dickins <hughd@google.com>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"brauner@kernel.org" <brauner@kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"dagmcr@gmail.com" <dagmcr@gmail.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"willy@infradead.org" <willy@infradead.org>,
	"hch@infradead.org" <hch@infradead.org>,
	"mcgrof@kernel.org" <mcgrof@kernel.org>,
	Pankaj Raghav <p.raghav@samsung.com>,
	"gost.dev@samsung.com" <gost.dev@samsung.com>
Subject: Re: [RFC PATCH 0/9] shmem: fix llseek in hugepages
Date: Wed, 28 Feb 2024 15:50:08 +0000	[thread overview]
Message-ID: <ffp7bvnaa3qxjdc54gj3tlhgryctyguzzcax7kqnh7tumotqet@4rjsmb2zos5i> (raw)
In-Reply-To: <elozg4pnyccaxmbb2nde3brtm32jko56e4mydxx53srze4zkcv@hukwjfblnjlo>

On Tue, Feb 27, 2024 at 11:42:01AM +0000, Daniel Gomez wrote:
> On Tue, Feb 20, 2024 at 01:39:05PM +0100, Jan Kara wrote:
> > On Tue 20-02-24 10:26:48, Daniel Gomez wrote:
> > > On Mon, Feb 19, 2024 at 02:15:47AM -0800, Hugh Dickins wrote:
> > > I'm uncertain when we may want to be more elastic. In the case of XFS with iomap
> > > and support for large folios, for instance, we are 'less' elastic than here. So,
> > > what exactly is the rationale behind wanting shmem to be 'more elastic'?
> > 
> > Well, but if you allocated space in larger chunks - as is the case with
> > ext4 and bigalloc feature, you will be similarly 'elastic' as tmpfs with
> > large folio support... So simply the granularity of allocation of
> > underlying space is what matters here. And for tmpfs the underlying space
> > happens to be the page cache.
> 
> But it seems like the underlying space 'behaves' differently when we talk about
> large folios and huge pages. Is that correct? And this is reflected in the fstat
> st_blksize. The first one is always based on the host base page size, regardless
> of the order we get. The second one is always based on the host huge page size
> configured (at the moment I've tested 2MiB, and 1GiB for x86-64 and 2MiB, 512
> MiB and 16GiB for ARM64).

Apologies, I was mixing the values available in HugeTLB and those supported in
THP (pmd-size only). Thus, it is 2MiB for x86-64, and 2MiB, 32 MiB and 512 MiB
for ARM64 with 4k, 16k and 64k Base Page Size, respectively.

> 
> If that is the case, I'd agree this is not needed for huge pages but only when
> we adopt large folios. Otherwise, we won't have a way to determine the step/
> granularity for seeking data/holes as it could be anything from order-0 to
> order-9. Note: order-1 support currently in LBS v1 thread here [1].
> 
> Regarding large folios adoption, we have the following implementations [2] being
> sent to the mailing list. Would it make sense then, to have this block tracking
> for the large folios case? Notice that my last attempt includes a partial
> implementation of block tracking discussed here.
> 
> [1] https://lore.kernel.org/all/20240226094936.2677493-2-kernel@pankajraghav.com/
> 
> [2] shmem: high order folios support in write path
> v1: https://lore.kernel.org/all/20230915095042.1320180-1-da.gomez@samsung.com/
> v2: https://lore.kernel.org/all/20230919135536.2165715-1-da.gomez@samsung.com/
> v3 (RFC): https://lore.kernel.org/all/20231028211518.3424020-1-da.gomez@samsung.com/
> 
> > 
> > > If we ever move shmem to large folios [1], and we use them in an oportunistic way,
> > > then we are going to be more elastic in the default path.
> > > 
> > > [1] https://lore.kernel.org/all/20230919135536.2165715-1-da.gomez@samsung.com
> > > 
> > > In addition, I think that having this block granularity can benefit quota
> > > support and the reclaim path. For example, in the generic/100 fstest, around
> > > ~26M of data are reported as 1G of used disk when using tmpfs with huge pages.
> > 
> > And I'd argue this is a desirable thing. If 1G worth of pages is attached
> > to the inode, then quota should be accounting 1G usage even though you've
> > written just 26MB of data to the file. Quota is about constraining used
> > resources, not about "how much did I write to the file".
> 
> But these are two separate values. I get that the system wants to track how many
> pages are attached to the inode, so is there a way to report (in addition) the
> actual use of these pages being consumed?
> 
> > 
> > 								Honza
> > -- 
> > Jan Kara <jack@suse.com>
> > SUSE Labs, CR

      reply	other threads:[~2024-02-28 15:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240209142903eucas1p1f211ca6fc40a788e833de062e2772c41@eucas1p1.samsung.com>
2024-02-09 14:29 ` Daniel Gomez
     [not found]   ` <CGME20240209142905eucas1p2df56a08287a84a5fa004142100926bb4@eucas1p2.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 3/9] shmem: move folio zero operation to write_begin() Daniel Gomez
     [not found]   ` <CGME20240209142903eucas1p17f73779c6b38276cd7cefbe0a40f355e@eucas1p1.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 1/9] splice: don't check for uptodate if partially uptodate is impl Daniel Gomez
     [not found]   ` <CGME20240209142904eucas1p20a388be8e43b756b84b5a586d5a88f18@eucas1p2.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 2/9] shmem: add per-block uptodate tracking for hugepages Daniel Gomez
     [not found]   ` <CGME20240209142905eucas1p14498619591475e416a8163dbc96c90e4@eucas1p1.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 5/9] shmem: clear_highpage() if block is not uptodate Daniel Gomez
     [not found]   ` <CGME20240209142906eucas1p2c31598bf448077f04eef66319ae2f3a1@eucas1p2.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 6/9] shmem: set folio uptodate when reclaim Daniel Gomez
     [not found]   ` <CGME20240209142905eucas1p150b096fab4b8a684b416d3beb0df901b@eucas1p1.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 4/9] shmem: exit shmem_get_folio_gfp() if block is uptodate Daniel Gomez
     [not found]   ` <CGME20240209142907eucas1p2024d2809a150c6e58082de0937596290@eucas1p2.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 7/9] shmem: check if a block is uptodate before splice into pipe Daniel Gomez
     [not found]   ` <CGME20240209142907eucas1p12155b2fb002df5e0cd617fa74de757b7@eucas1p1.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 9/9] shmem: enable per-block uptodate Daniel Gomez
     [not found]   ` <CGME20240209142907eucas1p2c61ae37b2a1ca2caeccc48b2169226f2@eucas1p2.samsung.com>
2024-02-09 14:29     ` [RFC PATCH 8/9] shmem: clear uptodate blocks after PUNCH_HOLE Daniel Gomez
     [not found]   ` <CGME20240214194911eucas1p187ae3bc5b2be4e0d2155f9ce792fdf8b@eucas1p1.samsung.com>
2024-02-14 19:49     ` [RFC PATCH 0/9] shmem: fix llseek in hugepages Daniel Gomez
2024-02-19 10:15       ` Hugh Dickins
2024-02-20 10:26         ` Daniel Gomez
2024-02-20 12:39           ` Jan Kara
2024-02-27 11:42             ` Daniel Gomez
2024-02-28 15:50               ` Daniel Gomez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ffp7bvnaa3qxjdc54gj3tlhgryctyguzzcax7kqnh7tumotqet@4rjsmb2zos5i \
    --to=da.gomez@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=dagmcr@gmail.com \
    --cc=gost.dev@samsung.com \
    --cc=hch@infradead.org \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox