Skip to contentSkip to conversation

random: Reduce preempt disabled region

RFC PATCH New Sebastian Andrzej Siewior 1 participant 1 message May 4, 2018 Random number driver

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 random: Reduce preempt disabled region

From: Ingo Molnar <[email protected]>

No need to keep preemption disabled across the whole function.

---
 drivers/char/random.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/char/random.c +0 -4
@@ -1122,8 +1122,6 @@ static void add_timer_randomness(struct
 	} sample;
 	long delta, delta2, delta3;
 
-	preempt_disable();
-
 	sample.jiffies = jiffies;
 	sample.cycles = random_get_entropy();
 	sample.num = num;
@@ -1161,8 +1159,6 @@ static void add_timer_randomness(struct
 	 * and limit entropy entimate to 12 bits.
 	 */
 	credit_entropy_bits(r, min_t(int, fls(delta>>1), 11));
-
-	preempt_enable();
 }
 
 void add_input_randomness(unsigned int type, unsigned int code,