ctdb: use mlockall, cautiously
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 16 Dec 2009 10:27:20 +0000 (20:57 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 16 Dec 2009 10:27:20 +0000 (20:57 +1030)
commit82f778e85440bc713d3f87c08ddc955d3cfce926
treefac48b5697792c1984bfe7fc1f331bf0b87d51d5
parent482c302d46e2162d0cf552f8456bc49573ae729d
ctdb: use mlockall, cautiously

We don't want ctdb stalling due to paging; this can be far worse than
scheduling delays.  But if we simply do mlockall(MCL_FUTURE), it
increases the risk that mmap (ie. tdb open) or malloc will fail,
causing us to abort.

This patch is a compromise: we mlock all current pages (including
10k of future stack for expansion) and then relock when a client
asks us to open a TDB.  We warn, but don't exit, if it fails.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
common/ctdb_util.c
configure.ac
include/ctdb_private.h
server/ctdb_daemon.c
server/ctdb_ltdb_server.c