Closed
Bug 1171994
Opened 10 years ago
Closed 10 years ago
Improve RIL I/O code
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(tracking-b2g:backlog, firefox42 fixed)
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: tzimmermann, Assigned: tzimmermann)
References
Details
Attachments
(6 files, 6 obsolete files)
8.91 KB,
patch
|
hsinyi
:
review+
|
Details | Diff | Splinter Review |
18.76 KB,
patch
|
tzimmermann
:
review+
|
Details | Diff | Splinter Review |
9.97 KB,
patch
|
tzimmermann
:
review+
|
Details | Diff | Splinter Review |
4.68 KB,
patch
|
hsinyi
:
review+
|
Details | Diff | Splinter Review |
10.78 KB,
patch
|
tzimmermann
:
review+
|
Details | Diff | Splinter Review |
13.14 KB,
patch
|
tzimmermann
:
review+
|
Details | Diff | Splinter Review |
The IPC code that transfers messages between RIL worker and I/O thread always sends messages through the main thread. We can probably improve this by transferring messages without the intermediate step.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8616680 -
Flags: review?(htsai)
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8616681 -
Flags: review?(htsai)
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8616684 -
Flags: review?(htsai)
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8616685 -
Flags: review?(htsai)
Assignee | ||
Comment 5•10 years ago
|
||
Attachment #8616687 -
Flags: review?(htsai)
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8616688 -
Flags: review?(htsai)
Assignee | ||
Comment 7•10 years ago
|
||
It seems to me that the content of Ril.{cpp,h} is more about workers than IPC. Would it make sense to move the code to dom/system/gonk?
Assignee | ||
Comment 8•10 years ago
|
||
Comment 9•10 years ago
|
||
Thomas, I don't want to let you down but I will be occupied by product line resource allocation meeting this week. That means, I won't be able to start the review work until next week :( If this is urgent, feel free to ask other peer's review.
Assignee | ||
Comment 10•10 years ago
|
||
I see. But it's not urgent, so next week would also be OK.
It's actually hard to find other reviewers for this code. Maybe Kyle can help here as well.
Flags: needinfo?(kyle)
Comment 11•10 years ago
|
||
Outside of saying your indentation is off in Patch 1's RilSocket.cpp (function name length changed but multi-line argument indents didn't :) ), I'd like to stay out of this if possible. I'm not on the FxOS team anymore, so the more eyes we can get on this from FxOS members who may be more directly involved, the better.
Flags: needinfo?(kyle)
Comment 12•10 years ago
|
||
Comment on attachment 8616680 [details] [diff] [review]
[01] Bug 1171994: Add |RilSocket| and |RilSocketConsumer|
Review of attachment 8616680 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me!
Attachment #8616680 -
Flags: review?(htsai) → review+
Comment 14•10 years ago
|
||
Comment on attachment 8616681 [details] [diff] [review]
[02] Bug 1171994: Forward received RIL socket I/O via |WorkerCrossThreadDispatcher|
Review of attachment 8616681 [details] [diff] [review]:
-----------------------------------------------------------------
::: ipc/ril/RilSocket.cpp
@@ +206,4 @@
> }
>
> private:
> + RilSocketIO* mIO;
Can you explain that why we don't need it to be nsRefPtr?
Comment 15•10 years ago
|
||
Comment on attachment 8616684 [details] [diff] [review]
[03] Bug 1171994: Separate RIL I/O interfaces
Review of attachment 8616684 [details] [diff] [review]:
-----------------------------------------------------------------
This part looks good to me.
Attachment #8616684 -
Flags: review?(htsai) → review+
Comment 16•10 years ago
|
||
Comment on attachment 8616685 [details] [diff] [review]
[04] Bug 1171994: Store an instance of |RilWorker| for each RIL connection
Review of attachment 8616685 [details] [diff] [review]:
-----------------------------------------------------------------
::: ipc/ril/Ril.h
@@ +41,5 @@
> + void UnregisterConsumer(unsigned int aClientId);
> +
> + static nsTArray<nsAutoPtr<RilWorker>> sRilWorkers;
> +
> + mozilla::dom::workers::WorkerCrossThreadDispatcher* mDispatcher;
Could you explain why this doesn't need to be nsRefPtr?
Assignee | ||
Comment 17•10 years ago
|
||
Hi!
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #14)
> Comment on attachment 8616681 [details] [diff] [review]
> [02] Bug 1171994: Forward received RIL socket I/O via
> |WorkerCrossThreadDispatcher|
>
> Review of attachment 8616681 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: ipc/ril/RilSocket.cpp
> @@ +206,4 @@
> > }
> >
> > private:
> > + RilSocketIO* mIO;
>
> Can you explain that why we don't need it to be nsRefPtr?
This field is stored in |ReceiveTask|, which is send from the I/O thread to the consumer thread. Releasing the instance of |mIO| requires closing the socket. The closing is written to only happen *after* all other tasks have been processed, so any |ReceiveTask| would have been processed at this point. New tasks aren't created after the socket has been closed.
Assignee | ||
Comment 18•10 years ago
|
||
> ::: ipc/ril/Ril.h
> @@ +41,5 @@
> > + void UnregisterConsumer(unsigned int aClientId);
> > +
> > + static nsTArray<nsAutoPtr<RilWorker>> sRilWorkers;
> > +
> > + mozilla::dom::workers::WorkerCrossThreadDispatcher* mDispatcher;
>
> Could you explain why this doesn't need to be nsRefPtr?
Using |nsRefPtr| sounds reasonable. Currently |RilConsumer| holds the reference, but that might lead to problems in some corner cases without an instance of this class. I'll fix the patch.
Comment 19•10 years ago
|
||
Comment on attachment 8616681 [details] [diff] [review]
[02] Bug 1171994: Forward received RIL socket I/O via |WorkerCrossThreadDispatcher|
Review of attachment 8616681 [details] [diff] [review]:
-----------------------------------------------------------------
r+ after comment 17, thanks.
Attachment #8616681 -
Flags: review?(htsai) → review+
Comment 20•10 years ago
|
||
Comment on attachment 8616687 [details] [diff] [review]
[05] Bug 1171994: Use |RilSocket| to handle RIL messages on the RIL worker
Review of attachment 8616687 [details] [diff] [review]:
-----------------------------------------------------------------
::: ipc/ril/Ril.cpp
@@ +353,5 @@
> + }
> +
> +private:
> + unsigned int mClientId;
> + WorkerCrossThreadDispatcher* mDispatcher;
sorry again, why doesn't this need to be nsRefPtr?
Updated•10 years ago
|
Attachment #8616688 -
Flags: review?(htsai) → review+
Assignee | ||
Comment 21•10 years ago
|
||
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #20)
> Comment on attachment 8616687 [details] [diff] [review]
> [05] Bug 1171994: Use |RilSocket| to handle RIL messages on the RIL worker
>
> Review of attachment 8616687 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: ipc/ril/Ril.cpp
> @@ +353,5 @@
> > + }
> > +
> > +private:
> > + unsigned int mClientId;
> > + WorkerCrossThreadDispatcher* mDispatcher;
>
> sorry again, why doesn't this need to be nsRefPtr?
Another case where holding a reference makes sense. Will be fixed in next version.
I tried to minimize references to keep the overhead low. In the current code base the clients are registered while the WCTD is around, so all this works without ref-counting. But now that I look at the patches, I can see the corner cases where it might fail. It's probably safer to use ref-counting everywhere.
Assignee | ||
Comment 22•10 years ago
|
||
Changes since v1:
- fixed indention
Attachment #8616680 -
Attachment is obsolete: true
Attachment #8632666 -
Flags: review+
Assignee | ||
Comment 23•10 years ago
|
||
Changes since v1:
- hold reference to WCTD in RIL socket classes
Attachment #8616681 -
Attachment is obsolete: true
Attachment #8632667 -
Flags: review+
Assignee | ||
Comment 24•10 years ago
|
||
Changes since v1:
- hold reference to WCTD in RIL worker class
Attachment #8616685 -
Attachment is obsolete: true
Attachment #8616685 -
Flags: review?(htsai)
Attachment #8632668 -
Flags: review?(htsai)
Assignee | ||
Comment 25•10 years ago
|
||
Changes since v1:
- hold reference to WCTD in |RegisterConsumerTask|
Attachment #8616687 -
Attachment is obsolete: true
Attachment #8616687 -
Flags: review?(htsai)
Attachment #8632670 -
Flags: review?(htsai)
Assignee | ||
Comment 26•10 years ago
|
||
Changes since v1:
- rebased onto latest [01]-[05]
Attachment #8616688 -
Attachment is obsolete: true
Attachment #8632671 -
Flags: review+
Comment 27•10 years ago
|
||
Comment on attachment 8632668 [details] [diff] [review]
[04] Bug 1171994: Store an instance of |RilWorker| for each RIL connection (v2)
Review of attachment 8632668 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me!
Attachment #8632668 -
Flags: review?(htsai) → review+
Comment 28•10 years ago
|
||
Comment on attachment 8632670 [details] [diff] [review]
[05] Bug 1171994: Use |RilSocket| to handle RIL messages on the RIL worker (v2)
Review of attachment 8632670 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for the work, Thomas :)
Attachment #8632670 -
Flags: review?(htsai) → review+
Assignee | ||
Comment 29•10 years ago
|
||
Comment 30•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/463528fcee4d
https://hg.mozilla.org/integration/b2g-inbound/rev/31cdbef9fe22
https://hg.mozilla.org/integration/b2g-inbound/rev/14ec8c87f973
https://hg.mozilla.org/integration/b2g-inbound/rev/2dc847e4650c
https://hg.mozilla.org/integration/b2g-inbound/rev/ea00769b70df
Assignee | ||
Comment 31•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/463528fcee4d
https://hg.mozilla.org/mozilla-central/rev/31cdbef9fe22
https://hg.mozilla.org/mozilla-central/rev/14ec8c87f973
https://hg.mozilla.org/mozilla-central/rev/2dc847e4650c
https://hg.mozilla.org/mozilla-central/rev/ea00769b70df
https://hg.mozilla.org/mozilla-central/rev/46061230e77a
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
![]() |
||
Comment 33•10 years ago
|
||
This caused a sanity blocker "Unable to make calls" for Flame and Aries devices, need this backed out ASAP.
Whiteboard: [backout-asap]
Comment 34•10 years ago
|
||
Backed out at the request of QA and nightlies respun.
https://hg.mozilla.org/mozilla-central/rev/16e30af059b7
Updated•10 years ago
|
Whiteboard: [backout-asap]
Assignee | ||
Comment 35•10 years ago
|
||
Changes since v2:
- store outgoing commands in send queue until connection to rild has been established
Attachment #8632670 -
Attachment is obsolete: true
Attachment #8634664 -
Flags: review+
Assignee | ||
Comment 36•10 years ago
|
||
Assignee | ||
Comment 37•10 years ago
|
||
Hi Hsinyi,
I noticed that the RIL worker starts sending commands to rild before the connection is fully established. So the first few commands got lost and the RIL worker was forever waiting for their responses.
While it was trivial to fix, the RIL worker seems fragile when commands get lost. Is there a plan to only start sending after the connection has been established? Or to integrate the socket code more closely into the RIL worker?
Once there was bug 760649, but it was closed a few weeks ago.
Flags: needinfo?(htsai)
Comment 38•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/abcbb5775c22
https://hg.mozilla.org/integration/b2g-inbound/rev/883f6b94c7d6
https://hg.mozilla.org/integration/b2g-inbound/rev/70c1efea545d
https://hg.mozilla.org/integration/b2g-inbound/rev/1cc8098ed0aa
https://hg.mozilla.org/integration/b2g-inbound/rev/325289d40058
https://hg.mozilla.org/integration/b2g-inbound/rev/919c11b60471
Assignee | ||
Comment 39•10 years ago
|
||
Comment 40•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/abcbb5775c22
https://hg.mozilla.org/mozilla-central/rev/883f6b94c7d6
https://hg.mozilla.org/mozilla-central/rev/70c1efea545d
https://hg.mozilla.org/mozilla-central/rev/1cc8098ed0aa
https://hg.mozilla.org/mozilla-central/rev/325289d40058
https://hg.mozilla.org/mozilla-central/rev/919c11b60471
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S3 (24Jul)
Comment 41•10 years ago
|
||
I'd like to make sure it's also on another module owner, Edgar's radar ;)
Flags: needinfo?(echen)
Comment 42•10 years ago
|
||
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #37)
> Hi Hsinyi,
>
> I noticed that the RIL worker starts sending commands to rild before the
> connection is fully established. So the first few commands got lost and the
> RIL worker was forever waiting for their responses.
>
> While it was trivial to fix, the RIL worker seems fragile when commands get
> lost. Is there a plan to only start sending after the connection has been
> established? Or to integrate the socket code more closely into the RIL
> worker?
Yes, we could have better handling in ril code. RIL worker now doesn't have too much information about the underlying status. We could expose more information to ril worker and have better handling. I have filed bug 1191256 for this. Thank you.
>
> Once there was bug 760649, but it was closed a few weeks ago.
Flags: needinfo?(htsai)
Flags: needinfo?(echen)
You need to log in
before you can comment on or make changes to this bug.
Description
•