You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/27 10:09:10 UTC

[GitHub] [incubator-nuttx] zouboan opened a new pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

zouboan opened a new pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859


   ## Summary
   change from sched_time to eventtime to overcome the build error: 'struct sporadic_s' has no member named 'sched_time' , becuse the member to save  the last time that the scheduler ran is "eventtime" rather than "sched_time"
   ## Impact
   sporadic sched
   ## Testing
   ci
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#discussion_r835895324



##########
File path: sched/sched/sched_timerexpiration.c
##########
@@ -205,8 +205,8 @@ static uint32_t nxsched_cpu_scheduler(int cpu, uint32_t ticks,
        * committed to updating the scheduler for this TCB.
        */
 
-      sporadic->sched_time.tv_sec  = g_sched_time.tv_sec;
-      sporadic->sched_time.tv_nsec = g_sched_time.tv_nsec;
+      sporadic->eventtime = USEC2TICK(1000000 * (uint64_t)g_sched_time.tv_sec

Review comment:
       Maybe even use `sporadic->eventtime = SEC2TICK(g_sched_time.tv_sec) + NSEC2TICK(g_sched_time.tv_nsec)`? Or this will give bigger rounding error compared to current variant?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#issuecomment-1079918835


   Please squash to a single commit.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#issuecomment-1079909956


   @zouboan will you add a sample config (for `sim` or any other target) that enables sporadic policy in this PR? If yes, then I will postpone the merge of this PR until you add a config.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#discussion_r835894938



##########
File path: sched/sched/sched_timerexpiration.c
##########
@@ -205,8 +205,8 @@ static uint32_t nxsched_cpu_scheduler(int cpu, uint32_t ticks,
        * committed to updating the scheduler for this TCB.
        */
 
-      sporadic->sched_time.tv_sec  = g_sched_time.tv_sec;
-      sporadic->sched_time.tv_nsec = g_sched_time.tv_nsec;
+      sporadic->eventtime = USEC2TICK(1000000 * (uint64_t)g_sched_time.tv_sec

Review comment:
       ```suggestion
         sporadic->eventtime = USEC2TICK(USEC_PER_SEC * (uint64_t)g_sched_time.tv_sec
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko merged pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#issuecomment-1079902090


   @zouboan to avoid the break in the future, it's better to enable the sporadic policy in some config


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#discussion_r835898017



##########
File path: sched/sched/sched_timerexpiration.c
##########
@@ -205,8 +205,8 @@ static uint32_t nxsched_cpu_scheduler(int cpu, uint32_t ticks,
        * committed to updating the scheduler for this TCB.
        */
 
-      sporadic->sched_time.tv_sec  = g_sched_time.tv_sec;
-      sporadic->sched_time.tv_nsec = g_sched_time.tv_nsec;
+      sporadic->eventtime = SEC2TICK(g_sched_time.tv_sec) +
+      NSEC2TICK(g_sched_time.tv_nsec);

Review comment:
       ```suggestion
         sporadic->eventtime = SEC2TICK(g_sched_time.tv_sec) +
                               NSEC2TICK(g_sched_time.tv_nsec);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#discussion_r835895324



##########
File path: sched/sched/sched_timerexpiration.c
##########
@@ -205,8 +205,8 @@ static uint32_t nxsched_cpu_scheduler(int cpu, uint32_t ticks,
        * committed to updating the scheduler for this TCB.
        */
 
-      sporadic->sched_time.tv_sec  = g_sched_time.tv_sec;
-      sporadic->sched_time.tv_nsec = g_sched_time.tv_nsec;
+      sporadic->eventtime = USEC2TICK(1000000 * (uint64_t)g_sched_time.tv_sec

Review comment:
       Or maybe even use `sporadic->eventtime = SEC2TICK(g_sched_time.tv_sec) + NSEC2TICK(g_sched_time.tv_nsec)`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] zouboan commented on a change in pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
zouboan commented on a change in pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#discussion_r835896743



##########
File path: sched/sched/sched_timerexpiration.c
##########
@@ -205,8 +205,8 @@ static uint32_t nxsched_cpu_scheduler(int cpu, uint32_t ticks,
        * committed to updating the scheduler for this TCB.
        */
 
-      sporadic->sched_time.tv_sec  = g_sched_time.tv_sec;
-      sporadic->sched_time.tv_nsec = g_sched_time.tv_nsec;
+      sporadic->eventtime = USEC2TICK(1000000 * (uint64_t)g_sched_time.tv_sec

Review comment:
       I'm so sorry for my mistake,thanks very much for your help!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] zouboan commented on pull request #5859: sched/sched_timerexpiration.c: change from sched_time to eventtime

Posted by GitBox <gi...@apache.org>.
zouboan commented on pull request #5859:
URL: https://github.com/apache/incubator-nuttx/pull/5859#issuecomment-1079936930


   @pkarashchenko I enabled sporadic sched in sim:foc , because i have tesed sporadic sched in my custom board about foc


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org