All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Chuck Lever <chuck.lever@oracle.com>, linux-nfs@vger.kernel.org
Subject: [PATCH 15/20] NFS: Remove nfs_page_group_clear_bits()
Date: Wed, 19 Jul 2017 18:09:50 -0400	[thread overview]
Message-ID: <20170719220955.58210-16-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <20170719220955.58210-15-trond.myklebust@primarydata.com>

At this point, we only expect ever to potentially see PG_REMOVE and
PG_TEARDOWN being set on the subrequests.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/write.c | 29 +++--------------------------
 1 file changed, 3 insertions(+), 26 deletions(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index ffb9934607ef..20d44ea328b6 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -347,22 +347,6 @@ static void nfs_end_page_writeback(struct nfs_page *req)
 		clear_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC);
 }
 
-
-/* nfs_page_group_clear_bits
- *   @req - an nfs request
- * clears all page group related bits from @req
- */
-static void
-nfs_page_group_clear_bits(struct nfs_page *req)
-{
-	clear_bit(PG_TEARDOWN, &req->wb_flags);
-	clear_bit(PG_UNLOCKPAGE, &req->wb_flags);
-	clear_bit(PG_UPTODATE, &req->wb_flags);
-	clear_bit(PG_WB_END, &req->wb_flags);
-	clear_bit(PG_REMOVE, &req->wb_flags);
-}
-
-
 /*
  * nfs_unroll_locks_and_wait -  unlock all newly locked reqs and wait on @req
  *
@@ -417,13 +401,12 @@ nfs_destroy_unlinked_subrequests(struct nfs_page *destroy_list,
 		/* make sure old group is not used */
 		subreq->wb_this_page = subreq;
 
+		clear_bit(PG_REMOVE, &subreq->wb_flags);
+
 		/* Note: races with nfs_page_group_destroy() */
 		if (!kref_read(&subreq->wb_kref)) {
-			bool freeme = test_bit(PG_TEARDOWN, &subreq->wb_flags);
-
-			nfs_page_group_clear_bits(subreq);
 			/* Check if we raced with nfs_page_group_destroy() */
-			if (freeme)
+			if (test_and_clear_bit(PG_TEARDOWN, &subreq->wb_flags))
 				nfs_free_request(subreq);
 			continue;
 		}
@@ -437,7 +420,6 @@ nfs_destroy_unlinked_subrequests(struct nfs_page *destroy_list,
 			spin_unlock(&inode->i_lock);
 		}
 
-		nfs_page_group_clear_bits(subreq);
 		/* subreq is now totally disconnected from page group or any
 		 * write / commit lists. last chance to wake any waiters */
 		nfs_unlock_and_release_request(subreq);
@@ -573,11 +555,6 @@ nfs_lock_and_join_requests(struct page *page)
 		spin_unlock(&inode->i_lock);
 	}
 
-	/*
-	 * prepare head request to be added to new pgio descriptor
-	 */
-	nfs_page_group_clear_bits(head);
-
 	nfs_page_group_unlock(head);
 
 	nfs_destroy_unlinked_subrequests(destroy_list, head, inode);
-- 
2.13.3


  reply	other threads:[~2017-07-19 22:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 22:09 [PATCH 00/20] Reducing inode->i_lock contention in writebacks Trond Myklebust
2017-07-19 22:09 ` [PATCH 01/20] NFS: Simplify page writeback Trond Myklebust
2017-07-19 22:09   ` [PATCH 02/20] NFS: Reduce lock contention in nfs_page_find_head_request() Trond Myklebust
2017-07-19 22:09     ` [PATCH 03/20] NFS: Reduce lock contention in nfs_try_to_update_request() Trond Myklebust
2017-07-19 22:09       ` [PATCH 04/20] NFS: Ensure we always dereference the page head last Trond Myklebust
2017-07-19 22:09         ` [PATCH 05/20] NFS: Fix a reference and lock leak in nfs_lock_and_join_requests() Trond Myklebust
2017-07-19 22:09           ` [PATCH 06/20] NFS: Fix an ABBA issue " Trond Myklebust
2017-07-19 22:09             ` [PATCH 07/20] NFS: Don't check request offset and size without holding a lock Trond Myklebust
2017-07-19 22:09               ` [PATCH 08/20] NFS: Don't unlock writebacks before declaring PG_WB_END Trond Myklebust
2017-07-19 22:09                 ` [PATCH 09/20] NFS: Fix the inode request accounting when pages have subrequests Trond Myklebust
2017-07-19 22:09                   ` [PATCH 10/20] NFS: Teach nfs_try_to_update_request() to deal with request page_groups Trond Myklebust
2017-07-19 22:09                     ` [PATCH 11/20] NFS: Remove page group limit in nfs_flush_incompatible() Trond Myklebust
2017-07-19 22:09                       ` [PATCH 12/20] NFS: Reduce inode->i_lock contention in nfs_lock_and_join_requests() Trond Myklebust
2017-07-19 22:09                         ` [PATCH 13/20] NFS: Further optimise nfs_lock_and_join_requests() Trond Myklebust
2017-07-19 22:09                           ` [PATCH 14/20] NFS: Fix nfs_page_group_destroy() and nfs_lock_and_join_requests() race cases Trond Myklebust
2017-07-19 22:09                             ` Trond Myklebust [this message]
2017-07-19 22:09                               ` [PATCH 16/20] NFS: Remove unuse function nfs_page_group_lock_wait() Trond Myklebust
2017-07-19 22:09                                 ` [PATCH 17/20] NFS: Remove unused parameter from nfs_page_group_lock() Trond Myklebust
2017-07-19 22:09                                   ` [PATCH 18/20] NFS: Fix up nfs_page_group_covers_page() Trond Myklebust
2017-07-19 22:09                                     ` [PATCH 19/20] SUNRPC: Add a function to allow waiting for RPC transmission Trond Myklebust
2017-07-19 22:09                                       ` [PATCH 20/20] NFS: Throttle I/O to the NFS server Trond Myklebust
2017-07-20  6:52 ` [PATCH 00/20] Reducing inode->i_lock contention in writebacks Chuck Lever
2017-07-25  4:13 ` Weston Andros Adamson
2017-07-25 15:55 ` Jeff Layton
     [not found] ` <29B1641A-1D00-4CD3-8FBD-4B1D211D3AD7@oracle.com>
2017-07-28 19:59   ` Chuck Lever

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=20170719220955.58210-16-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.