summaryrefslogtreecommitdiffstats
path: root/lib/mm
Commit message (Collapse)AuthorAgeFilesLines
* comments: misc updatesAlasdair G Kergon2012-08-071-0/+1
| | | | Miscellaneous clarifications to comments.
* fix: limit preallocate stack sizeZdenek Kabelac2012-06-221-1/+5
| | | | | | | | If the user would set bigger reserved stack size then what is allowed in resources (ulimit -s), then he would get coredump So avoid coredump and ignore creation of such large stack size (lvm should work properly, with just 64KB, so the option could be eliminated).
* fix: use 64bit math for reserved memoryZdenek Kabelac2012-06-221-4/+4
| | | | | | | | If the user specifies number in the range of [4G/1024, 4G>, the used value would wrap around (32bit math). So keep the math 64bit. Note, using such large lvm.conf values is pointless with lvm2.
* Log sys error for lseekZdenek Kabelac2012-03-011-1/+2
|
* Minor consistency update for debugging messagesZdenek Kabelac2012-02-011-10/+9
| | | | Use mlock/munlock for debugging lines.
* Fix compilation with disabled devmapperZdenek Kabelac2012-01-251-2/+2
| | | | | During release preparation things has changed, so making sure we are compilable with --disable-devmapper.
* Make error message hit when preallocated memlock memory exceeded clearer.Alasdair Kergon2012-01-121-2/+2
|
* Only use built-in stack size in clvmd - ignore lvm.conf.Alasdair Kergon2011-12-081-3/+4
|
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-301-4/+4
| | | | | | | leaving behind the LVM-specific parts of the code (convenience wrappers that handle `struct device` and `struct cmd_context`, basically). A number of functions have been renamed (in addition to getting a dm_ prefix) -- namely, all of the config interface now has a dm_config_ prefix.
* Maintain a count of the number of suspended devices in libdevmapperAlasdair Kergon2011-06-131-19/+19
| | | | | | | | | and use this for the LVM critical section logic. Also report an error if code tries to load a table while any device is known to be in the suspended state. (If the variety of problems these changes are showing up can't be fixed before the next release, the error messages can be reduced to debug level.)
* Disable critical section internal errors until this can be fixed properlyAlasdair Kergon2011-06-121-1/+2
| | | | in libdevmapper.
* Major pvmove fix to issue ioctls in the correct order when multiple LVsAlasdair Kergon2011-06-112-6/+8
| | | | | | | | | | | are affected by the move. (Currently it's possible for I/O to become trapped between suspended devices amongst other problems. The current fix was selected so as to minimise the testing surface. I hope eventually to replace it with a cleaner one that extends the deptree code. Some lvconvert scenarios still suffer from related problems.
* Report sector containing label in verbose message.Alasdair Kergon2011-06-011-2/+4
|
* pre-release clean-upsAlasdair Kergon2011-04-291-1/+2
|
* clean up critical section patchAlasdair Kergon2011-04-281-0/+13
|
* Fix some unmatching sign comparation gcc warningsZdenek Kabelac2011-04-081-1/+2
| | | | Simple replacement for unsigned type - usually in for() loops.
* Few more files filtered from memory lockingZdenek Kabelac2011-03-301-0/+2
| | | | Code located in these files should not be used in critical section.
* Valgrind updatesZdenek Kabelac2011-03-301-0/+8
| | | | | | | | Avoid locking sum testing with valgrind compilation. Make memory unaccessible in the valgrind for dm_pool_abadon_object. Valgrind hinting should not be needed in _free_chunk for dm_free.
* Use lvm_getpagesize wrapperZdenek Kabelac2011-03-061-1/+1
|
* Fix hardcoded page size, fixing test fails with 8k page and new kernel.Milan Broz2011-03-061-1/+1
|
* Memory unlock allows 1 page differenceZdenek Kabelac2011-02-181-3/+9
| | | | | | | | | | | As the kernel seems to be doing weird things during mlock -> munlock - allow 1 page locking difference without warning - and log just debug message for a 1 page difference. Allocation happens outside critical section probably during log_warn printing. Should make tests passing for now.
* Critical sectionZdenek Kabelac2011-02-182-37/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Add more strict const pointers around config treeZdenek Kabelac2010-12-201-1/+1
| | | | | | 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).
* Switch to char* arithmetic from void*Zdenek Kabelac2010-10-251-2/+2
|
* Speedup memory un/lockingZdenek Kabelac2010-10-151-4/+5
| | | | | Move the call of find_config_tree_node() from inner loop to outer section of maps scanning.
* Maps fixZdenek Kabelac2010-09-301-13/+40
| | | | | | | 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])
* Fix format string from patch apply mistakeZdenek Kabelac2010-07-081-1/+1
|
* Small update of memlock debug messages.Zdenek Kabelac2010-07-081-2/+3
| | | | Gives slightly better alligned lines for reading.
* Preload libc locale messages.Zdenek Kabelac2010-06-241-0/+3
| | | | | | 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.
* Better debug message for Un/Locked memory size.Zdenek Kabelac2010-04-011-1/+2
|
* Set ret value to success initially.Zdenek Kabelac2010-04-011-1/+1
|
* Count only readable size for memlock stats.Zdenek Kabelac2010-03-301-25/+12
| | | | | As we mlock() only readable pages, makes statistics only for readable bytes.
* Update memlockZdenek Kabelac2010-03-301-13/+22
| | | | | | | | | | | | 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().
* some missing debug messagesAlasdair Kergon2010-03-091-2/+7
|
* Update comments for selecting mapsZdenek Kabelac2010-03-091-7/+8
| | | | Use dm_snprintf and check result whether we create correct /proc path name
* Misc cleanups in the new mlock code, incl. improving some variable namesAlasdair Kergon2010-03-091-46/+63
| | | | | | & messages; using more statics (for now) to avoid redundant recalculation; validating config file just once on loading; keeping maps file open.
* Use mlock() only on 'r' memory mapsZdenek Kabelac2010-03-081-1/+1
|
* Unconditionaly ignore also Virtual Dynamically-linked Shared ObjectZdenek Kabelac2010-03-081-1/+2
| | | | | | | | (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.
* Use '_' prefix for local static variable.Zdenek Kabelac2010-03-051-5/+5
|
* mlockall() -> mlock()Zdenek Kabelac2010-03-052-30/+188
| | | | | | | | | | | | | | | | | 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.
* #define an INTERNAL_ERROR macro and use it throughout LVM.Petr Rockai2009-12-161-2/+2
|
* Fix another bug in memlock handling, this time the "global" dmeventd memlockPetr Rockai2009-11-192-6/+48
| | | | was preventing device scans in lvconvert --repair running from inside dmeventd.
* Issue an Internal error message whenever _memlock_count drops below 0.Petr Rockai2009-11-181-0/+2
|
* fix setpriority int errorAlasdair Kergon2008-05-281-1/+1
|
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-3/+3
|
* Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.Alasdair Kergon2007-08-203-8/+8
|
* Add lvm_getpagesize wrapper.Alasdair Kergon2006-08-171-1/+1
|
* Fix lvcreate corelog validation.Alasdair Kergon2006-05-161-3/+3
| | | | | | | | | 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.
* Check for libsepol.Alasdair Kergon2006-04-191-4/+4
| | | | | | Add some cflow & scope support. Separate out DEFS from CFLAGS. Remove inlines and use unique function names.
* Use hash, bitset, malloc, pool from libdevmapper.Alasdair Kergon2005-10-167-967/+0
|