tech-kern archive

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

Re: Anomalies while handling p_nstopchild count



On Mon, 12 Oct 2015, Taylor R Campbell wrote:

  In kern/kern_exit.c at (original) line 231, there's a call to
  membar_producer(), presumably to ensure that p->p_waited is globally
  visible before updating p_.p_stat (which might cause someone to look
  at p->p_waited).

  Now that I'm planning to protect this whole area using proc_lock, I
  question whether or not the potentially expensive call to
  membar_producer() is still needed?

The membar_producer is certainly longer be needed.  It is not clear to
me why it was needed in the first place, nor is the original commit
message (kern_exit.c 1.158.2.6, `Checkpoint work in progress' on the
newlock2 branch) illuminating.  I see no matching membar_consumer,
even in the CVS logs.

My guess is that the membar_producer was an aborted attempt to avoid
locks or atomics for a certain part of the signal/wait protocol.

Thanks for the confirmation.  I will remove it when I commit the final
patch.


+------------------+--------------------------+-------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
+------------------+--------------------------+-------------------------+


Home | Main Index | Thread Index | Old Index