0

I'd like to know on which priority software raid works (level 1 if it matters). So I wrote simple systemtap script to do the job, but I'm not sure if I have done it correctly.

[root@asus-ux21e ~]# cat raid.stp 
probe module("raid1").function("*") {
    printf( "name: %s | prio: %d | nice: %d\n", task_execname(task_current()), task_prio(task_current()), task_nice(task_current()));
}

Could anyone review it, and tell me on which priority software raid works?

0

Your question doesn't make much sense. You're looking at functions from a particular module, but the location of a function doesn't determine its priority. What determines the priority is the priority of the thread that calls the function.

The kernel runs one kernel thread per RAID-1 volume, with a name like md0_raid1 (ps shows it in brackets, e.g. [md0_raid1], to indicate that this is a kernel thread rather than a thread executing code from a file). You can see its priority with ps:

ps -o pid,pri,comm -C md0_raid1
  PID PRI COMMAND
  263  19 md0_raid1
  • So how can I get the same functionality from SystemTap? The question is more about how to do it in SystemTap, then using ps. But thank you. – Artur Szymczak Apr 22 '14 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.