cvs commit: src/sys/kern subr_witness.c src/sys/dev/random randomdev_soft.c

Robert Watson rwatson at FreeBSD.org
Sun Nov 28 16:39:03 PST 2004


rwatson     2004-11-29 00:39:02 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_5)
    sys/kern             subr_witness.c 
    sys/dev/random       randomdev_soft.c 
  Log:
  Merge randomdev_soft.c:1.5, 1.6, 1.7 from HEAD to RELENG_5:
  
    ----------------------------
    revision 1.7
    date: 2004/11/03 10:02:50;  author: rwatson;  state: Exp;  lines: +11 -14
    (1) Move from O(n) list copies to O(1) list concatenation, which is
        supported for STAILQ via STAILQ_CONCAT().
  
    (2) Maintain a count of the number of entries in the thread-local entropy
        fifo so that we can keep the other fifo counts in synch.
  
    MFC after:      3 weeks
    MFC with:       randomdev_soft.c revisions 1.5 and 1.6
    Suggested by:   jhb (1)
    ----------------------------
    revision 1.6
    date: 2004/10/12 14:57:14;  author: rwatson;  state: Exp;  lines: +6 -0
    Assert that the entropy source category provided by a caller submitting
    entropy is valid, as an invalid source will cause dereferencing of an
    array of queues to an incorrect memory location.
    ----------------------------
    revision 1.5
    date: 2004/10/09 22:04:13;  author: rwatson;  state: Exp;  lines: +41 -50
    Modify entropy harvesting locking strategy:
  
    - Trade off granularity to reduce overhead, since the current model
      doesn't appear to reduce contention substantially: move to a single
      harvest mutex protecting harvesting queues, rather than one mutex
      per source plus a mutex for the free list.
  
    - Reduce mutex operations in a harvesting event to 2 from 4, and
      maintain lockless read to avoid mutex operations if the queue is
      full.
  
    - When reaping harvested entries from the queue, move all entries from
      the queue at once, and when done with them, insert them all into a
      thread-local queue for processing; then insert them all into the
      empty fifo at once.  This reduces O(4n) mutex operations to O(2)
      mutex operations per wakeup.
  
    In the future, we may want to look at re-introducing granularity,
    although perhaps at the granularity of the source rather than the
    source class; both the new and old strategies would cause contention
    between different instances of the same source (i.e., multiple
    network interfaces).
  
    Reviewed by:    markm
  
  Also merge subr_witness.c:1.182 from HEAD to RELENG_5:
  
    date: 2004/10/11 08:26:18;  author: rwatson;  state: Exp;  lines: +1 -2
    Add entropy harvest mutex to hard-coded spin lock witness lock order,
    remove previous entropy harvesting mutex names as they are no longer
    present.  Commit to this file was ommitted when randomdev_soft.c:1.5
    was made.
  
    Feet shot:      Robert Huff <roberthuff at rcn dot com>
  
  Revision   Changes    Path
  1.4.2.2    +52 -58    src/sys/dev/random/randomdev_soft.c
  1.178.2.3  +1 -2      src/sys/kern/subr_witness.c


More information about the cvs-src mailing list