linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jinjiang Tu <tujinjiang@huawei.com>,
	miklos@szeredi.hu, akpm@linux-foundation.org, vbabka@suse.cz,
	jannh@google.com, linux-mm@kvack.org,
	linux-unionfs@vger.kernel.org, wangkefeng.wang@huawei.com,
	sunnanyong@huawei.com, yi.zhang@huawei.com,
	Matthew Wilcox <willy@infradead.org>,
	Liam Howlett <liam.howlett@oracle.com>
Subject: Re: [PATCH -next] ovl: respect underlying filesystem's get_unmapped_area()
Date: Thu, 5 Dec 2024 15:24:18 +0000	[thread overview]
Message-ID: <f773da0d-38df-43ad-86a9-6cba785d53a8@lucifer.local> (raw)
In-Reply-To: <CAOQ4uxjLZJXDm+7aiFsEtiUhvux5U=dftw7eNBpk55J6wW9XBw@mail.gmail.com>

(fixing typo in cc list: tujinjiang@huawe.com -> tujinjiang@huawei.com)

+ Liam

(JinJiang - you forgot to cc the correct maintainers, please ensure you run
scripts/get_maintainers.pl on files you change)

On Thu, Dec 05, 2024 at 04:12:12PM +0100, Amir Goldstein wrote:
> On Thu, Dec 5, 2024 at 4:04 PM Lorenzo Stoakes
> <lorenzo.stoakes@oracle.com> wrote:
> >
> > + Matthew for large folio aspect
> >
> > On Thu, Dec 05, 2024 at 10:30:38PM +0800, Jinjiang Tu wrote:
> > > During our tests in containers, there is a read-only file (i.e., shared
> > > libraies) in the overlayfs filesystem, and the underlying filesystem is
> > > ext4, which supports large folio. We mmap the file with PROT_READ prot,
> > > and then call madvise(MADV_COLLAPSE) for it. However, the madvise call
> > > fails and returns EINVAL.
> > >
> > > The reason is that the mapping address isn't aligned to PMD size. Since
> > > overlayfs doesn't support large folio, __get_unmapped_area() doesn't call
> > > thp_get_unmapped_area() to get a THP aligned address.
> > >
> > > To fix it, call get_unmapped_area() with the realfile.
> >
> > Isn't the correct solution to get overlayfs to support large folios?
> >
> > >
> > > Besides, since overlayfs may be built with CONFIG_OVERLAY_FS=m, we should
> > > export get_unmapped_area().
> >
> > Yeah, not in favour of this at all. This is an internal implementation
> > detail. It seems like you're trying to hack your way into avoiding
> > providing support for large folios and to hand it off to the underlying
> > file system.
> >
> > Again, why don't you just support large folios in overlayfs?
> >
>
> This whole discussion seems moot.
> overlayfs does not have address_space operations
> It does not have its own page cache.

And here we see my total lack of knowledge of overlayfs coming into play
here :) Thanks for pointing this out.

In that case, I object even further to the original of course...

>
> The file in  vma->vm_file is not an overlayfs file at all - it is the
> real (e.g. ext4) file
> when returning from ovl_mmap() => backing_file_mmap()
> so I have very little clue why the proposed solution even works,
> but it certainly does not look correct.

I think then Jinjiang in this cause you ought to go back to the drawing
board and reconsider what might be the underlying issue here.

>
> Thanks,
> Amir.

Cheers, Lorenzo


  reply	other threads:[~2024-12-05 15:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-05 14:30 Jinjiang Tu
2024-12-05 15:04 ` Lorenzo Stoakes
2024-12-05 15:12   ` Amir Goldstein
2024-12-05 15:24     ` Lorenzo Stoakes [this message]
2024-12-06  3:35       ` Jinjiang Tu
2024-12-06 13:52         ` Matthew Wilcox
2024-12-10 17:36       ` Jann Horn
2024-12-06  3:35   ` Jinjiang Tu
2024-12-06  9:25     ` Lorenzo Stoakes
2024-12-06 10:45       ` Kefeng Wang
2024-12-06 11:53         ` Lorenzo Stoakes
2024-12-10  7:09           ` Kefeng Wang
2024-12-06 12:58         ` Amir Goldstein
2024-12-10  7:19           ` Kefeng Wang
2024-12-11  9:43             ` Amir Goldstein
2024-12-11 15:01               ` Kefeng Wang
2024-12-13  1:51                 ` Jinjiang Tu
2024-12-13  4:25               ` Matthew Wilcox
2024-12-13  7:49                 ` Kefeng Wang
2024-12-13 14:00                   ` Matthew Wilcox
2024-12-14  7:58                     ` Kefeng Wang
2024-12-05 21:21 ` kernel test robot
2024-12-06 13:58 ` Matthew Wilcox
2024-12-09  6:43   ` Jinjiang Tu
2024-12-09 13:33     ` Matthew Wilcox
2024-12-10  7:13       ` Jinjiang Tu
2024-12-10 17:58         ` Matthew Wilcox
2024-12-11  2:21           ` Zhang Yi

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=f773da0d-38df-43ad-86a9-6cba785d53a8@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=amir73il@gmail.com \
    --cc=jannh@google.com \
    --cc=liam.howlett@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=sunnanyong@huawei.com \
    --cc=tujinjiang@huawei.com \
    --cc=vbabka@suse.cz \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --cc=yi.zhang@huawei.com \
    /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