1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-07-17 00:58:59 +03:00
Commit Graph

83 Commits

Author SHA1 Message Date
760d1fac55 Add more strict const pointers around config tree
To have better control were the config tree could be modified use more
const pointers and very carefully downcast them back to non-const
(for config tree merge).
2010-12-20 13:12:55 +00:00
aa4f87d6e3 Switch to char* arithmetic from void* 2010-10-25 13:00:35 +00:00
d1ad03efce Speedup memory un/locking
Move the call of find_config_tree_node() from inner loop to outer
section of maps scanning.
2010-10-15 09:48:23 +00:00
c631be7684 Maps fix
Read complete content of /proc/self/maps into one buffer without
realocation in the middle of reading and before doing any m/unlock
operation with these lines - as some of them gets change.
With previous implementation we've read some mappings twice ([stack])
2010-09-30 11:32:40 +00:00
764eb41086 Fix format string from patch apply mistake 2010-07-08 14:47:46 +00:00
37036b0215 Small update of memlock debug messages.
Gives slightly better alligned lines for reading.
2010-07-08 13:05:27 +00:00
d301e5917f Preload libc locale messages.
Preload libc.mo file for localized lvm before taking memory lock - this way
we prevent disk access for some error paths in libdm, that prints localized
errno messages while they are still in memory locked state.
2010-06-24 08:29:30 +00:00
ddf19eae0f Better debug message for Un/Locked memory size. 2010-04-01 14:53:47 +00:00
39b6ac476d Set ret value to success initially. 2010-04-01 13:43:12 +00:00
5de52e34f0 Count only readable size for memlock stats.
As we mlock() only readable pages, makes statistics only
for readable bytes.
2010-03-30 14:41:58 +00:00
3f67b36b35 Update memlock
Code moves initilization of stats values to _memlock_maps().
For dmeventd we need to use mlockall() - so avoid reading config value
and go with _use_mlockall code path.

Patch assumes dmeventd uses C locales!
Patch needs the call or memlock_inc_daemon() before memlock_inc()
(which is our common use case).

Some minor code cleanup patch for _un/_lock_mem_if_needed().
2010-03-30 14:41:23 +00:00
415feb2f44 some missing debug messages 2010-03-09 12:31:51 +00:00
d0c3da55a0 Update comments for selecting maps
Use dm_snprintf and check result whether we create correct /proc path name
2010-03-09 10:25:50 +00:00
f0f43bc093 Misc cleanups in the new mlock code, incl. improving some variable names
& messages; using more statics (for now) to avoid redundant
recalculation; validating config file just once on loading; keeping maps
file open.
2010-03-09 03:16:11 +00:00
4e27a85a2b Use mlock() only on 'r' memory maps 2010-03-08 17:14:21 +00:00
26ade5f27e Unconditionaly ignore also Virtual Dynamically-linked Shared Object
(VDSO on 32bit is VSyscall on 64bit)
It seems it could be locked on 64bit kernels running 32bit binaries,
but it makes troubles on real 32bit machines where mlock() returns
error when trying to lock such map area. (0xffffe000)
Behavior of mlockall() seems to be similar.
2010-03-08 15:55:52 +00:00
c900819b4e Use '_' prefix for local static variable. 2010-03-05 15:14:03 +00:00
18b82048e4 mlockall() -> mlock()
This patch adds a new implementation of locking function instead
of mlockall() that may lock way too much memory (>100MB).
New function instead uses mlock() system call and selectively locks
memory areas from /proc/self/maps trying to avoid locking areas
unused during lock-ed state.

Patch also adds struct cmd_context to all memlock() calls to have
access to configuration.

For backward compatibility functionality of mlockall()
is preserved with "activation/use_mlockall" flag.

As a simple check, locking and unlocking counts the amount of memory
and compares whether values are matching.
2010-03-05 14:48:33 +00:00
550cae2340 #define an INTERNAL_ERROR macro and use it throughout LVM. 2009-12-16 19:22:11 +00:00
4514bdcfa2 Fix another bug in memlock handling, this time the "global" dmeventd memlock
was preventing device scans in lvconvert --repair running from inside dmeventd.
2009-11-19 01:11:57 +00:00
39b1e58979 Issue an Internal error message whenever _memlock_count drops below 0. 2009-11-18 18:22:32 +00:00
0a5b690b70 fix setpriority int error 2008-05-28 23:12:45 +00:00
67cdbd7e4d Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
be6845999b Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
916490f8bf Add lvm_getpagesize wrapper. 2006-08-17 18:23:44 +00:00
2293567c8c Fix lvcreate corelog validation.
Add --config for overriding most config file settings from cmdline.
  Quote arguments when printing command line.
  Remove linefeed from 'initialising logging' message.
  Add 'Completed' debug message.
  Don't attempt library exit after reloading config files.
  Always compile with libdevmapper, even if device-mapper is disabled.
2006-05-16 16:48:31 +00:00
8a2fc58645 Check for libsepol.
Add some cflow & scope support.
Separate out DEFS from CFLAGS.
Remove inlines and use unique function names.
2006-04-19 15:33:07 +00:00
2262b32057 Use hash, bitset, malloc, pool from libdevmapper. 2005-10-16 23:03:59 +00:00
6606c3ae81 Update copyright notices. 2004-03-30 19:35:44 +00:00
f22969328b tweak memlock includes 2004-03-26 21:11:34 +00:00
814643d8a2 rename config file vars & always use / as separator 2004-03-08 18:28:45 +00:00
4c22730b53 Some tidyups and minor fixes. 2003-08-20 15:48:27 +00:00
914c97239f Another sync point - numerous fixes & clean ups. 2003-07-04 22:34:56 +00:00