Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm Fix a reversed logic in swap deallocation which coul...



details:   https://anonhg.NetBSD.org/src/rev/b49ae99bbb71
branches:  trunk
changeset: 552090:b49ae99bbb71
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu Sep 18 13:48:05 2003 +0000

description:
Fix a reversed logic in swap deallocation which could lead to
uvm_swap_free() being called with a zero slot; this might have been
the reason for crashes with sysvshm and heavy swapping.
(PR kern/22752 by Tom Spindler)
Confirmed by Chuck Silvers.

diffstat:

 sys/uvm/uvm_aobj.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r efb906b010df -r b49ae99bbb71 sys/uvm/uvm_aobj.c
--- a/sys/uvm/uvm_aobj.c        Thu Sep 18 12:42:33 2003 +0000
+++ b/sys/uvm/uvm_aobj.c        Thu Sep 18 13:48:05 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_aobj.c,v 1.60 2003/08/28 13:12:18 pk Exp $ */
+/*     $NetBSD: uvm_aobj.c,v 1.61 2003/09/18 13:48:05 drochner Exp $   */
 
 /*
  * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.60 2003/08/28 13:12:18 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.61 2003/09/18 13:48:05 drochner Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -418,10 +418,9 @@
                                        int slot = elt->slots[j];
 
                                        if (slot > 0) {
-                                               continue;
+                                               uvm_swap_free(slot, 1);
+                                               swpgonlydelta++;
                                        }
-                                       uvm_swap_free(slot, 1);
-                                       swpgonlydelta++;
                                }
 
                                next = LIST_NEXT(elt, list);



Home | Main Index | Thread Index | Old Index