Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Guard our global resource `phpool' against all inte...



details:   https://anonhg.NetBSD.org/src/rev/e2e8adf8aff2
branches:  trunk
changeset: 473548:e2e8adf8aff2
user:      pk <pk%NetBSD.org@localhost>
date:      Sun Jun 06 22:20:15 1999 +0000

description:
Guard our global resource `phpool' against all interrupts.

diffstat:

 sys/kern/subr_pool.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 37689cc184bc -r e2e8adf8aff2 sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c      Sun Jun 06 22:14:53 1999 +0000
+++ b/sys/kern/subr_pool.c      Sun Jun 06 22:20:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_pool.c,v 1.26 1999/05/10 21:15:42 thorpej Exp $   */
+/*     $NetBSD: subr_pool.c,v 1.27 1999/06/06 22:20:15 pk Exp $        */
 
 /*-
  * Copyright (c) 1997, 1999 The NetBSD Foundation, Inc.
@@ -313,8 +313,11 @@
        pp->pr_npagefree++;
 
        if ((pp->pr_roflags & PR_PHINPAGE) == 0) {
+               int s;
                LIST_REMOVE(ph, ph_hashlist);
+               s = splhigh();
                pool_put(&phpool, ph);
+               splx(s);
        }
 
        if (pp->pr_curpage == ph) {
@@ -995,12 +998,14 @@
        caddr_t cp = storage;
        unsigned int align = pp->pr_align;
        unsigned int ioff = pp->pr_itemoffset;
-       int n;
+       int s, n;
 
        if ((pp->pr_roflags & PR_PHINPAGE) != 0) {
                ph = (struct pool_item_header *)(cp + pp->pr_phoffset);
        } else {
+               s = splhigh();
                ph = pool_get(&phpool, PR_URGENT);
+               splx(s);
                LIST_INSERT_HEAD(&pp->pr_hashtab[PR_HASH_INDEX(pp, cp)],
                                 ph, ph_hashlist);
        }



Home | Main Index | Thread Index | Old Index