How to verify zswap running?












15















How can I check to verify that zswap is enabled and working on my system?










share|improve this question



























    15















    How can I check to verify that zswap is enabled and working on my system?










    share|improve this question

























      15












      15








      15


      2






      How can I check to verify that zswap is enabled and working on my system?










      share|improve this question














      How can I check to verify that zswap is enabled and working on my system?







      kernel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 12 '14 at 22:47









      Rucent88Rucent88

      99311325




      99311325






















          2 Answers
          2






          active

          oldest

          votes


















          14














          dmesg | grep zswap


          That should be all you need to know if it's running. You should see a message along the lines of:



          [    1.241302] zswap: loading zswap
          [ 1.241306] zswap: using zbud pool
          [ 1.241310] zswap: using lzo compressor


          You can see what it's doing with the following:



          $ sudo grep -R . /sys/kernel/debug/zswap
          /sys/kernel/debug/zswap/stored_pages:0
          /sys/kernel/debug/zswap/pool_total_size:0
          /sys/kernel/debug/zswap/duplicate_entry:0
          /sys/kernel/debug/zswap/written_back_pages:0
          /sys/kernel/debug/zswap/reject_compress_poor:0
          /sys/kernel/debug/zswap/reject_kmemcache_fail:0
          /sys/kernel/debug/zswap/reject_alloc_fail:0
          /sys/kernel/debug/zswap/reject_reclaim_fail:0
          /sys/kernel/debug/zswap/pool_limit_hit:0


          The key parameters to look out for are stored_pages which is the number of compressed pages and written_back_pages which is the number of pages which have been written out to the swap file.






          share|improve this answer





















          • 2





            To add to this, you can check if zswap is actually doing anything with this command (zswap won't actually kick in until your system starts swapping): sudo sh -c 'cd /sys/kernel/debug/zswap; grep . *'

            – bmaupin
            May 19 '15 at 16:13











          • @bmaupin That command seems a little convoluted, why not: sudo grep . /sys/kernel/debug/zswap/* ?

            – Oli
            May 19 '15 at 16:18








          • 1





            Just preference. They both work fine, but I prefer the cleaner output of mine.

            – bmaupin
            May 19 '15 at 16:22






          • 1





            I just noticed your command doesn't actually work, which is probably why mine seems convoluted: $ sudo grep . /sys/kernel/debug/zswap/* grep: /sys/kernel/debug/zswap/*: No such file or directory. At a minimum you would probably need to do: sudo sh -c 'grep . /sys/kernel/debug/zswap/*'

            – bmaupin
            Sep 10 '15 at 15:49













          • @bmaupin I can see the problem now, it's trying to expand in the parent shell (pre-sudo) but normal users don't have list/read permissions in /sys/kernel/debug/zswap. Can be fixed by telling grep to chow through the directory. See edit.

            – Oli
            Mar 2 '16 at 0:43



















          1














          Shell expansion is a weird thing sometimes. grep fortunately have a recursive option so to simplify it:



          sudo grep -r . /sys/kernel/debug/zswap





          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f510516%2fhow-to-verify-zswap-running%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            14














            dmesg | grep zswap


            That should be all you need to know if it's running. You should see a message along the lines of:



            [    1.241302] zswap: loading zswap
            [ 1.241306] zswap: using zbud pool
            [ 1.241310] zswap: using lzo compressor


            You can see what it's doing with the following:



            $ sudo grep -R . /sys/kernel/debug/zswap
            /sys/kernel/debug/zswap/stored_pages:0
            /sys/kernel/debug/zswap/pool_total_size:0
            /sys/kernel/debug/zswap/duplicate_entry:0
            /sys/kernel/debug/zswap/written_back_pages:0
            /sys/kernel/debug/zswap/reject_compress_poor:0
            /sys/kernel/debug/zswap/reject_kmemcache_fail:0
            /sys/kernel/debug/zswap/reject_alloc_fail:0
            /sys/kernel/debug/zswap/reject_reclaim_fail:0
            /sys/kernel/debug/zswap/pool_limit_hit:0


            The key parameters to look out for are stored_pages which is the number of compressed pages and written_back_pages which is the number of pages which have been written out to the swap file.






            share|improve this answer





















            • 2





              To add to this, you can check if zswap is actually doing anything with this command (zswap won't actually kick in until your system starts swapping): sudo sh -c 'cd /sys/kernel/debug/zswap; grep . *'

              – bmaupin
              May 19 '15 at 16:13











            • @bmaupin That command seems a little convoluted, why not: sudo grep . /sys/kernel/debug/zswap/* ?

              – Oli
              May 19 '15 at 16:18








            • 1





              Just preference. They both work fine, but I prefer the cleaner output of mine.

              – bmaupin
              May 19 '15 at 16:22






            • 1





              I just noticed your command doesn't actually work, which is probably why mine seems convoluted: $ sudo grep . /sys/kernel/debug/zswap/* grep: /sys/kernel/debug/zswap/*: No such file or directory. At a minimum you would probably need to do: sudo sh -c 'grep . /sys/kernel/debug/zswap/*'

              – bmaupin
              Sep 10 '15 at 15:49













            • @bmaupin I can see the problem now, it's trying to expand in the parent shell (pre-sudo) but normal users don't have list/read permissions in /sys/kernel/debug/zswap. Can be fixed by telling grep to chow through the directory. See edit.

              – Oli
              Mar 2 '16 at 0:43
















            14














            dmesg | grep zswap


            That should be all you need to know if it's running. You should see a message along the lines of:



            [    1.241302] zswap: loading zswap
            [ 1.241306] zswap: using zbud pool
            [ 1.241310] zswap: using lzo compressor


            You can see what it's doing with the following:



            $ sudo grep -R . /sys/kernel/debug/zswap
            /sys/kernel/debug/zswap/stored_pages:0
            /sys/kernel/debug/zswap/pool_total_size:0
            /sys/kernel/debug/zswap/duplicate_entry:0
            /sys/kernel/debug/zswap/written_back_pages:0
            /sys/kernel/debug/zswap/reject_compress_poor:0
            /sys/kernel/debug/zswap/reject_kmemcache_fail:0
            /sys/kernel/debug/zswap/reject_alloc_fail:0
            /sys/kernel/debug/zswap/reject_reclaim_fail:0
            /sys/kernel/debug/zswap/pool_limit_hit:0


            The key parameters to look out for are stored_pages which is the number of compressed pages and written_back_pages which is the number of pages which have been written out to the swap file.






            share|improve this answer





















            • 2





              To add to this, you can check if zswap is actually doing anything with this command (zswap won't actually kick in until your system starts swapping): sudo sh -c 'cd /sys/kernel/debug/zswap; grep . *'

              – bmaupin
              May 19 '15 at 16:13











            • @bmaupin That command seems a little convoluted, why not: sudo grep . /sys/kernel/debug/zswap/* ?

              – Oli
              May 19 '15 at 16:18








            • 1





              Just preference. They both work fine, but I prefer the cleaner output of mine.

              – bmaupin
              May 19 '15 at 16:22






            • 1





              I just noticed your command doesn't actually work, which is probably why mine seems convoluted: $ sudo grep . /sys/kernel/debug/zswap/* grep: /sys/kernel/debug/zswap/*: No such file or directory. At a minimum you would probably need to do: sudo sh -c 'grep . /sys/kernel/debug/zswap/*'

              – bmaupin
              Sep 10 '15 at 15:49













            • @bmaupin I can see the problem now, it's trying to expand in the parent shell (pre-sudo) but normal users don't have list/read permissions in /sys/kernel/debug/zswap. Can be fixed by telling grep to chow through the directory. See edit.

              – Oli
              Mar 2 '16 at 0:43














            14












            14








            14







            dmesg | grep zswap


            That should be all you need to know if it's running. You should see a message along the lines of:



            [    1.241302] zswap: loading zswap
            [ 1.241306] zswap: using zbud pool
            [ 1.241310] zswap: using lzo compressor


            You can see what it's doing with the following:



            $ sudo grep -R . /sys/kernel/debug/zswap
            /sys/kernel/debug/zswap/stored_pages:0
            /sys/kernel/debug/zswap/pool_total_size:0
            /sys/kernel/debug/zswap/duplicate_entry:0
            /sys/kernel/debug/zswap/written_back_pages:0
            /sys/kernel/debug/zswap/reject_compress_poor:0
            /sys/kernel/debug/zswap/reject_kmemcache_fail:0
            /sys/kernel/debug/zswap/reject_alloc_fail:0
            /sys/kernel/debug/zswap/reject_reclaim_fail:0
            /sys/kernel/debug/zswap/pool_limit_hit:0


            The key parameters to look out for are stored_pages which is the number of compressed pages and written_back_pages which is the number of pages which have been written out to the swap file.






            share|improve this answer















            dmesg | grep zswap


            That should be all you need to know if it's running. You should see a message along the lines of:



            [    1.241302] zswap: loading zswap
            [ 1.241306] zswap: using zbud pool
            [ 1.241310] zswap: using lzo compressor


            You can see what it's doing with the following:



            $ sudo grep -R . /sys/kernel/debug/zswap
            /sys/kernel/debug/zswap/stored_pages:0
            /sys/kernel/debug/zswap/pool_total_size:0
            /sys/kernel/debug/zswap/duplicate_entry:0
            /sys/kernel/debug/zswap/written_back_pages:0
            /sys/kernel/debug/zswap/reject_compress_poor:0
            /sys/kernel/debug/zswap/reject_kmemcache_fail:0
            /sys/kernel/debug/zswap/reject_alloc_fail:0
            /sys/kernel/debug/zswap/reject_reclaim_fail:0
            /sys/kernel/debug/zswap/pool_limit_hit:0


            The key parameters to look out for are stored_pages which is the number of compressed pages and written_back_pages which is the number of pages which have been written out to the swap file.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Aug 12 '18 at 9:19









            davefiddes

            1053




            1053










            answered Aug 12 '14 at 22:56









            OliOli

            223k88564765




            223k88564765








            • 2





              To add to this, you can check if zswap is actually doing anything with this command (zswap won't actually kick in until your system starts swapping): sudo sh -c 'cd /sys/kernel/debug/zswap; grep . *'

              – bmaupin
              May 19 '15 at 16:13











            • @bmaupin That command seems a little convoluted, why not: sudo grep . /sys/kernel/debug/zswap/* ?

              – Oli
              May 19 '15 at 16:18








            • 1





              Just preference. They both work fine, but I prefer the cleaner output of mine.

              – bmaupin
              May 19 '15 at 16:22






            • 1





              I just noticed your command doesn't actually work, which is probably why mine seems convoluted: $ sudo grep . /sys/kernel/debug/zswap/* grep: /sys/kernel/debug/zswap/*: No such file or directory. At a minimum you would probably need to do: sudo sh -c 'grep . /sys/kernel/debug/zswap/*'

              – bmaupin
              Sep 10 '15 at 15:49













            • @bmaupin I can see the problem now, it's trying to expand in the parent shell (pre-sudo) but normal users don't have list/read permissions in /sys/kernel/debug/zswap. Can be fixed by telling grep to chow through the directory. See edit.

              – Oli
              Mar 2 '16 at 0:43














            • 2





              To add to this, you can check if zswap is actually doing anything with this command (zswap won't actually kick in until your system starts swapping): sudo sh -c 'cd /sys/kernel/debug/zswap; grep . *'

              – bmaupin
              May 19 '15 at 16:13











            • @bmaupin That command seems a little convoluted, why not: sudo grep . /sys/kernel/debug/zswap/* ?

              – Oli
              May 19 '15 at 16:18








            • 1





              Just preference. They both work fine, but I prefer the cleaner output of mine.

              – bmaupin
              May 19 '15 at 16:22






            • 1





              I just noticed your command doesn't actually work, which is probably why mine seems convoluted: $ sudo grep . /sys/kernel/debug/zswap/* grep: /sys/kernel/debug/zswap/*: No such file or directory. At a minimum you would probably need to do: sudo sh -c 'grep . /sys/kernel/debug/zswap/*'

              – bmaupin
              Sep 10 '15 at 15:49













            • @bmaupin I can see the problem now, it's trying to expand in the parent shell (pre-sudo) but normal users don't have list/read permissions in /sys/kernel/debug/zswap. Can be fixed by telling grep to chow through the directory. See edit.

              – Oli
              Mar 2 '16 at 0:43








            2




            2





            To add to this, you can check if zswap is actually doing anything with this command (zswap won't actually kick in until your system starts swapping): sudo sh -c 'cd /sys/kernel/debug/zswap; grep . *'

            – bmaupin
            May 19 '15 at 16:13





            To add to this, you can check if zswap is actually doing anything with this command (zswap won't actually kick in until your system starts swapping): sudo sh -c 'cd /sys/kernel/debug/zswap; grep . *'

            – bmaupin
            May 19 '15 at 16:13













            @bmaupin That command seems a little convoluted, why not: sudo grep . /sys/kernel/debug/zswap/* ?

            – Oli
            May 19 '15 at 16:18







            @bmaupin That command seems a little convoluted, why not: sudo grep . /sys/kernel/debug/zswap/* ?

            – Oli
            May 19 '15 at 16:18






            1




            1





            Just preference. They both work fine, but I prefer the cleaner output of mine.

            – bmaupin
            May 19 '15 at 16:22





            Just preference. They both work fine, but I prefer the cleaner output of mine.

            – bmaupin
            May 19 '15 at 16:22




            1




            1





            I just noticed your command doesn't actually work, which is probably why mine seems convoluted: $ sudo grep . /sys/kernel/debug/zswap/* grep: /sys/kernel/debug/zswap/*: No such file or directory. At a minimum you would probably need to do: sudo sh -c 'grep . /sys/kernel/debug/zswap/*'

            – bmaupin
            Sep 10 '15 at 15:49







            I just noticed your command doesn't actually work, which is probably why mine seems convoluted: $ sudo grep . /sys/kernel/debug/zswap/* grep: /sys/kernel/debug/zswap/*: No such file or directory. At a minimum you would probably need to do: sudo sh -c 'grep . /sys/kernel/debug/zswap/*'

            – bmaupin
            Sep 10 '15 at 15:49















            @bmaupin I can see the problem now, it's trying to expand in the parent shell (pre-sudo) but normal users don't have list/read permissions in /sys/kernel/debug/zswap. Can be fixed by telling grep to chow through the directory. See edit.

            – Oli
            Mar 2 '16 at 0:43





            @bmaupin I can see the problem now, it's trying to expand in the parent shell (pre-sudo) but normal users don't have list/read permissions in /sys/kernel/debug/zswap. Can be fixed by telling grep to chow through the directory. See edit.

            – Oli
            Mar 2 '16 at 0:43













            1














            Shell expansion is a weird thing sometimes. grep fortunately have a recursive option so to simplify it:



            sudo grep -r . /sys/kernel/debug/zswap





            share|improve this answer






























              1














              Shell expansion is a weird thing sometimes. grep fortunately have a recursive option so to simplify it:



              sudo grep -r . /sys/kernel/debug/zswap





              share|improve this answer




























                1












                1








                1







                Shell expansion is a weird thing sometimes. grep fortunately have a recursive option so to simplify it:



                sudo grep -r . /sys/kernel/debug/zswap





                share|improve this answer















                Shell expansion is a weird thing sometimes. grep fortunately have a recursive option so to simplify it:



                sudo grep -r . /sys/kernel/debug/zswap






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 5 hours ago









                Alexey Vazhnov

                9318




                9318










                answered Jan 23 '17 at 15:55









                Nikolay NaydenovNikolay Naydenov

                111




                111






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f510516%2fhow-to-verify-zswap-running%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

                    香粉寮

                    GameSpot