Commit b571cfc
nfs: don't reuse partially completed requests in nfs_lock_and_join_requests
When NFS requests are split into sub-requests, nfs_inode_remove_request
calls nfs_page_group_sync_on_bit to set PG_REMOVE on this sub-request and
only completes the head requests once PG_REMOVE is set on all requests.
This means that when nfs_lock_and_join_requests sees a PG_REMOVE bit, I/O
on the request is in progress and has partially completed. If such a
request is returned to nfs_try_to_update_request, it could be extended
with the newly dirtied region and I/O for the combined range will be
re-scheduled, leading to extra I/O.
Change the logic to instead restart the search for a request when any
PG_REMOVE bit is set, as the completion handler will remove the request
as soon as it can take the page group lock. This not only avoid
extending the I/O but also does the right thing for the callers that
want to cancel or flush the request.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>1 parent f1b7c75 commit b571cfc
1 file changed
Lines changed: 20 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 147 | | |
173 | 148 | | |
174 | 149 | | |
| |||
566 | 541 | | |
567 | 542 | | |
568 | 543 | | |
| 544 | + | |
569 | 545 | | |
570 | 546 | | |
571 | 547 | | |
| |||
590 | 566 | | |
591 | 567 | | |
592 | 568 | | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | 569 | | |
598 | 570 | | |
599 | 571 | | |
600 | 572 | | |
| 573 | + | |
| 574 | + | |
601 | 575 | | |
602 | 576 | | |
603 | 577 | | |
604 | 578 | | |
| 579 | + | |
| 580 | + | |
605 | 581 | | |
606 | 582 | | |
607 | 583 | | |
608 | 584 | | |
609 | 585 | | |
610 | 586 | | |
611 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
612 | 603 | | |
613 | 604 | | |
614 | 605 | | |
| |||
0 commit comments