Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\rcu\rcuperf.c Create Date:2022-07-28 10:23:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:RCU perf writer kthread. Repeatedly does a grace period.

Proto:static int rcu_perf_writer(void *arg)

Type:int

Parameter:

TypeParameterName
void *arg
350  i = 0
352  me = arg
353  struct callback_head * rhp = NULL
355  bool started = TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., done = TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., alldone = false
358  wdpp = writer_durations[me]
360  VERBOSE_PERFOUT_STRING("rcu_perf_writer task started")
361  WARN_ON(!wdpp)
362  set_cpus_allowed_ptr(current process, cpumask_of - the cpumask containing just a given cpu*@cpu: the cpu (<= nr_cpu_ids)(me % nr_cpu_ids))
363  sched_priority = 1
364  sched_setscheduler_nocheck - change the scheduling policy and/or RT priority of a thread from kernelspace
366  If holdoff Then schedule_timeout_uninterruptible(holdoff * HZ)
374  When Not gp_exp && Values used for system_state. Ordering of the states must not be changed* as code checks for <, <=, >, >= STATE. != SYSTEM_RUNNING cycle
375  schedule_timeout_uninterruptible(1)
377  t = ktime_get_mono_fast_ns()
378  If atomic_inc_return( & n_rcu_perf_writer_started) >= nrealwriters Then
379  t_rcu_perf_writer_started = t
380  If gp_exp Then
383  Else
388  Do
389  If writer_holdoff Then 0x10c7 is 2**32 / 1000000 (rounded up) (writer_holdoff)
391  wdp = wdpp[i]
392  wdp = ktime_get_mono_fast_ns()
393  If gp_async Then
394  retry :
395  If Not rhp Then rhp = Allocation memory
402  gp_barrier()
403  Go to retry
404  Else
405  kfree(rhp)
407  Else if gp_exp Then
408  exp_sync()
409  Else
410  sync()
412  t = ktime_get_mono_fast_ns()
413  wdp = t - wdp
414  i_max = i
415  If Not started && atomic_read( & n_rcu_perf_writer_started) >= nrealwriters Then started = true
418  If Not done && i >= MIN_MEAS Then
419  done = true
420  sched_priority = 0
423  pr_alert("%s%s rcu_perf_writer %ld has %d measurements\n", perf_type, PERF_FLAG, me, MIN_MEAS)
444  If done && Not alldone && atomic_read( & n_rcu_perf_writer_finished) >= nrealwriters Then alldone = true
447  If started && Not alldone && i < MAX_MEAS - 1 Then i++
449  If performance tests complete, wait for shutdown to commence.
450  When Not Is it time for the current torture test to stop? cycle
451  If gp_async Then
452  gp_barrier()
454  writer_n_durations[me] = i_max
455  Each kthread must wait for kthread_should_stop() before returning from* its top-level function, otherwise segfaults ensue
456  Return 0