From: Vu Pham <vuhuong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
David Dillow <dillowda-1Heg1YXhbW8@public.gmane.org>,
Linux RDMA list
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Bart Van Assche
<bart.vanassche-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [ofa-general][PATCH 3/4] SRP fail-over faster
Date: Thu, 29 Oct 2009 09:37:54 -0700 [thread overview]
Message-ID: <4AE9C4E2.7090801@mellanox.com> (raw)
In-Reply-To: <adavdhzs8iv.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Roland Dreier wrote:
> > + if (timer_pending(&target->qp_err_timer))
> > + del_timer_sync(&target->qp_err_timer);
> > +
> > spin_unlock_irq(target->scsi_host->host_lock);
>
> As was pointed out, I don't think you can do del_timer_sync while
> holding the lock, since the timer function takes the same lock.
>
>
I don't think that it takes the same lock (ie. host_lock).; however, the
problem is kernel configured CONFIG_LOCKDEP, del_timer_sync() call
local_irq_save/restore() to acquire/release timer->lockdep_map
> But I don't know that just switching to del_timer without the sync works
> here ... without the sync then the timeout function could still run any
> time after the del_timer, even after everything gets freed.
>
>
I will move del_timer_sync() of the host_lock. It's safe because we only
setup the same timer when the target state is ALIVE, however, target
state is already REMOVED when del_timer_sync() is called
> BTW the test of timer_pending isn't needed here... del_timer does the
> test internally anyway.
>
> I do agree it would be very good to improve the SRP error handling. I
> have some concerns about the overall design here -- it seems that if we
> handle connection failure and allow a new connection to proceed while
> cleaning up asynchronously, then this opens the door to a lot of
> complexity, and I don't see that complexity handled in this patchset.
> For example, the new connection could fail too before the old one is
> done cleaning up, etc, etc and we end up with an arbitrarily large queue
> of things waiting to clean up. Or maybe it really it is simpler than that.
>
>
It's is complicated; however, it is not as complicated as you said.
There are two flows/places where we clean-up connection and create new
one (ie. call srp_reconnect_target) in async event timer and scsi error
handling srp_reset_host(); however, in srp_reset_host() the patch 3/4
check for true condition of timer_pending or qp_in_error or target
state wrapped in host_lock then it won't call srp_reconnect_target(). It
left one flow/place to clean up / create new connection.
We destroy cm connection/cq/qp and create new connection/cq/qp in the
same flow/place; we also already clean up all scsi/srp resources
associated with old connection before create new one; therefore, the
only resources pended for clean up is cm/connection resources, qp/cq
low-level resources. And I believe the lower IB stack does that well.
> I think the best way to move this forward would be to post another
> cleaned up version of your patch set. Please try to reorganize things
> so each patch is reasonably self contained. Of course your patchset is
> taking multiple steps to improve things. But as much as possible,
> please try to avoid combining two things into a single patch, and
> conversely also try to avoid putting things into a patch that don't make
> sense without a later patch.
>
> Avoiding policy in the kernel as much as possible in terms of hard-coded
> timeouts etc is a good goal too.
>
> Also it would help to give each patch a separate descriptive subject,
> and put as much detail in the changelogs as you can.
>
> Thanks,
> Roland
>
I'll follow the instructions above, rework the patch set and resubmit
thanks,
-vu
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2009-10-29 16:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 22:57 [ofa-general][PATCH 3/4] SRP fail-over faster Vu Pham
[not found] ` <4AD3B453.3030109-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-13 11:09 ` Bart Van Assche
2009-10-14 18:12 ` Roland Dreier
[not found] ` <ada1vl5alqh.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-10-14 20:37 ` Vu Pham
[not found] ` <4AD63681.6080901-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-14 20:52 ` Roland Dreier
[not found] ` <adaljjd8zrj.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-10-14 21:08 ` Vu Pham
[not found] ` <4AD63DB1.3060906-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-14 22:47 ` Roland Dreier
[not found] ` <adahbu18uf5.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-10-14 23:59 ` Vu Pham
2009-10-15 1:39 ` David Dillow
[not found] ` <1255570760.13845.4.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2009-10-15 16:23 ` Vu Pham
[not found] ` <4AD74C88.8030604-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-15 19:25 ` David Dillow
[not found] ` <1255634715.29829.9.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2009-10-15 21:35 ` Jason Gunthorpe
[not found] ` <20091015213512.GW5191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-22 23:13 ` Vu Pham
[not found] ` <4AE0E71E.20309-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-22 23:33 ` David Dillow
[not found] ` <1256254394.1579.86.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2009-10-22 23:34 ` David Dillow
[not found] ` <1256254459.1579.87.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2009-10-22 23:38 ` David Dillow
[not found] ` <1256254692.1579.89.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2009-10-23 0:04 ` Vu Pham
[not found] ` <4AE0F309.5040201-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-23 0:16 ` David Dillow
[not found] ` <1256256984.1579.105.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2009-10-23 0:24 ` Vu Pham
[not found] ` <4AE0F7DA.20100-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-23 0:34 ` David Dillow
[not found] ` <1256258049.1598.8.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2009-10-23 16:50 ` Vu Pham
[not found] ` <4AE1DEEF.5070205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-23 22:08 ` David Dillow
[not found] ` <1256335698.10273.62.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2009-10-24 7:35 ` Vu Pham
[not found] ` <4AE2AE54.5020004-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2009-10-28 15:09 ` David Dillow
2009-10-29 18:42 ` Vladislav Bolkhovitin
2009-10-23 6:13 ` Bart Van Assche
[not found] ` <e2e108260910222313o27c8b97dh483d846b6c98e480-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-23 16:52 ` Vu Pham
2009-10-28 18:00 ` Roland Dreier
[not found] ` <adavdhzs8iv.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-10-29 16:37 ` Vu Pham [this message]
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=4AE9C4E2.7090801@mellanox.com \
--to=vuhuong-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=bart.vanassche-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=dillowda-1Heg1YXhbW8@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox