Re: [PATCH 2/2] NFS: Use GFP_NOIO for two allocations in writeback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19 Apr 2017, at 6:08, Benjamin Coddington wrote:

On 18 Apr 2017, at 16:32, Benjamin Coddington wrote:

On 18 Apr 2017, at 12:42, Trond Myklebust wrote:

Hi Ben,

On Tue, 2017-04-18 at 11:40 -0400, Benjamin Coddington wrote:
Prevent a deadlock that can occur if we wait on allocations
that try to write back our pages.

Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx>
---
 fs/nfs/pagelist.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 19eaae0dee51..fa2924ce5a78 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -668,6 +668,7 @@ void nfs_pageio_init(struct nfs_pageio_descriptor
*desc,
 {
 	struct nfs_pgio_mirror *new;
 	int i;
+	gfp_t gfp_flags = GFP_KERNEL;
 
 	desc->pg_moreio = 0;
 	desc->pg_inode = inode;
@@ -687,8 +688,10 @@ void nfs_pageio_init(struct
nfs_pageio_descriptor *desc,
 	if (pg_ops->pg_get_mirror_count) {
 		/* until we have a request, we don't have an lseg
and no
 		 * idea how many mirrors there will be */
+		if (desc->pg_rw_ops->rw_mode == FMODE_WRITE)

Can we rather replace this with a new field in struct
nfs_pageio_descriptor? I want to get rid of pg_rw_ops->rw_mode; it's
something that slipped through the cracks.

I can do this. It might make sense to just replace rw_mode with something
like rw_gfp_flags..  Otherwise, this looks like another argument to
nfs_pageio_init(), unless we can piggy-back on pg_ioflags.

But that won't work, since we'll need something to laster figure out whether a read or write delegation stateid can be used. Maybe you were instead
suggesting to move the rw_mode to the pageio_descriptor or header..

I've been trying to figure out why you want to get rid of
pg_rw_ops->rw_mode, and think that it's because it would be better to have it in a cacheline in nfs4_proc_pgio_rpc_prepare(), so I'm going to move it
to the nfs_pgio_header.  There's a 4-byte hole after nfs_writeverf on
x86_64.

The updates will continue until a request for decreased verbosity.  :)

Ben
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux