Use real number of cores for default -par, ignore virtual cores #6361

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2015_07_only_physical_cores changing 5 files +21 −4
  1. laanwj commented at 4:03 PM on July 1, 2015: member

    To determine the default for -par, the number of script verification threads, use boost::thread::physical_concurrency() which counts only physical cores, not virtual cores.

    Virtual cores are roughly a set of cached registers to avoid context switches while threading, they cannot actually perform work, so spawning a verification thread for them could even reduce efficiency and will put undue load on the system.

    Should fix issue #6358, as well as some other reported system overload issues, especially on Intel processors.

    The function was only introduced in boost 1.56, so provide a utility function GetNumCores to fall back for older Boost versions.

  2. Use real number of cores for default -par, ignore virtual cores
    To determine the default for `-par`, the number of script verification
    threads, use [boost::thread::physical_concurrency()](http://www.boost.org/doc/libs/1_58_0/doc/html/thread/thread_management.html#thread.thread_management.thread.physical_concurrency)
    which counts only physical cores, not virtual cores.
    
    Virtual cores are roughly a set of cached registers to avoid context
    switches while threading, they cannot actually perform work, so spawning
    a verification thread for them could even reduce efficiency and will put
    undue load on the system.
    
    Should fix issue #6358, as well as some other reported system overload
    issues, especially on Intel processors.
    
    The function was only introduced in boost 1.56, so provide a utility
    function `GetNumCores` to fall back for older Boost versions.
    47162673c7
  3. laanwj added the label Bug on Jul 1, 2015
  4. laanwj commented at 4:22 PM on July 1, 2015: member

    We'll also have to bump the boost version in depends for this to work (currently 1.55), but I remember that was already the plan for 0.12.

  5. theuni commented at 4:30 AM on July 2, 2015: member

    @laanwj yes, we need to go ahead with the boost bump. I'm getting ready to leave for a few days for a conference, but I'll make the boost/qt bumps first priority when I get back. Ideally those should be done very early in the cycle so we have some testing.

    Taking that one step further, I'll check the other deps while I'm at it and see if they need bumps too.

  6. luke-jr commented at 5:21 AM on July 2, 2015: member

    utACK

  7. paveljanik commented at 6:04 AM on July 2, 2015: contributor

    ACK

  8. laanwj merged this on Jul 2, 2015
  9. laanwj closed this on Jul 2, 2015

  10. laanwj referenced this in commit d7ada03b8a on Jul 2, 2015
  11. sipa commented at 11:13 PM on July 9, 2015: member

    Posthumous ACK.

  12. sipa cross-referenced this on Jul 9, 2015 from issue bitcoind takes 670% CPU usage at first sync by Mellnik
  13. luke-jr referenced this in commit 5c166950eb on Jan 10, 2016
  14. str4d cross-referenced this on Feb 14, 2017 from issue Bitcoin 0.12 misc PRs 1 by str4d
  15. zkbot referenced this in commit df07f9ad23 on Feb 15, 2017
  16. str4d cross-referenced this on Mar 29, 2017 from issue Use real number of cores, ignore virtual cores by str4d
  17. dagurval cross-referenced this on Apr 23, 2017 from issue Util ports by dagurval
  18. fanquake cross-referenced this on Apr 25, 2017 from issue Use std::thread::hardware_concurrency, instead of Boost, to determine available cores by fanquake
  19. zkbot referenced this in commit 0a80a1cea3 on Jun 16, 2017
  20. laanwj referenced this in commit bc679829e2 on Mar 6, 2018
  21. dagurval cross-referenced this on Jun 11, 2018 from issue Default to virtual cores and set appropriate thread scheduler by dagurval
  22. sickpig cross-referenced this on Jun 19, 2018 from issue [PORT] Default to virtual cores and set appropriate thread scheduler by sickpig
  23. random-zebra cross-referenced this on May 27, 2020 from issue [Tests] Benchmarking Framework by random-zebra
  24. furszy referenced this in commit 4ed15cc69d on Jun 8, 2020
  25. PastaPastaPasta referenced this in commit 098ccb3aaa on Jun 10, 2020
  26. PastaPastaPasta referenced this in commit a12c3950ac on Jun 12, 2020
  27. PastaPastaPasta referenced this in commit d40a7323cb on Jun 13, 2020
  28. PastaPastaPasta referenced this in commit 1a40ff1e6e on Jun 14, 2020
  29. PastaPastaPasta referenced this in commit a00da7fb0e on Jun 14, 2020
  30. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC