LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Pete Wyckoff <pw@osc.edu>
Cc: Roland Dreier <rdreier@cisco.com>,
	Olaf Kirch <olaf.kirch@oracle.com>,
	general@lists.openfabrics.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] Revert "IB/fmr_pool: ib_fmr_pool_flush() should flush all dirty FMRs"
Date: Tue, 26 Feb 2008 11:23:01 -0800	[thread overview]
Message-ID: <47C46715.2090603@panasas.com> (raw)
In-Reply-To: <20080226182731.GE7033@osc.edu>

Pete, the subject says "PATCH 1/2" but I didn't see any follow-up message
for PATCH 2/2. Just wondering :)

Benny

On Feb. 26, 2008, 10:27 -0800, Pete Wyckoff <pw@osc.edu> wrote:
> This reverts commit a3cd7d9070be417a21905c997ee32d756d999b38.
> 
> The original commit breaks iSER reliably, making it complain:
> 
>     iser: iser_reg_page_vec:ib_fmr_pool_map_phys failed: -11
> 
> The FMR cleanup thread runs ib_fmr_batch_release() as dirty
> entries build up.  This commit causes clean but used FMR
> entries also to be purged.  During that process, another thread
> can see that there are no free FMRs and fail, even though
> there should always have been enough available.
> 
> Signed-off-by: Pete Wyckoff <pw@osc.edu>
> ---
>  drivers/infiniband/core/fmr_pool.c |   21 ++++++---------------
>  1 files changed, 6 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c
> index 7f00347..4044fdf 100644
> --- a/drivers/infiniband/core/fmr_pool.c
> +++ b/drivers/infiniband/core/fmr_pool.c
> @@ -139,7 +139,7 @@ static inline struct ib_pool_fmr *ib_fmr_cache_lookup(struct ib_fmr_pool *pool,
>  static void ib_fmr_batch_release(struct ib_fmr_pool *pool)
>  {
>  	int                 ret;
> -	struct ib_pool_fmr *fmr, *next;
> +	struct ib_pool_fmr *fmr;
>  	LIST_HEAD(unmap_list);
>  	LIST_HEAD(fmr_list);
>  
> @@ -158,20 +158,6 @@ static void ib_fmr_batch_release(struct ib_fmr_pool *pool)
>  #endif
>  	}
>  
> -	/*
> -	 * The free_list may hold FMRs that have been put there
> -	 * because they haven't reached the max_remap count.
> -	 * Invalidate their mapping as well.
> -	 */
> -	list_for_each_entry_safe(fmr, next, &pool->free_list, list) {
> -		if (fmr->remap_count == 0)
> -			continue;
> -		hlist_del_init(&fmr->cache_node);
> -		fmr->remap_count = 0;
> -		list_add_tail(&fmr->fmr->list, &fmr_list);
> -		list_move(&fmr->list, &unmap_list);
> -	}
> -
>  	list_splice(&pool->dirty_list, &unmap_list);
>  	INIT_LIST_HEAD(&pool->dirty_list);
>  	pool->dirty_len = 0;
> @@ -384,6 +370,11 @@ void ib_destroy_fmr_pool(struct ib_fmr_pool *pool)
>  
>  	i = 0;
>  	list_for_each_entry_safe(fmr, tmp, &pool->free_list, list) {
> +		if (fmr->remap_count) {
> +			INIT_LIST_HEAD(&fmr_list);
> +			list_add_tail(&fmr->fmr->list, &fmr_list);
> +			ib_unmap_fmr(&fmr_list);
> +		}
>  		ib_dealloc_fmr(fmr->fmr);
>  		list_del(&fmr->list);
>  		kfree(fmr);


  reply	other threads:[~2008-02-26 19:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080225225330.GA3316@osc.edu>
     [not found] ` <ada1w70zlkf.fsf@cisco.com>
2008-02-26 18:26   ` [PATCH 0/2] (was Re: [ofa-general] fmr pool free_list empty) Pete Wyckoff
2008-02-26 18:27     ` [PATCH 1/2] Revert "IB/fmr_pool: ib_fmr_pool_flush() should flush all dirty FMRs" Pete Wyckoff
2008-02-26 19:23       ` Benny Halevy [this message]
2008-02-26 19:39         ` Matthew Wilcox
2008-02-26 19:47           ` Benny Halevy
2008-02-29 21:29       ` Roland Dreier
2008-02-26 18:27     ` [PATCH 2/2] ib fmr pool: flush used clean entries Pete Wyckoff
2008-02-26 20:09       ` [ofa-general] " Roland Dreier
2008-02-26 21:58         ` Olaf Kirch
2008-02-29 21:32       ` Roland Dreier

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=47C46715.2090603@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=general@lists.openfabrics.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=olaf.kirch@oracle.com \
    --cc=pw@osc.edu \
    --cc=rdreier@cisco.com \
    /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;
as well as URLs for NNTP newsgroup(s).