Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae74138da609c576b221c765efa8b81b2365f465
Commit:     ae74138da609c576b221c765efa8b81b2365f465
Parent:     9aad369e5690cbd0505f75aa1d34c9cacfef48da
Author:     David Rientjes <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:26:00 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:42:46 2007 -0700

    oom: convert zone_scan_lock from mutex to spinlock
    
    There's no reason to sleep in try_set_zone_oom() or clear_zonelist_oom() if
    the lock can't be acquired; it will be available soon enough once the 
zonelist
    scanning is done.  All other threads waiting for the OOM killer are also
    contingent on the exiting task being able to acquire the lock in
    clear_zonelist_oom() so it doesn't make sense to put it to sleep.
    
    Cc: Andrea Arcangeli <[EMAIL PROTECTED]>
    Cc: Christoph Lameter <[EMAIL PROTECTED]>
    Signed-off-by: David Rientjes <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/oom_kill.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 183a964..a64decb 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -28,7 +28,7 @@
 
 int sysctl_panic_on_oom;
 int sysctl_oom_kill_allocating_task;
-static DEFINE_MUTEX(zone_scan_mutex);
+static DEFINE_SPINLOCK(zone_scan_mutex);
 /* #define DEBUG */
 
 /**
@@ -396,7 +396,7 @@ int try_set_zone_oom(struct zonelist *zonelist)
 
        z = zonelist->zones;
 
-       mutex_lock(&zone_scan_mutex);
+       spin_lock(&zone_scan_mutex);
        do {
                if (zone_is_oom_locked(*z)) {
                        ret = 0;
@@ -413,7 +413,7 @@ int try_set_zone_oom(struct zonelist *zonelist)
                zone_set_flag(*z, ZONE_OOM_LOCKED);
        } while (*(++z) != NULL);
 out:
-       mutex_unlock(&zone_scan_mutex);
+       spin_unlock(&zone_scan_mutex);
        return ret;
 }
 
@@ -428,11 +428,11 @@ void clear_zonelist_oom(struct zonelist *zonelist)
 
        z = zonelist->zones;
 
-       mutex_lock(&zone_scan_mutex);
+       spin_lock(&zone_scan_mutex);
        do {
                zone_clear_flag(*z, ZONE_OOM_LOCKED);
        } while (*(++z) != NULL);
-       mutex_unlock(&zone_scan_mutex);
+       spin_unlock(&zone_scan_mutex);
 }
 
 /**
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to