diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2014-12-08 11:50:37 +0300 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-12-22 15:02:39 +0300 |
| commit | 3a2c0ba5ad00c018c0bef39a2224aca950aa33f2 (patch) | |
| tree | 1fbf69fb820c0fa2e6050f8caaecff424c73bd8d /tools/perf/scripts/python/sched-migration.py | |
| parent | 1dacb395d68a14825ee48c0843335e3181aea675 (diff) | |
| download | linux-3a2c0ba5ad00c018c0bef39a2224aca950aa33f2.tar.xz | |
hwrng: use reference counts on each struct hwrng.
current_rng holds one reference, and we bump it every time we want
to do a read from it.
This means we only hold the rng_mutex to grab or drop a reference,
so accessing /sys/devices/virtual/misc/hw_random/rng_current doesn't
block on read of /dev/hwrng.
Using a kref is overkill (we're always under the rng_mutex), but
a standard pattern.
This also solves the problem that the hwrng_fillfn thread was
accessing current_rng without a lock, which could change (eg. to NULL)
underneath it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions
