Hi, Thanks for the responses, they are very much appreciated.
I suspected that the scheduler lock can be removed without too severe side effects (I made a PR of it already). I made a PR of removing it from nsh_fileapps already since I think that is potentially a more critical place to fix due to the file I/O. Loading the process into memory can take a relatively long time. I did notice that the builtin apps do the same but deemed that as not-so-critical because the builtins are already in memory. I did not immediately fix it due to regression mitigation but I can fix the builtin apps as well if you wish. Br, Ville Juven On Wed, Oct 25, 2023 at 5:55 PM Gregory Nutt <spudan...@gmail.com> wrote: > On 10/25/2023 8:48 AM, Gregory Nutt wrote: > > On 10/25/2023 8:18 AM, Alan C. Assis wrote: > >> On 10/25/23, Nathan Hartman<hartman.nat...@gmail.com> wrote: > >>> On Wed, Oct 25, 2023 at 5:16 AM Ville Juven<ville.ju...@gmail.com> > wrote: > >>> > >>>> Hi all, > >>>> > >>>> I noticed that when spawning a new task/process from a file in > >>>> nsh_fileapps, the scheduler is locked prior to calling posix_spawn(), > >>>> which > >>>> does the file loading into memory etc. > >>>> > >>>> I noticed one issue with this; when the file size is large (in the > order > >>>> of > >>>> MB) the scheduler is locked for very long periods at a time, in the > order > >>>> of hundreds of milliseconds. > The same logic exists in apps/nshlib/nsh_builtin.c. In fact, it looks > like one was just cloned from the other. Both should behave the same way. >