Where does Linux set the default values for SHMMAX?

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite












I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.



$ cat /proc/sys/kernel/shmmax 
18446744073692774399

$ sysctl kernel.shmmax
kernel.shmmax = 18446744073692774399






share|improve this question























    up vote
    6
    down vote

    favorite












    I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.



    $ cat /proc/sys/kernel/shmmax 
    18446744073692774399

    $ sysctl kernel.shmmax
    kernel.shmmax = 18446744073692774399






    share|improve this question





















      up vote
      6
      down vote

      favorite









      up vote
      6
      down vote

      favorite











      I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.



      $ cat /proc/sys/kernel/shmmax 
      18446744073692774399

      $ sysctl kernel.shmmax
      kernel.shmmax = 18446744073692774399






      share|improve this question











      I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.



      $ cat /proc/sys/kernel/shmmax 
      18446744073692774399

      $ sysctl kernel.shmmax
      kernel.shmmax = 18446744073692774399








      share|improve this question










      share|improve this question




      share|improve this question









      asked Jun 14 '17 at 0:47









      Evan Carroll

      4,47683472




      4,47683472




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          The __init function ipc_ns_init sets the initial value of shmmax by calling shm_init_ns, which sets it to the value of the SHMMAX macro.



          The definition of SHMMAX is in <uapi/linux/shm.h>:



          #define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */


          On 64-bit machines, that definition equals the value you found, 18446744073692774399.






          share|improve this answer




























            up vote
            0
            down vote













            On the fly you can just echo into /proc/sys/kernel/shmmax!



            # echo 20446744073692774399 > /proc/sys/kernel/shmmax


            But most people edit /etc/sysctl.conf with a line similar to:



            kernel.shmmax=your_new_value_here


            See the sysctl(8) man page.






            share|improve this answer





















            • That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
              – Evan Carroll
              Jun 14 '17 at 2:09







            • 1




              On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
              – Deathgrip
              Jun 14 '17 at 2:48










            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f370985%2fwhere-does-linux-set-the-default-values-for-shmmax%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote



            accepted










            The __init function ipc_ns_init sets the initial value of shmmax by calling shm_init_ns, which sets it to the value of the SHMMAX macro.



            The definition of SHMMAX is in <uapi/linux/shm.h>:



            #define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */


            On 64-bit machines, that definition equals the value you found, 18446744073692774399.






            share|improve this answer

























              up vote
              5
              down vote



              accepted










              The __init function ipc_ns_init sets the initial value of shmmax by calling shm_init_ns, which sets it to the value of the SHMMAX macro.



              The definition of SHMMAX is in <uapi/linux/shm.h>:



              #define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */


              On 64-bit machines, that definition equals the value you found, 18446744073692774399.






              share|improve this answer























                up vote
                5
                down vote



                accepted







                up vote
                5
                down vote



                accepted






                The __init function ipc_ns_init sets the initial value of shmmax by calling shm_init_ns, which sets it to the value of the SHMMAX macro.



                The definition of SHMMAX is in <uapi/linux/shm.h>:



                #define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */


                On 64-bit machines, that definition equals the value you found, 18446744073692774399.






                share|improve this answer













                The __init function ipc_ns_init sets the initial value of shmmax by calling shm_init_ns, which sets it to the value of the SHMMAX macro.



                The definition of SHMMAX is in <uapi/linux/shm.h>:



                #define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */


                On 64-bit machines, that definition equals the value you found, 18446744073692774399.







                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered Jun 14 '17 at 2:40









                Wumpus Q. Wumbley

                4,0001119




                4,0001119






















                    up vote
                    0
                    down vote













                    On the fly you can just echo into /proc/sys/kernel/shmmax!



                    # echo 20446744073692774399 > /proc/sys/kernel/shmmax


                    But most people edit /etc/sysctl.conf with a line similar to:



                    kernel.shmmax=your_new_value_here


                    See the sysctl(8) man page.






                    share|improve this answer





















                    • That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
                      – Evan Carroll
                      Jun 14 '17 at 2:09







                    • 1




                      On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
                      – Deathgrip
                      Jun 14 '17 at 2:48














                    up vote
                    0
                    down vote













                    On the fly you can just echo into /proc/sys/kernel/shmmax!



                    # echo 20446744073692774399 > /proc/sys/kernel/shmmax


                    But most people edit /etc/sysctl.conf with a line similar to:



                    kernel.shmmax=your_new_value_here


                    See the sysctl(8) man page.






                    share|improve this answer





















                    • That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
                      – Evan Carroll
                      Jun 14 '17 at 2:09







                    • 1




                      On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
                      – Deathgrip
                      Jun 14 '17 at 2:48












                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    On the fly you can just echo into /proc/sys/kernel/shmmax!



                    # echo 20446744073692774399 > /proc/sys/kernel/shmmax


                    But most people edit /etc/sysctl.conf with a line similar to:



                    kernel.shmmax=your_new_value_here


                    See the sysctl(8) man page.






                    share|improve this answer













                    On the fly you can just echo into /proc/sys/kernel/shmmax!



                    # echo 20446744073692774399 > /proc/sys/kernel/shmmax


                    But most people edit /etc/sysctl.conf with a line similar to:



                    kernel.shmmax=your_new_value_here


                    See the sysctl(8) man page.







                    share|improve this answer













                    share|improve this answer



                    share|improve this answer











                    answered Jun 14 '17 at 1:47









                    Deathgrip

                    1,266311




                    1,266311











                    • That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
                      – Evan Carroll
                      Jun 14 '17 at 2:09







                    • 1




                      On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
                      – Deathgrip
                      Jun 14 '17 at 2:48
















                    • That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
                      – Evan Carroll
                      Jun 14 '17 at 2:09







                    • 1




                      On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
                      – Deathgrip
                      Jun 14 '17 at 2:48















                    That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
                    – Evan Carroll
                    Jun 14 '17 at 2:09





                    That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
                    – Evan Carroll
                    Jun 14 '17 at 2:09





                    1




                    1




                    On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
                    – Deathgrip
                    Jun 14 '17 at 2:48




                    On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
                    – Deathgrip
                    Jun 14 '17 at 2:48












                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f370985%2fwhere-does-linux-set-the-default-values-for-shmmax%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    6rsCdXY,RhveAbMHG nL,s5MRSfv7W0GLH Zf,7,bhU QB4 AhFNbGx UivYL KuPGGhOj9 VtsqEsBxQMUGZ NoV8RbKEEuw5Q3DnuM5Vik
                    t,IjqWffL3nts2eUwYk7fXyvonS v5 DaC4ZLqKz1 jNjOc iMsmP5XJFtoiUhe,s2q36c6LRbc63,D2N,VqEDYgeAjLh6jXp

                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    How many registers does an x86_64 CPU actually have?

                    Displaying single band from multi-band raster using QGIS