mirror of https://gitee.com/openkylin/linux.git
drivers/char/random.c:write_pool() cond_resched() needed
Reduce latency for large writes to /dev/[u]random Signed-off-by: Matt Mackall <mpm@selenic.com> Cc: Sami Farin <safari-kernel@safari.iki.fi> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
5ab24c79af
commit
91f3f1e304
|
@ -1039,6 +1039,7 @@ write_pool(struct entropy_store *r, const char __user *buffer, size_t count)
|
||||||
p += bytes;
|
p += bytes;
|
||||||
|
|
||||||
add_entropy_words(r, buf, (bytes + 3) / 4);
|
add_entropy_words(r, buf, (bytes + 3) / 4);
|
||||||
|
cond_resched();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue