Re: Google's mm problem - not reproduced on 2.4.13

Ben Smith
2001-11-02T21:08:52Z

> So how much memory is mlocked?

In the 3.5G case, we lock 4 blocks (4 * 427683520 bytes, or 1.631M).
There is code in the kernel that prevents more than 1/2 of all physical
pages from being mlocked:

mlock.c:215-218: (in do_mlock)

/* we may lock at most half of physical memory... */
/* (this check is pretty bogus, but doesn't hurt) */
if (locked > num_physpages/2)
goto out;

For 2.2 we were have a patch that increases this to 90% or 60M, but we
don't use this patch on 2.4 yet.

> Why _does_ this thing do mlock, anyway? What's the point? And how much
> does it try to lock?

Latency. We know exactly what data should remain in memory, so we're
trying to prevent the vm from paging out the wrong data. It makes a huge
difference in performance.
- Ben

Ben Smith
Google, Inc.