In /proc/meminfo, does Dirty include or exclude Writeback?











up vote
0
down vote

favorite













Dirty %lu - Memory which is waiting to get written back to the disk.



Writeback %lu - Memory which is actively being written back to the disk.



-- man proc




Does Dirty include Writeback? Or is it excluded?



My kernel version is 4.18.16-200.fc28.x86_64.










share|improve this question


























    up vote
    0
    down vote

    favorite













    Dirty %lu - Memory which is waiting to get written back to the disk.



    Writeback %lu - Memory which is actively being written back to the disk.



    -- man proc




    Does Dirty include Writeback? Or is it excluded?



    My kernel version is 4.18.16-200.fc28.x86_64.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite












      Dirty %lu - Memory which is waiting to get written back to the disk.



      Writeback %lu - Memory which is actively being written back to the disk.



      -- man proc




      Does Dirty include Writeback? Or is it excluded?



      My kernel version is 4.18.16-200.fc28.x86_64.










      share|improve this question














      Dirty %lu - Memory which is waiting to get written back to the disk.



      Writeback %lu - Memory which is actively being written back to the disk.



      -- man proc




      Does Dirty include Writeback? Or is it excluded?



      My kernel version is 4.18.16-200.fc28.x86_64.







      linux-kernel memory proc cache






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 at 12:01









      sourcejedi

      21.8k43396




      21.8k43396






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          “Dirty” and “Writeback” are separate stats and page states; for proof of this, see for example node_dirty_ok:



          nr_pages += node_page_state(pgdat, NR_FILE_DIRTY);
          nr_pages += node_page_state(pgdat, NR_UNSTABLE_NFS);
          nr_pages += node_page_state(pgdat, NR_WRITEBACK);

          return nr_pages <= limit;


          If one included the other, that would be taken into account here.



          /proc/meminfo doesn’t process the corresponding values either:



          show_val_kb(m, "Dirty:          ",
          global_node_page_state(NR_FILE_DIRTY));
          show_val_kb(m, "Writeback: ",
          global_node_page_state(NR_WRITEBACK));





          share|improve this answer




























            up vote
            0
            down vote













            I think Dirty excludes Writeback.



            dd if=/dev/zero of=~/X.img bs=1M count=1 ; sync & for i in 1 2 3; do grep -E '^(Dirty:|Writeback:|MemFree:|Cached:)' /proc/meminfo ; done
            1+0 records in
            1+0 records out
            1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00316564 s, 331 MB/s
            [1] 13140
            MemFree: 1461832 kB
            Cached: 1475188 kB
            Dirty: 132 kB
            Writeback: 1032 kB
            ...


            (Although this is only proof if /proc/meminfo is guaranteed 100% consistent).






            share|improve this answer























              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: 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
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481694%2fin-proc-meminfo-does-dirty-include-or-exclude-writeback%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








              up vote
              2
              down vote



              accepted










              “Dirty” and “Writeback” are separate stats and page states; for proof of this, see for example node_dirty_ok:



              nr_pages += node_page_state(pgdat, NR_FILE_DIRTY);
              nr_pages += node_page_state(pgdat, NR_UNSTABLE_NFS);
              nr_pages += node_page_state(pgdat, NR_WRITEBACK);

              return nr_pages <= limit;


              If one included the other, that would be taken into account here.



              /proc/meminfo doesn’t process the corresponding values either:



              show_val_kb(m, "Dirty:          ",
              global_node_page_state(NR_FILE_DIRTY));
              show_val_kb(m, "Writeback: ",
              global_node_page_state(NR_WRITEBACK));





              share|improve this answer

























                up vote
                2
                down vote



                accepted










                “Dirty” and “Writeback” are separate stats and page states; for proof of this, see for example node_dirty_ok:



                nr_pages += node_page_state(pgdat, NR_FILE_DIRTY);
                nr_pages += node_page_state(pgdat, NR_UNSTABLE_NFS);
                nr_pages += node_page_state(pgdat, NR_WRITEBACK);

                return nr_pages <= limit;


                If one included the other, that would be taken into account here.



                /proc/meminfo doesn’t process the corresponding values either:



                show_val_kb(m, "Dirty:          ",
                global_node_page_state(NR_FILE_DIRTY));
                show_val_kb(m, "Writeback: ",
                global_node_page_state(NR_WRITEBACK));





                share|improve this answer























                  up vote
                  2
                  down vote



                  accepted







                  up vote
                  2
                  down vote



                  accepted






                  “Dirty” and “Writeback” are separate stats and page states; for proof of this, see for example node_dirty_ok:



                  nr_pages += node_page_state(pgdat, NR_FILE_DIRTY);
                  nr_pages += node_page_state(pgdat, NR_UNSTABLE_NFS);
                  nr_pages += node_page_state(pgdat, NR_WRITEBACK);

                  return nr_pages <= limit;


                  If one included the other, that would be taken into account here.



                  /proc/meminfo doesn’t process the corresponding values either:



                  show_val_kb(m, "Dirty:          ",
                  global_node_page_state(NR_FILE_DIRTY));
                  show_val_kb(m, "Writeback: ",
                  global_node_page_state(NR_WRITEBACK));





                  share|improve this answer












                  “Dirty” and “Writeback” are separate stats and page states; for proof of this, see for example node_dirty_ok:



                  nr_pages += node_page_state(pgdat, NR_FILE_DIRTY);
                  nr_pages += node_page_state(pgdat, NR_UNSTABLE_NFS);
                  nr_pages += node_page_state(pgdat, NR_WRITEBACK);

                  return nr_pages <= limit;


                  If one included the other, that would be taken into account here.



                  /proc/meminfo doesn’t process the corresponding values either:



                  show_val_kb(m, "Dirty:          ",
                  global_node_page_state(NR_FILE_DIRTY));
                  show_val_kb(m, "Writeback: ",
                  global_node_page_state(NR_WRITEBACK));






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 14 at 12:11









                  Stephen Kitt

                  157k23343416




                  157k23343416
























                      up vote
                      0
                      down vote













                      I think Dirty excludes Writeback.



                      dd if=/dev/zero of=~/X.img bs=1M count=1 ; sync & for i in 1 2 3; do grep -E '^(Dirty:|Writeback:|MemFree:|Cached:)' /proc/meminfo ; done
                      1+0 records in
                      1+0 records out
                      1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00316564 s, 331 MB/s
                      [1] 13140
                      MemFree: 1461832 kB
                      Cached: 1475188 kB
                      Dirty: 132 kB
                      Writeback: 1032 kB
                      ...


                      (Although this is only proof if /proc/meminfo is guaranteed 100% consistent).






                      share|improve this answer



























                        up vote
                        0
                        down vote













                        I think Dirty excludes Writeback.



                        dd if=/dev/zero of=~/X.img bs=1M count=1 ; sync & for i in 1 2 3; do grep -E '^(Dirty:|Writeback:|MemFree:|Cached:)' /proc/meminfo ; done
                        1+0 records in
                        1+0 records out
                        1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00316564 s, 331 MB/s
                        [1] 13140
                        MemFree: 1461832 kB
                        Cached: 1475188 kB
                        Dirty: 132 kB
                        Writeback: 1032 kB
                        ...


                        (Although this is only proof if /proc/meminfo is guaranteed 100% consistent).






                        share|improve this answer

























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          I think Dirty excludes Writeback.



                          dd if=/dev/zero of=~/X.img bs=1M count=1 ; sync & for i in 1 2 3; do grep -E '^(Dirty:|Writeback:|MemFree:|Cached:)' /proc/meminfo ; done
                          1+0 records in
                          1+0 records out
                          1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00316564 s, 331 MB/s
                          [1] 13140
                          MemFree: 1461832 kB
                          Cached: 1475188 kB
                          Dirty: 132 kB
                          Writeback: 1032 kB
                          ...


                          (Although this is only proof if /proc/meminfo is guaranteed 100% consistent).






                          share|improve this answer














                          I think Dirty excludes Writeback.



                          dd if=/dev/zero of=~/X.img bs=1M count=1 ; sync & for i in 1 2 3; do grep -E '^(Dirty:|Writeback:|MemFree:|Cached:)' /proc/meminfo ; done
                          1+0 records in
                          1+0 records out
                          1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00316564 s, 331 MB/s
                          [1] 13140
                          MemFree: 1461832 kB
                          Cached: 1475188 kB
                          Dirty: 132 kB
                          Writeback: 1032 kB
                          ...


                          (Although this is only proof if /proc/meminfo is guaranteed 100% consistent).







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Nov 14 at 12:24

























                          answered Nov 14 at 12:05









                          sourcejedi

                          21.8k43396




                          21.8k43396






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481694%2fin-proc-meminfo-does-dirty-include-or-exclude-writeback%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

                              Morgemoulin

                              Scott Moir

                              Souastre