Find the answer to your Linux question:
Results 1 to 2 of 2
In include/linux/sched.h, please describe the memory (including units) returned by the get_mm_rss macro? Is it the same virtual memory (rss) that is returned by the /proc/self/stat field "rss"? Thanks, B...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    27

    sched.h: What does get_mm_rss() return


    In include/linux/sched.h, please describe the memory (including units) returned by the get_mm_rss macro?

    Is it the same virtual memory (rss) that is returned by the /proc/self/stat field "rss"?

    Thanks,
    B

  2. #2
    Just Joined!
    Join Date
    Oct 2006
    Posts
    27
    I found my answers.

    Chasing this macro around reveals where it is actually used to increment /proc/self/stat in linux/fs/proc/array.c.

    Units are PAGES, and the number of bytes in a page is PAGE_SIZE.

    Excerpt from array.c

    Code:
    seq_printf(m, "%d (%s) %c %d %d %d %d %d %u %lu \
    %lu %lu %lu %lu %lu %ld %ld %ld %ld %d 0 %llu %lu %ld %lu %lu %lu %lu %lu \
    %lu %lu %lu %lu %lu %lu %lu %lu %d %d %u %u %llu %lu %ld\n",
                   pid_nr_ns(pid, ns),
                   tcomm,
                   state,
                   ppid,
                   pgid,
                   sid,
                   tty_nr,
                   tty_pgrp,
                   task->flags,
                   min_flt,
                   cmin_flt,
                   maj_flt,
                   cmaj_flt,
                   cputime_to_clock_t(utime),
                   cputime_to_clock_t(stime),
                   cputime_to_clock_t(cutime),
                   cputime_to_clock_t(cstime),
                   priority,
                   nice,
                   num_threads,
                   start_time,
                   vsize,
                   mm ? get_mm_rss(mm) : 0,
                   rsslim,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •