From: Christoph Hellwig <hch@infradead.org>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org,
Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <Anna.Schumaker@netapp.com>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] nfs: Fix misuses of folio_shift() and folio_order()
Date: Tue, 28 May 2024 23:30:28 -0700 [thread overview]
Message-ID: <ZlbLhHB4vucmIRgR@infradead.org> (raw)
In-Reply-To: <20240528210407.2158964-1-willy@infradead.org>
On Tue, May 28, 2024 at 10:03:15PM +0100, Matthew Wilcox (Oracle) wrote:
> Page cache indices are in units of PAGE_SIZE, not in units of
> the folio size. Revert the change in nfs_grow_file(), and
> pass the inode to nfs_folio_length() so it can be reimplemented
> in terms of folio_mkwrite_check_truncate() which handles this
> correctly.
I had to apply the incremental patch below to make the change compile.
With that it causes a new xfstests failure in generic/127 that I haven't
looked into yet. The mm-level bugs I've seen even with baseline
Linus' tree also happened more often than in my previous tests, but
that might just be coincidence.
diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h
index 1e710654af1173..0a5d5fa9513735 100644
--- a/fs/nfs/nfstrace.h
+++ b/fs/nfs/nfstrace.h
@@ -938,7 +938,7 @@ TRACE_EVENT(nfs_sillyrename_unlink,
DECLARE_EVENT_CLASS(nfs_folio_event,
TP_PROTO(
- const struct inode *inode,
+ struct inode *inode,
struct folio *folio
),
@@ -954,14 +954,14 @@ DECLARE_EVENT_CLASS(nfs_folio_event,
),
TP_fast_assign(
- const struct nfs_inode *nfsi = NFS_I(inode);
+ struct nfs_inode *nfsi = NFS_I(inode);
__entry->dev = inode->i_sb->s_dev;
__entry->fileid = nfsi->fileid;
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
__entry->version = inode_peek_iversion_raw(inode);
__entry->offset = folio_file_pos(folio);
- __entry->count = nfs_folio_length(folio);
+ __entry->count = nfs_folio_length(folio, inode);
),
TP_printk(
@@ -977,14 +977,14 @@ DECLARE_EVENT_CLASS(nfs_folio_event,
#define DEFINE_NFS_FOLIO_EVENT(name) \
DEFINE_EVENT(nfs_folio_event, name, \
TP_PROTO( \
- const struct inode *inode, \
+ struct inode *inode, \
struct folio *folio \
), \
TP_ARGS(inode, folio))
DECLARE_EVENT_CLASS(nfs_folio_event_done,
TP_PROTO(
- const struct inode *inode,
+ struct inode *inode,
struct folio *folio,
int ret
),
@@ -1002,14 +1002,14 @@ DECLARE_EVENT_CLASS(nfs_folio_event_done,
),
TP_fast_assign(
- const struct nfs_inode *nfsi = NFS_I(inode);
+ struct nfs_inode *nfsi = NFS_I(inode);
__entry->dev = inode->i_sb->s_dev;
__entry->fileid = nfsi->fileid;
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
__entry->version = inode_peek_iversion_raw(inode);
__entry->offset = folio_file_pos(folio);
- __entry->count = nfs_folio_length(folio);
+ __entry->count = nfs_folio_length(folio, inode);
__entry->ret = ret;
),
@@ -1026,7 +1026,7 @@ DECLARE_EVENT_CLASS(nfs_folio_event_done,
#define DEFINE_NFS_FOLIO_EVENT_DONE(name) \
DEFINE_EVENT(nfs_folio_event_done, name, \
TP_PROTO( \
- const struct inode *inode, \
+ struct inode *inode, \
struct folio *folio, \
int ret \
), \
next prev parent reply other threads:[~2024-05-29 6:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-27 16:36 support large folios for NFS Christoph Hellwig
2024-05-27 16:36 ` [PATCH 1/2] filemap: Convert generic_perform_write() to support large folios Christoph Hellwig
2024-05-27 18:17 ` Matthew Wilcox
2024-05-28 8:12 ` Christoph Hellwig
2024-05-28 15:23 ` Daniel Gomez
2024-05-28 16:50 ` Matthew Wilcox
2024-05-28 19:01 ` Daniel Gomez
2024-06-11 10:47 ` Shaun Tancheff
2024-06-11 16:13 ` Christoph Hellwig
[not found] ` <1d87741b-7178-4791-aca2-da3ac3033552@gmail.com>
2024-06-12 4:02 ` Christoph Hellwig
2024-05-27 16:36 ` [PATCH 2/2] nfs: add support for " Christoph Hellwig
2024-05-27 19:43 ` support large folios for NFS Sagi Grimberg
2024-05-28 21:03 ` [PATCH] nfs: Fix misuses of folio_shift() and folio_order() Matthew Wilcox (Oracle)
2024-05-29 5:15 ` Christoph Hellwig
2024-05-29 6:30 ` Christoph Hellwig [this message]
2024-05-29 14:31 ` Trond Myklebust
2024-05-28 21:05 ` support large folios for NFS Matthew Wilcox
2024-05-29 5:14 ` Christoph Hellwig
2024-05-29 13:35 ` Trond Myklebust
2024-05-29 21:59 ` Trond Myklebust
2024-05-31 6:14 ` hch
2024-06-07 5:29 ` hch
2024-06-07 7:57 ` Cedric Blancher
2024-06-07 15:32 ` Trond Myklebust
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=ZlbLhHB4vucmIRgR@infradead.org \
--to=hch@infradead.org \
--cc=Anna.Schumaker@netapp.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@hammerspace.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