You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2025/03/16 08:01:35 UTC

[PR] sched: simplify call of get current tcb [nuttx]

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

   ## Summary
   
   sched: simplify call of get current tcb
   
   Replace get current tcb method from nxsched_get_tcb(nxsched_gettid()) to this_task(),
   change two function calls with inline function to improve performance:
   
   FAR struct tcb_s *tcb = nxsched_get_tcb(nxsched_gettid());
   FAR struct tcb_s *tcb = this_task();
   
   Signed-off-by: chao an <an...@bytedance.com>
   
   
   ## Impact
   
   N/A
   
   ## Testing
   
   sim/nsh,ostest


-- 
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: simplify call of get current tcb [nuttx]

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

   Restarted the CI Check, it failed at Docker Login.


-- 
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: simplify call of get current tcb [nuttx]

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

   Sorry @simbit18: Would you know why msys2 is failing with this `make ... sig_send` error:
   - https://github.com/apache/nuttx/pull/15998#issuecomment-2727361352
   
   But I tried the same patch at NuttX Mirror Repo, and msys2 builds OK:
   https://github.com/NuttX/nuttx/actions/runs/13883078031/job/38844177657#step:9:610
   ```text
   Configuration/Tool: qemu-armv8a/nsh_smp
     Building NuttX...
     [1/1] Normalize qemu-armv8a/nsh_smp
   ```
   
   This is after I applied the exact same changes for this PR:
   - https://github.com/NuttX/nuttx/commit/c30da100a9eace0bdd83fb1e626a745fc72bf3b0
   
   Could this be a `make` timeout? Or maybe too many `make` processes?
   
   I'm rebuilding this PR scratch, one more time to be really sure. Thanks :-)
   https://github.com/apache/nuttx/actions/runs/13881524899/job/38844839854
   


-- 
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: simplify call of get current tcb [nuttx]

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


-- 
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: simplify call of get current tcb [nuttx]

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

   [**\[Experimental Bot, please feedback here\]**](https://github.com/search?q=repo%3Aapache%2Fnuttx+13552&type=issues)
   
   
   
   No.  While the summary provides a reasonable description of the change itself, it lacks crucial context.  Here's what's missing and why it's important for a NuttX PR:
   
   * **Why is this change *necessary*?**  Simply stating that it improves performance is insufficient.  What performance problem are you solving? Are there benchmarks demonstrating the improvement?  Is this a bottleneck in a real-world application?  Without this justification, the change seems premature.
   * **Functional part:** While "sched" is mentioned, it would be better to be more specific. Which scheduler function(s) are affected?
   * **Impact:**  Claiming "N/A" for impact is highly unlikely.  Even seemingly small changes can have unexpected consequences.  At a minimum, this change affects code size (potentially positive or negative). It *could* impact compatibility if any external code relies on the specific timing or behavior of the original functions.  A thorough review requires understanding these potential impacts.
   * **Testing:**  The testing description is far too vague.  "sim/nsh,ostest" doesn't say what tests were run, what the results were, or how the "before" and "after" differ.  Concrete evidence of improvement is required.  The logs sections are also empty, providing no data to support the claim of improved performance.
   
   
   Therefore, the PR, as described, does *not* meet the NuttX requirements. It needs substantial revision to provide the missing context, justification, and testing evidence.
   


-- 
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: simplify call of get current tcb [nuttx]

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

   Rebuild of msys2 finally succeeds yay! This is 4th time we're building, very strange...
   https://github.com/apache/nuttx/actions/runs/13881524899/job/38844839854#step:9:668


-- 
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: simplify call of get current tcb [nuttx]

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

   Thanks @simbit18: I'll watch if this error happens again, I suspect GitHub's Windows Servers won't handle `make` correctly sometimes...
   ```text
   0 [sig] make 42581 sig_send:
   error sending signal 11, pid 42581, pipe handle 0x150, nb 0, packsize 192,
   Win32 error 0
   ```


-- 
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: simplify call of get current tcb [nuttx]

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

   [**\[Experimental Bot, please feedback here\]**](https://github.com/search?q=repo%3Aapache%2Fnuttx+15779&type=issues)
   
   Build and Test Successful (milkv_duos:nsh)
   https://gitlab.com/lupyuen/nuttx-build-log/-/snippets/4826879
   ```text
   $ git clone https://github.com/anchao/nuttx nuttx --branch 25031602
   $ git clone https://github.com/apache/nuttx-apps apps --branch master
   $ pushd nuttx
   $ git reset --hard HEAD
   HEAD is now at 86d7c9b19d sched: simplify call of get current tcb
   $ popd
   $ pushd apps
   $ git reset --hard HEAD
   HEAD is now at 0639a2ad7 boot/nxboot: enhance bootloader capabilities and decision logic
   $ popd
   NuttX Source: https://github.com/apache/nuttx/tree/86d7c9b19d2039a9a5f63c5edb5232e4b099d488
   NuttX Apps: https://github.com/apache/nuttx-apps/tree/0639a2ad7ba473463923ce377b0227763bf051f9
   $ cd nuttx
   $ tools/configure.sh milkv_duos:nsh
   $ make -j
   $ make -j export
   $ pushd ../apps
   $ ./tools/mkimport.sh -z -x ../nuttx/nuttx-export-10.4.0.tar.gz
   $ make -j import
   $ popd
   $ genromfs -f initrd -d ../apps/bin -V NuttXBootVol
   $ head -c 65536 /dev/zero
   $ cat nuttx.bin /tmp/nuttx.pad initrd
   $ scp Image tftpserver:/tftpboot/Image-sg2000
   $ cd /home/luppy/nuttx-build-farm
   $ ssh tftpserver
   OpenSBI v0.9
   nsh> uname -a
   NuttX 10.4.0 86d7c9b19d Mar 16 2025 16:47:24 risc-v milkv_duos
   nsh> ostest
   arena       81000    81000
   ordblks         2        3
   mxordblk    7cff8    78ff8
   uordblks     2660     4570
   fordblks    7e9a0    7ca90
   user_main: Exiting
   ostest_main: Exiting with status 0
   nsh> Now running https://github.com/lupyuen/nuttx-build-farm/blob/main/oz64-power.sh off
   ----- Power off Oz64
   []
   ```
   


-- 
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: simplify call of get current tcb [nuttx]

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

   > Sorry @simbit18: Would you know why msys2 is failing with this `make ... sig_send` error:
   > 
   > * [sched: simplify call of get current tcb #15998 (comment)](https://github.com/apache/nuttx/pull/15998#issuecomment-2727361352)
   > 
   > But I tried the same patch at NuttX Mirror Repo, and msys2 builds OK: https://github.com/NuttX/nuttx/actions/runs/13883078031/job/38844177657#step:9:610
   > 
   > ```
   > Configuration/Tool: qemu-armv8a/nsh_smp
   >   Building NuttX...
   >   [1/1] Normalize qemu-armv8a/nsh_smp
   > ```
   > 
   > This is after I applied the exact same changes for this PR:
   > 
   > * [NuttX@c30da10](https://github.com/NuttX/nuttx/commit/c30da100a9eace0bdd83fb1e626a745fc72bf3b0)
   > 
   > Could this be a `make` timeout? Or maybe too many `make` processes?
   > 
   > I'm rebuilding this PR scratch, one more time to be really sure. Thanks :-) https://github.com/apache/nuttx/actions/runs/13881524899/job/38844839854
   
   Hi @lupyuen 
   
   I think it is due to a momentary problem with the windows runner /job
   
   was in debug mode
   
   ```
   ##[debug]Starting: Set up job
   Current runner version: '[2](https://github.com/apache/nuttx/actions/runs/13881524899/job/38843615878#step:1:2).322.0'
   Operating System
   Runner Image
   Runner Image Provisioner
   GITHUB_TOKEN Permissions
   Secret source: None
   ##[debug]Primary repository: apache/nuttx
   Prepare workflow directory
   ```
   https://github.com/apache/nuttx/actions/runs/13881524899/job/38843615878#step:1:1
   
   should normally be 
   
   ```
   Current runner version: '2.322.0'
   Operating System
   Runner Image
   Runner Image Provisioner
   GITHUB_TOKEN Permissions
   Secret source: Actions
   Prepare workflow directory
   
   ```
   
   https://github.com/NuttX/nuttx/actions/runs/13883078031/job/38844177657#step:1:1
   
   
   to be sure I'll do a test locally 
   


-- 
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: simplify call of get current tcb [nuttx]

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

   @nuttxpr test milkv_duos: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: simplify call of get current tcb [nuttx]

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

   test -> **ok**
   
   ```
   D:\qemu\arm\xpack-qemu-arm-8.2.2-1\bin
   qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic -machine virt,virtualization=on,gic-version=3 -net none -chardev st
   dio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel nuttx
   - Ready to Boot Primary CPU
   - Boot from EL2
   - Boot from EL1
   - Boot to C runtime for OS Initialize
   - Ready to Boot Second CPU
   - Boot from EL2
   - Boot from EL1
   - Boot to C runtime for OS Initialize
   
   NuttShell (NSH)
   nsh> uname -a
   NuttX 0.0.0 86d7c9b1 Mar 17 2025 12:01:03 arm64 qemu-armv8a
   nsh> help
   help usage:  help [-v] [<cmd>]
   
       .           cmp         false       mkrd        reboot      uname
       [           dirname     fdinfo      mount       rm          umount
       ?           dd          free        mv          rmdir       unset
       alias       df          help        mw          set         uptime
       unalias     dmesg       hexdump     pidof       sleep       usleep
       basename    echo        kill        poweroff    source      watch
       break       env         pkill       quit        test        xd
       cat         exec        ls          printf      time        wait
       cd          exit        mkdir       ps          true
       cp          expr        mkfifo      pwd         truncate
   
   Builtin Apps:
       gcov        hello       osperf      sh          taskset
       getprime    nsh         ostest      smp
   nsh> ostest
   ```
   ```
   Final memory usage:
   VARIABLE  BEFORE   AFTER
   ======== ======== ========
   arena     7b99000  7b99000
   ordblks         2        6
   mxordblk  7b86c90  7b624f8
   uordblks    12338    1b308
   fordblks  7b86cc8  7b7dcf8
   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: simplify call of get current tcb [nuttx]

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

   Very strange. Why is msys2 failing with this error? I have already rebuilt it...
   https://github.com/apache/nuttx/actions/runs/13881524899/job/38843615878#step:9:663
   ```text
   Configuration/Tool: qemu-armv8a/nsh_smp
     Building NuttX...
         0 [sig] make 42581 sig_send: error sending signal 11, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
     15003 [main] make 42581 sig_send: error sending signal -72, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   1658893 [sig] make 42581 sig_send: error sending signal 11, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   1705617 [main] make 42581 sig_send: error sending signal -72, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   3267561 [main] make 42581 sig_send: error sending signal -72, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   3408784 [sig] make 42581 sig_send: error sending signal 11, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   4830834 [main] make 42581 sig_send: error sending signal -72, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   4972335 [sig] make 42581 sig_send: error sending signal 11, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   6395022 [main] make 42581 sig_send: error sending signal -71, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   make[2]: *** [/d/a/nuttx/nuttx/sources/apps/Application.mk:278: .built] Error 127
   6570455 [sig] make 42581 sig_send: error sending signal 11, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   7957734 [main] make 42581 sig_send: error sending signal -71, pid 42581, pipe handle 0x150, nb 0, packsize 192, Win32 error 0
   make[2]: Target 'all' not remade because of errors.
   D:\a\nuttx\nuttx\sources\tools\gcc-aarch64-none-elf\bin\aarch64-none-elf-ld.exe: D:/a/nuttx/nuttx/sources/nuttx/staging\libapps.a(builtin_list.c.d.a.nuttx.nuttx.sources.apps.builtin_1.o):(.rodata.g_builtins+0x40): undefined reference to `hello_main'
   make[1]: *** [Makefile:187: nuttx] Error 1
   make: *** [tools/Unix.mk:552: nuttx] Error 2
   make: Target 'all' not remade because of errors.
   /d/a/nuttx/nuttx/sources/nuttx/tools/testbuild.sh: line 385: /d/a/nuttx/nuttx/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
     [1/1] Normalize qemu-armv8a/nsh_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