Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] add support for specifying -j or -l arguments to make. #996

Open
Emimendoza opened this issue Aug 28, 2024 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@Emimendoza
Copy link

There is little control on what arguments are passed to make during the compilation of the kernel. Ones that would be nice to control would be the -j or -l argument. I use distcc and have a compile server of 72 threads. I compile the kernel for my local machine which only has 16 total threads. I use gentoo which means that these lines within the install.sh decide how many threads to use:

  if [ "$_force_all_threads" = "true" ]; then
    _thread_num=`nproc`
  else
    _thread_num=`expr \`nproc\` / 4`
    if [ "$_thread_num" = "0" ]; then
      _thread_num=1
    fi
  fi

so the only control I have is to compile with 16 or 4 threads. Not ideal considering I have 72 I could use. So it would be nice if the force all threads option would be replaced with a "how many threads do you want to use" option. Another nice addition would be to allow the user to use the -l make argument alongside the -j one. As that the combination of both allows the user to order make to "keep the system to a max of (-l arg) load, you may spawn up to (-j arg) subprocesses".

@AdelKS
Copy link
Collaborator

AdelKS commented Sep 1, 2024

Hello, are you up for a PR ?

I suggest the following change: add _thread_num to the customization file

  • used only if _force_all_threads is false
  • check if it's a valid number lower than nproc

I'd leave the load average to another PR if ever

@Tk-Glitch like it ?

@Emimendoza
Copy link
Author

Checking if it is lower than nproc defeats the stated purpose.

@AdelKS
Copy link
Collaborator

AdelKS commented Sep 2, 2024

Checking if it is lower than nproc defeats the stated purpose.

You want to use more threads than the number of hardware threads you have, to compile the kernel ? I don't think that is useful. But that's a detail, not adding that check is also good

@Emimendoza
Copy link
Author

As mentioned earlier I use distcc and have a compile server of 72 threads. The compilation is done remotely on a per-file basis. The local threads will be mostly idle waiting for the server to return the finished object files. As such, limiting to the number of local threads, significantly slows this down.

@AdelKS
Copy link
Collaborator

AdelKS commented Sep 2, 2024

Sorry I just understood your use case, yeah absolutely the check I suggested is counter-productive 👍

@Tk-Glitch Tk-Glitch added the enhancement New feature or request label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants