From: Mike Kravetz <mike.kravetz@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>,
linux-man@vger.kernel.org, linux-mm@kvack.org,
David Hildenbrand <david@redhat.com>,
Muchun Song <songmuchun@bytedance.com>,
Naoya Horiguchi <naoya.horiguchi@linux.dev>,
Axel Rasmussen <axelrasmussen@google.com>,
Dave Hansen <dave.hansen@intel.com>,
Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH] hugetlbfs: zero partial pages during fallocate hole punch
Date: Mon, 13 Jun 2022 13:11:55 -0700 [thread overview]
Message-ID: <YqeaCxpwtbHfGpLD@monkey> (raw)
In-Reply-To: <20220613115732.3bf59ca4b31512153e27c548@linux-foundation.org>
On Mon, Jun 13, 2022 at 11:57:32AM -0700”, Andrew Morton wrote:
> On Mon, 13 Jun 2022 11:36:30 -0700 Mike kravetz <mike.kravetz@oracle.com> wrote:
>
> > On Mon, Jun 13, 2022 at 07:30:22PM +0100”, Matthew Wilcox wrote:
> > > On Mon, Jun 13, 2022 at 11:08:58AM -0700, Mike Kravetz wrote:
> > > > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> > > > index eca1d0fabd7e..b0d0947a7e9b 100644
> > > > --- a/fs/hugetlbfs/inode.c
> > > > +++ b/fs/hugetlbfs/inode.c
> > > > @@ -584,41 +584,79 @@ static void hugetlb_vmtruncate(struct inode *inode, loff_t offset)
> > > > remove_inode_hugepages(inode, offset, LLONG_MAX);
> > > > }
> > > >
> > > > +static void hugetlbfs_zero_partial_page(struct hstate *h,
> > > > + struct address_space *mapping,
> > > > + unsigned long start,
> > >
> > > This should be loff_t. Otherwise we can truncate on 32-bit machines.
> > >
> >
> > Thanks! I missed that.
>
> I did this:
Thank you.
I will send an official v2 with this change, just in case there are more
comments.
--
Mike Kravetz
>
> --- a/fs/hugetlbfs/inode.c~hugetlbfs-zero-partial-pages-during-fallocate-hole-punch-fix
> +++ a/fs/hugetlbfs/inode.c
> @@ -602,8 +602,7 @@ static void hugetlb_vmtruncate(struct in
>
> static void hugetlbfs_zero_partial_page(struct hstate *h,
> struct address_space *mapping,
> - unsigned long start,
> - unsigned long end)
> + loff_t start, loff_t end)
> {
> pgoff_t idx = start >> huge_page_shift(h);
> struct page *page;
> _
>
next prev parent reply other threads:[~2022-06-13 20:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 18:08 Mike Kravetz
2022-06-13 18:30 ` Matthew Wilcox
2022-06-13 18:36 ` Mike kravetz
2022-06-13 18:57 ` Andrew Morton
2022-06-13 20:11 ` Mike Kravetz [this message]
2022-06-13 20:46 ` Mike Kravetz
2022-06-14 15:03 ` Muchun Song
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=YqeaCxpwtbHfGpLD@monkey \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=linux-man@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=naoya.horiguchi@linux.dev \
--cc=songmuchun@bytedance.com \
--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