Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gen 3] System thread wakeup on cloud data #2113

Merged
merged 5 commits into from
Jun 3, 2020

Conversation

avtolstoy
Copy link
Member

Problem

With threading enabled system thread is only scheduled to run every 100ms, or when a task is posted into its queue. This negatively affects OTA times.

Solution

This PR attempts to add support for system thread wakeup whenever data arrives on a cloud socket. This is only support at the moment for Gen 3 platforms by adding SIOCSPGRP ioctl support to LwIP and using threads instead of normal pid_t (should we change that and still use pid_t and cast from/to abstract thread handles?).

Steps to Test

  1. Use cellular Gen 3 platforms
  2. Run a simple blank app with threading disabled, perform OTA of a system part, capture OTA time/transfer rate (available in logs)
  3. Enable threading, perform OTA of a system part, capture time/transfer rate (available in logs)
  4. Compare the numbers, they should be similar

Example App

N/A

References


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

Copy link
Member

@sergeuz sergeuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't expect a PR implementing this to be so nice and concise. Well done 👍

@@ -111,3 +111,7 @@ ssize_t sock_recvmsg(int s, struct msghdr *message, int flags) {
ssize_t sock_sendmsg(int s, const struct msghdr *message, int flags) {
return lwip_sendmsg(s, message, flags);
}

int sock_ioctl(int s, long cmd, void* argp) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's expose it via dynalib as well,

@avtolstoy avtolstoy added ready to merge PR has been reviewed and tested DO NOT MERGE and removed DO NOT MERGE needs review labels May 29, 2020
@avtolstoy avtolstoy force-pushed the feature/poc-system-thread-wakeup-on-cloud-data branch from 63812fb to ab8d8d1 Compare June 3, 2020 13:03
@avtolstoy avtolstoy modified the milestones: 2.1.0, 2.0.0 Jun 3, 2020
@avtolstoy avtolstoy merged commit 60d01f7 into develop Jun 3, 2020
@avtolstoy avtolstoy deleted the feature/poc-system-thread-wakeup-on-cloud-data branch June 3, 2020 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ready to merge PR has been reviewed and tested
Projects
None yet
2 participants