If I add some scheduling logic inside the rt-class, in task_tick_rt(..) and if I from this function want to change the priority, higher or lower.

As I do now I only change the p->rt_priority to what I want and then call requeue_task_rt(rq, p). Is this the right way? Or how is it done?