]> sourceware.org Git - lvm2.git/commit
Critical section
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 18 Feb 2011 14:16:11 +0000 (14:16 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 18 Feb 2011 14:16:11 +0000 (14:16 +0000)
commit6bea349da85b391d0a2ce2541cb70b6ec8026a0e
tree544a42e07bef3c3bfe6fb9dc260b71827a9bb338
parent02c2036731242e73086dfe936805cca36931e8a1
Critical section

New strategy for memory locking to decrease the number of call to
to un/lock memory when processing critical lvm functions.

Introducing functions for critical section.

Inside the critical section - memory is always locked.
When leaving the critical section, the memory stays locked
until memlock_unlock() is called - this happens with
sync_local_dev_names() and sync_dev_names() function call.

memlock_reset() is needed to reset locking numbers after fork
(polldaemon).

The patch itself is mostly rename:

memlock_inc  -> critical_section_inc
memlock_dec  -> critical_section_dec
memlock      -> critical_section

Daemons (clmvd, dmevent) are using memlock_daemon_inc&dec
(mlockall()) thus they will never release or relock memory they've
already locked memory.

Macros sync_local_dev_names() and sync_dev_names() are functions.
It's better for debugging - and also we do not need to add memlock.h
to locking.h header (for memlock_unlock() prototyp).
14 files changed:
WHATS_NEW
daemons/clvmd/lvm-functions.c
lib/activate/activate.c
lib/activate/fs.c
lib/cache/lvmcache.c
lib/device/dev-io.c
lib/format_text/format-text.c
lib/locking/locking.c
lib/locking/locking.h
lib/log/log.c
lib/metadata/metadata.c
lib/metadata/mirror.c
lib/mm/memlock.c
lib/mm/memlock.h
This page took 0.034666 seconds and 5 git commands to generate.