Re: [PATCH] SMP race in ext2 - metadata corruption.

From: Albert D. Cahalan (acahalan@cs.uml.edu)
Date: Sat May 05 2001 - 06:20:44 EST


Alexander Viro writes:
>> On Fri, 4 May 2001, Alexander Viro wrote:

>>> Ehh... There _is_ a way to deal with that, but it's deeply Albertesque:
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Ah, you learn from the master.

> ObProcfs: I don't think that walking the page tables is a good way to
> compute RSS, especially since VM maintains the thing. Mind if I rip

Handling of mapped device memory should not change. For example
there is the X server with mapped video memory. There is another
RSS value provided elsewhere in case one does not want to include
mapped device memory.

Currently top uses the statm file in the following manner:

  case P_SIZE:
    sprintf(tmp, "%5.5s ", scale_k((task->size << CL_pg_shift), 5, 1));
    break;
  case P_TRS:
    sprintf(tmp, "%4.4s ", scale_k((task->trs << CL_pg_shift), 4, 1));
    break;
  case P_SWAP:
    sprintf(tmp, "%4.4s ",
        scale_k(((task->size - task->resident) << CL_pg_shift), 4, 1));
    break;
  case P_SHARE:
    sprintf(tmp, "%5.5s ", scale_k((task->share << CL_pg_shift), 5, 1)); break;
  case P_DT:
    sprintf(tmp, "%3.3s ", scale_k(task->dt, 3, 0));
    break;
  case P_RSS: /* rss, not resident (which includes IO memory) */
    sprintf(tmp, "%4.4s ",
        scale_k((task->rss << CL_pg_shift), 4, 1));

> it out? In effect, implementation of /prc/<pid>/statm
> * produces extremely bogus values (VMA is from library if it goes
> beyond 0x60000000? Might be even true 7 years ago...) and nobody
> had cared about them for 6-7 years

One could count pages that are mapped executable and do not come
from the main executable... but this is pretty worthless and does
not consider non-executable library sections.

The latest "top" does not bother to display this value.

> * makes stuff like top(1) _walk_ _whole_ _page_ _tables_ _of_ _all_
> _processes_ each 5 seconds. No wonder it's slow like hell and eats
> tons of CPU time.

On my system, "statm" takes 50% longer than "stat" or "status".
Maybe there is a significant difference with Oracle on a 32 GB box?

I'd rather top didn't have to read the file at all.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 07 2001 - 21:00:21 EST