Where is CONFIG_HZ defined? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionLinux kernel headers' organizationCompile the Ubuntu “Raring” Kernel with the Intel CompilerHow is the linking mechanism so fast in the kernel system calls?why is “timer_t” defined in “time.h” on Linux but not OS XHow to add a system call in linux kernel 4.xHow does one establish SIGRTMIN at run-time?Anonymous Pipe Kernel Buffer SizeHow to get the actual program name using the PID of that running program?program stack sizeWhere is the default value of write_wakeup_threshold defined?

Antler Helmet: Can it work?

What would be the ideal power source for a cybernetic eye?

Are my PIs rude or am I just being too sensitive?

Can Pao de Queijo, and similar foods, be kosher for Passover?

How to deal with a team lead who never gives me credit?

Is high blood pressure ever a symptom attributable solely to dehydration?

Models of set theory where not every set can be linearly ordered

Is the address of a local variable a constexpr?

What are 'alternative tunings' of a guitar and why would you use them? Doesn't it make it more difficult to play?

How to motivate offshore teams and trust them to deliver?

Right-skewed distribution with mean equals to mode?

How do I mention the quality of my school without bragging

Letter Boxed validator

What does the "x" in "x86" represent?

Storing hydrofluoric acid before the invention of plastics

Did Xerox really develop the first LAN?

Does accepting a pardon have any bearing on trying that person for the same crime in a sovereign jurisdiction?

What is the longest distance a 13th-level monk can jump while attacking on the same turn?

How much radiation do nuclear physics experiments expose researchers to nowadays?

How can I fade player when goes inside or outside of the area?

Is a manifold-with-boundary with given interior and non-empty boundary essentially unique?

What happens to sewage if there is no river near by?

What is this single-engine low-wing propeller plane?

Gastric acid as a weapon



Where is CONFIG_HZ defined?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionLinux kernel headers' organizationCompile the Ubuntu “Raring” Kernel with the Intel CompilerHow is the linking mechanism so fast in the kernel system calls?why is “timer_t” defined in “time.h” on Linux but not OS XHow to add a system call in linux kernel 4.xHow does one establish SIGRTMIN at run-time?Anonymous Pipe Kernel Buffer SizeHow to get the actual program name using the PID of that running program?program stack sizeWhere is the default value of write_wakeup_threshold defined?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm in the middle of reading the whole Linux 5.0.7 source code, and I've noticed something strange. I'll refer to linux as the parent directory here, correct me if the community uses some other naming convention in the literature.



In the file linux/include/asm-generic/param.h, the value CONFIG_HZ is used. The value is not defined in the previous lines, and the only included file is uapi/asm-generic/param.h. I believe this refers to linux/include/uapi/asm-generic/param.h, again, correct me if I'm wrong.



In that file, no such value as CONFIG_HZ is ever defined. Now, in your average C program, this would cause a bug. We have 3 options here:



  • I misunderstood something and linux/include/asm-generic/param.h actually includes another file where the value IS defined.

  • This is a bug, and I am a genius for discovering it (least likely option).

  • There is some "magic" going on, like some macros that Linux defines before, or some files the kernel includes before including linux/include/asm-generic/param.h where the value is defined, so that when linux/include/asm-generic/param.h is called the value is already defined. In this case, please point me to what this file is.

If none of these is true, what is the reason why this is a correct C program?










share|improve this question







New contributor




memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


























    1















    I'm in the middle of reading the whole Linux 5.0.7 source code, and I've noticed something strange. I'll refer to linux as the parent directory here, correct me if the community uses some other naming convention in the literature.



    In the file linux/include/asm-generic/param.h, the value CONFIG_HZ is used. The value is not defined in the previous lines, and the only included file is uapi/asm-generic/param.h. I believe this refers to linux/include/uapi/asm-generic/param.h, again, correct me if I'm wrong.



    In that file, no such value as CONFIG_HZ is ever defined. Now, in your average C program, this would cause a bug. We have 3 options here:



    • I misunderstood something and linux/include/asm-generic/param.h actually includes another file where the value IS defined.

    • This is a bug, and I am a genius for discovering it (least likely option).

    • There is some "magic" going on, like some macros that Linux defines before, or some files the kernel includes before including linux/include/asm-generic/param.h where the value is defined, so that when linux/include/asm-generic/param.h is called the value is already defined. In this case, please point me to what this file is.

    If none of these is true, what is the reason why this is a correct C program?










    share|improve this question







    New contributor




    memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      1












      1








      1








      I'm in the middle of reading the whole Linux 5.0.7 source code, and I've noticed something strange. I'll refer to linux as the parent directory here, correct me if the community uses some other naming convention in the literature.



      In the file linux/include/asm-generic/param.h, the value CONFIG_HZ is used. The value is not defined in the previous lines, and the only included file is uapi/asm-generic/param.h. I believe this refers to linux/include/uapi/asm-generic/param.h, again, correct me if I'm wrong.



      In that file, no such value as CONFIG_HZ is ever defined. Now, in your average C program, this would cause a bug. We have 3 options here:



      • I misunderstood something and linux/include/asm-generic/param.h actually includes another file where the value IS defined.

      • This is a bug, and I am a genius for discovering it (least likely option).

      • There is some "magic" going on, like some macros that Linux defines before, or some files the kernel includes before including linux/include/asm-generic/param.h where the value is defined, so that when linux/include/asm-generic/param.h is called the value is already defined. In this case, please point me to what this file is.

      If none of these is true, what is the reason why this is a correct C program?










      share|improve this question







      New contributor




      memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I'm in the middle of reading the whole Linux 5.0.7 source code, and I've noticed something strange. I'll refer to linux as the parent directory here, correct me if the community uses some other naming convention in the literature.



      In the file linux/include/asm-generic/param.h, the value CONFIG_HZ is used. The value is not defined in the previous lines, and the only included file is uapi/asm-generic/param.h. I believe this refers to linux/include/uapi/asm-generic/param.h, again, correct me if I'm wrong.



      In that file, no such value as CONFIG_HZ is ever defined. Now, in your average C program, this would cause a bug. We have 3 options here:



      • I misunderstood something and linux/include/asm-generic/param.h actually includes another file where the value IS defined.

      • This is a bug, and I am a genius for discovering it (least likely option).

      • There is some "magic" going on, like some macros that Linux defines before, or some files the kernel includes before including linux/include/asm-generic/param.h where the value is defined, so that when linux/include/asm-generic/param.h is called the value is already defined. In this case, please point me to what this file is.

      If none of these is true, what is the reason why this is a correct C program?







      linux linux-kernel






      share|improve this question







      New contributor




      memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Apr 11 at 19:40









      memememememememe

      62




      62




      New contributor




      memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      memememe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          2














          Like other CONFIG_ values, CONFIG_HZ is a configuration setting; you’ll find it in kernel/Kconfig.hz, along with various arch-specific overrides in other Kconfig files. Its value is determined during the build and stored in a generated configuration file, include/generated/autoconf.h.






          share|improve this answer

























          • And I suppose include/generated/autoconf.h is included in the kernel's execution flow before linux/include/asm-generic/param.h?

            – memememe
            Apr 11 at 21:44











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          memememe is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511983%2fwhere-is-config-hz-defined%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Like other CONFIG_ values, CONFIG_HZ is a configuration setting; you’ll find it in kernel/Kconfig.hz, along with various arch-specific overrides in other Kconfig files. Its value is determined during the build and stored in a generated configuration file, include/generated/autoconf.h.






          share|improve this answer

























          • And I suppose include/generated/autoconf.h is included in the kernel's execution flow before linux/include/asm-generic/param.h?

            – memememe
            Apr 11 at 21:44















          2














          Like other CONFIG_ values, CONFIG_HZ is a configuration setting; you’ll find it in kernel/Kconfig.hz, along with various arch-specific overrides in other Kconfig files. Its value is determined during the build and stored in a generated configuration file, include/generated/autoconf.h.






          share|improve this answer

























          • And I suppose include/generated/autoconf.h is included in the kernel's execution flow before linux/include/asm-generic/param.h?

            – memememe
            Apr 11 at 21:44













          2












          2








          2







          Like other CONFIG_ values, CONFIG_HZ is a configuration setting; you’ll find it in kernel/Kconfig.hz, along with various arch-specific overrides in other Kconfig files. Its value is determined during the build and stored in a generated configuration file, include/generated/autoconf.h.






          share|improve this answer















          Like other CONFIG_ values, CONFIG_HZ is a configuration setting; you’ll find it in kernel/Kconfig.hz, along with various arch-specific overrides in other Kconfig files. Its value is determined during the build and stored in a generated configuration file, include/generated/autoconf.h.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 11 at 20:48

























          answered Apr 11 at 20:17









          Stephen KittStephen Kitt

          181k25415494




          181k25415494












          • And I suppose include/generated/autoconf.h is included in the kernel's execution flow before linux/include/asm-generic/param.h?

            – memememe
            Apr 11 at 21:44

















          • And I suppose include/generated/autoconf.h is included in the kernel's execution flow before linux/include/asm-generic/param.h?

            – memememe
            Apr 11 at 21:44
















          And I suppose include/generated/autoconf.h is included in the kernel's execution flow before linux/include/asm-generic/param.h?

          – memememe
          Apr 11 at 21:44





          And I suppose include/generated/autoconf.h is included in the kernel's execution flow before linux/include/asm-generic/param.h?

          – memememe
          Apr 11 at 21:44










          memememe is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          memememe is a new contributor. Be nice, and check out our Code of Conduct.












          memememe is a new contributor. Be nice, and check out our Code of Conduct.











          memememe is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511983%2fwhere-is-config-hz-defined%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

          Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

          NetworkManager fails with “Could not find source connection”Trouble connecting to VPN using network-manager, while command line worksHow can I be notified about state changes to a VPN adapterBacktrack 5 R3 - Refuses to connect to VPNFeed all traffic through OpenVPN for a specific network namespace onlyRun daemon on startup in Debian once openvpn connection establishedpfsense tcp connection between openvpn and lan is brokenInternet connection problem with web browsers onlyWhy does NetworkManager explicitly support tun/tap devices?Browser issues with VPNTwo IP addresses assigned to the same network card - OpenVPN issues?Cannot connect to WiFi with nmcli, although secrets are provided