You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "hujun260 (via GitHub)" <gi...@apache.org> on 2023/09/18 06:30:21 UTC

[GitHub] [nuttx] hujun260 opened a new pull request, #10682: vnc_updater: use [enter|leave]_critical_section replace sched_[un]lock

hujun260 opened a new pull request, #10682:
URL: https://github.com/apache/nuttx/pull/10682

   ## Summary
   sched_[un]lock can not prohibit pre-emption in smp
   
   ## Impact
   
   ## Testing
   
   


-- 
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] [nuttx] xiaoxiang781216 commented on a diff in pull request #10682: vnc_updater: use [enter|leave]_critical_section replace sched_[un]lock

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #10682:
URL: https://github.com/apache/nuttx/pull/10682#discussion_r1329559927


##########
drivers/video/vnc/vnc_updater.c:
##########
@@ -181,23 +182,24 @@ static FAR struct vnc_fbupdate_s *
 vnc_alloc_update(FAR struct vnc_session_s *session)
 {
   FAR struct vnc_fbupdate_s *update;
+  irqstate_t flags;
 
   /* Reserve one element from the free list.  Lock the scheduler to assure
    * that the sq_remfirst() and the successful return from nxsem_wait are
    * atomic.  Of course, the scheduler will be unlocked while we wait.
    */
 
-  sched_lock();
   vnc_sem_debug(session, "Before alloc", 0);
+  flags = enter_critical_section();
 
   nxsem_wait_uninterruptible(&session->freesem);
 
   /* It is reserved.. go get it */
 
   update = (FAR struct vnc_fbupdate_s *)sq_remfirst(&session->updfree);

Review Comment:
   Yes, since it's accessed by two thread and then possible on SMP.



-- 
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] [nuttx] acassis commented on pull request #10682: vnc_updater: use [enter|leave]_critical_section replace sched_[un]lock

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #10682:
URL: https://github.com/apache/nuttx/pull/10682#issuecomment-1727811075

   @xiaoxiang781216 do you have a VNC client running on NuttX already? I'm willing to add one (at apps/ instead of kernel), I just took a look at https://github.com/wolfgangB33r/VNCView and it seems straightforward.


-- 
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] [nuttx] xiaoxiang781216 commented on pull request #10682: vnc_updater: use [enter|leave]_critical_section replace sched_[un]lock

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #10682:
URL: https://github.com/apache/nuttx/pull/10682#issuecomment-1728113452

   > @xiaoxiang781216 do you have a VNC client running on NuttX already?
   
   No, we just run VNCView from PC to connect NuttX.
   
   > I'm willing to add one (at apps/ instead of kernel), I just took a look at https://github.com/wolfgangB33r/VNCView and it seems straightforward.
   
   Yes, it will be useful in the reverse direction.


-- 
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] [nuttx] pkarashchenko commented on a diff in pull request #10682: vnc_updater: use [enter|leave]_critical_section replace sched_[un]lock

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #10682:
URL: https://github.com/apache/nuttx/pull/10682#discussion_r1328400502


##########
drivers/video/vnc/vnc_updater.c:
##########
@@ -181,23 +182,24 @@ static FAR struct vnc_fbupdate_s *
 vnc_alloc_update(FAR struct vnc_session_s *session)
 {
   FAR struct vnc_fbupdate_s *update;
+  irqstate_t flags;
 
   /* Reserve one element from the free list.  Lock the scheduler to assure
    * that the sq_remfirst() and the successful return from nxsem_wait are
    * atomic.  Of course, the scheduler will be unlocked while we wait.
    */
 
-  sched_lock();
   vnc_sem_debug(session, "Before alloc", 0);
+  flags = enter_critical_section();
 
   nxsem_wait_uninterruptible(&session->freesem);
 
   /* It is reserved.. go get it */
 
   update = (FAR struct vnc_fbupdate_s *)sq_remfirst(&session->updfree);

Review Comment:
   Can `session->updfree` be accessed from different cores?



-- 
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] [nuttx] xiaoxiang781216 merged pull request #10682: vnc_updater: use [enter|leave]_critical_section replace sched_[un]lock

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #10682:
URL: https://github.com/apache/nuttx/pull/10682


-- 
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