]> sourceware.org Git - lvm2.git/commitdiff
Memory unlock allows 1 page difference
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 18 Feb 2011 14:51:04 +0000 (14:51 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 18 Feb 2011 14:51:04 +0000 (14:51 +0000)
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.

lib/mm/memlock.c

index 14f1cadfafce81f2768f1caa9b1af2c1b0b08dbc..6698a31f0ae8ee6b09d0e774ee41610e43956a94 100644 (file)
@@ -343,9 +343,15 @@ static void _unlock_mem(struct cmd_context *cmd)
                        log_sys_error("close", _procselfmaps);
                dm_free(_maps_buffer);
                _maps_buffer = NULL;
-               if (_mstats < unlock_mstats)
-                       log_error(INTERNAL_ERROR "Maps lock %ld < unlock %ld",
-                                 (long)_mstats, (long)unlock_mstats);
+               if (_mstats < unlock_mstats) {
+                       if ((_mstats + 4096) < unlock_mstats)
+                               log_error(INTERNAL_ERROR
+                                         "Maps lock %ld < unlock %ld",
+                                         (long)_mstats, (long)unlock_mstats);
+                       else
+                               log_debug("Maps lock %ld < unlock %ld, 1 page difference!",
+                                         (long)_mstats, (long)unlock_mstats);
+               }
        }
 
        if (setpriority(PRIO_PROCESS, 0, _priority))
This page took 0.037246 seconds and 5 git commands to generate.