Print this page
patch as-lock-macro-simplification
*** 229,245 ****
* Clear any watched areas and remember the
* watched pages for restoring in vfwait().
*/
as = p->p_as;
if (avl_numnodes(&as->a_wpage) != 0) {
! AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
as_clearwatch(as);
p->p_wpage = as->a_wpage;
avl_create(&as->a_wpage, wp_compare,
sizeof (struct watched_page),
offsetof(struct watched_page, wp_link));
! AS_LOCK_EXIT(as, &as->a_lock);
}
cp->p_as = as;
cp->p_flag |= SVFORK;
/*
--- 229,245 ----
* Clear any watched areas and remember the
* watched pages for restoring in vfwait().
*/
as = p->p_as;
if (avl_numnodes(&as->a_wpage) != 0) {
! AS_LOCK_ENTER(as, RW_WRITER);
as_clearwatch(as);
p->p_wpage = as->a_wpage;
avl_create(&as->a_wpage, wp_compare,
sizeof (struct watched_page),
offsetof(struct watched_page, wp_link));
! AS_LOCK_EXIT(as);
}
cp->p_as = as;
cp->p_flag |= SVFORK;
/*
*** 590,606 ****
forklwperr:
if (isvfork) {
if (avl_numnodes(&p->p_wpage) != 0) {
/* restore watchpoints to parent */
as = p->p_as;
! AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
as->a_wpage = p->p_wpage;
avl_create(&p->p_wpage, wp_compare,
sizeof (struct watched_page),
offsetof(struct watched_page, wp_link));
as_setwatch(as);
! AS_LOCK_EXIT(as, &as->a_lock);
}
} else {
if (cp->p_segacct)
shmexit(cp);
as = cp->p_as;
--- 590,606 ----
forklwperr:
if (isvfork) {
if (avl_numnodes(&p->p_wpage) != 0) {
/* restore watchpoints to parent */
as = p->p_as;
! AS_LOCK_ENTER(as, RW_WRITER);
as->a_wpage = p->p_wpage;
avl_create(&p->p_wpage, wp_compare,
sizeof (struct watched_page),
offsetof(struct watched_page, wp_link));
as_setwatch(as);
! AS_LOCK_EXIT(as);
}
} else {
if (cp->p_segacct)
shmexit(cp);
as = cp->p_as;
*** 1448,1460 ****
}
/* restore watchpoints to parent */
if (pr_watch_active(pp)) {
struct as *as = pp->p_as;
! AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
as_setwatch(as);
! AS_LOCK_EXIT(as, &as->a_lock);
}
mutex_enter(&pp->p_lock);
prbarrier(pp); /* barrier against /proc locking */
continuelwps(pp);
--- 1448,1460 ----
}
/* restore watchpoints to parent */
if (pr_watch_active(pp)) {
struct as *as = pp->p_as;
! AS_LOCK_ENTER(as, RW_WRITER);
as_setwatch(as);
! AS_LOCK_EXIT(as);
}
mutex_enter(&pp->p_lock);
prbarrier(pp); /* barrier against /proc locking */
continuelwps(pp);