diff options
| author | Pete Wyckoff <pw@osc.edu> | 2008-02-26 13:27:53 -0500 |
|---|---|---|
| committer | Roland Dreier <rolandd@cisco.com> | 2008-02-29 16:31:48 -0500 |
| commit | 331552925d17ffa2f5c676e282d4fd37c852d9e3 (patch) | |
| tree | 6dba57eb575399cef6e7498110670209ee99f148 /drivers | |
| parent | 35fb5340e3de5dff86923eb0cded748c3a6e05e7 (diff) | |
IB/fmr_pool: Flush all dirty FMRs from ib_fmr_pool_flush()
Commit a3cd7d90 ("IB/fmr_pool: ib_fmr_pool_flush() should flush all
dirty FMRs") caused a regression for iSER and was reverted in
e5507736.
This change attempts to redo the original patch so that all used FMR
entries are flushed when ib_flush_fmr_pool() is called without
affecting the normal FMR pool cleaning thread. Simply move used
entries from the clean list onto the dirty list in ib_flush_fmr_pool()
before letting the cleanup thread do its job.
Signed-off-by: Pete Wyckoff <pw@osc.edu>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/infiniband/core/fmr_pool.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c index 4044fdf62cc2..06d502c06a4d 100644 --- a/drivers/infiniband/core/fmr_pool.c +++ b/drivers/infiniband/core/fmr_pool.c | |||
| @@ -398,8 +398,23 @@ EXPORT_SYMBOL(ib_destroy_fmr_pool); | |||
| 398 | */ | 398 | */ |
| 399 | int ib_flush_fmr_pool(struct ib_fmr_pool *pool) | 399 | int ib_flush_fmr_pool(struct ib_fmr_pool *pool) |
| 400 | { | 400 | { |
| 401 | int serial = atomic_inc_return(&pool->req_ser); | 401 | int serial; |
| 402 | struct ib_pool_fmr *fmr, *next; | ||
| 403 | |||
| 404 | /* | ||
| 405 | * The free_list holds FMRs that may have been used | ||
| 406 | * but have not been remapped enough times to be dirty. | ||
| 407 | * Put them on the dirty list now so that the cleanup | ||
| 408 | * thread will reap them too. | ||
| 409 | */ | ||
| 410 | spin_lock_irq(&pool->pool_lock); | ||
| 411 | list_for_each_entry_safe(fmr, next, &pool->free_list, list) { | ||
| 412 | if (fmr->remap_count > 0) | ||
| 413 | list_move(&fmr->list, &pool->dirty_list); | ||
| 414 | } | ||
| 415 | spin_unlock_irq(&pool->pool_lock); | ||
| 402 | 416 | ||
| 417 | serial = atomic_inc_return(&pool->req_ser); | ||
| 403 | wake_up_process(pool->thread); | 418 | wake_up_process(pool->thread); |
| 404 | 419 | ||
| 405 | if (wait_event_interruptible(pool->force_wait, | 420 | if (wait_event_interruptible(pool->force_wait, |
