Lets move the assignment of weight down. Gcc may optimize, but I don'twant to rely on it.

> + struct rq *rq;> > BUG_ON(!rt_task(p));> > /*> - * Update the migration status of the RQ if we have an RT task> - * which is running AND changing its weight value.> + * Just exit if it's not necessary to change migration status

Let's comment this better. Something like:

Only update if the process changes its state from whether it can migrate or not.