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 2025/11/18 09:01:51 UTC
[PR] sched/task: remove the check for whether tcb is NULL [nuttx]
hujun260 opened a new pull request, #17342:
URL: https://github.com/apache/nuttx/pull/17342
## Summary
sched/task: remove the check for whether tcb is NULL
## Impact
sched
## Testing
test with ./tools/configure.sh -l qemu-armv8a:nsh_smp
ostest
End of test memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b94000 7b94000
ordblks 10 9
mxordblk 7b61118 7b65150
uordblks 1a588 1a590
fordblks 7b79a78 7b79a70
user_main: vfork() test
vfork_test: Child 95 ran successfully
user_main: smp call test
smp_call_test: Test start
smp_call_test: Call cpu 0, nowait
smp_call_test: Call cpu 0, wait
smp_call_test: Call cpu 1, nowait
smp_call_test: Call cpu 1, wait
smp_call_test: Call multi cpu, nowait
smp_call_test: Call in interrupt, wait
smp_call_test: Call multi cpu, wait
smp_call_test: Test success
Final memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 7b94000 7b94000
ordblks 2 9
mxordblk 7b81e58 7b65150
uordblks 12180 1a410
fordblks 7b81e80 7b79bf0
user_main: Exiting
ostest_main: Exiting with status 0
nsh>
--
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
Re: [PR] sched/task: remove the check for whether tcb is NULL [nuttx]
Posted by "hujun260 (via GitHub)" <gi...@apache.org>.
hujun260 commented on PR #17342:
URL: https://github.com/apache/nuttx/pull/17342#issuecomment-3562786383
> > also tested in real hardware
>
> Can you please list what real hardware in the testing section?
>
> I also, I have just modified your PR description to put the justifications from your comment there. Makes it easier for reviewers.
ok
--
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
Re: [PR] sched/task: remove the check for whether tcb is NULL [nuttx]
Posted by "hujun260 (via GitHub)" <gi...@apache.org>.
hujun260 commented on PR #17342:
URL: https://github.com/apache/nuttx/pull/17342#issuecomment-3556040496
> As with the last PR which got merged, can you please provide an explanation of why it is not possible for rtcb to be NULL in these contexts? Please include this justification in the PR summary.
>
> And if it is possible through user error or memory corruption, I suggest adding `DEBUGASSERT` statements to make sure the rtcb is not NULL when debugging.
>
> Also, what is the reason for this change?
This is a very minor optimization, primarily focused on performance.For example, in the ARM64 compilation of nxsched_gettid, there were 27 instructions before the modification and 20 instructions after the modification.
We should not call these functions before nx_start; therefore, this_task will not be empty. If these functions are called (before nx_start), the correct value cannot be obtained either.
We should modify the logic of the calling program, as there is no need for us to be compatible with unreasonable calling scenarios.A DEBUGASSERT can be added to help expose such issues.
--
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
Re: [PR] sched/task: remove the check for whether tcb is NULL [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 closed pull request #17342: sched/task: remove the check for whether tcb is NULL
URL: https://github.com/apache/nuttx/pull/17342
--
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
Re: [PR] sched/task: remove the check for whether tcb is NULL [nuttx]
Posted by "hujun260 (via GitHub)" <gi...@apache.org>.
hujun260 commented on PR #17342:
URL: https://github.com/apache/nuttx/pull/17342#issuecomment-3556042887
> @hujun260 please test in real hardware. In the past we saw patches that passed in qemu but failed in real hardware
also tested in real hardware
--
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
Re: [PR] sched/task: remove the check for whether tcb is NULL [nuttx]
Posted by "linguini1 (via GitHub)" <gi...@apache.org>.
linguini1 commented on PR #17342:
URL: https://github.com/apache/nuttx/pull/17342#issuecomment-3560874796
> also tested in real hardware
Can you please list what real hardware in the testing section?
I also, I have just modified your PR description to put the justifications from your comment there. Makes it easier for reviewers.
--
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