On Tue, Oct 06, 2015 at 09:29:23AM -0700, Paul E. McKenney wrote:

> +/* Flags for rcu_preempt_ctxt_queue() decision table. */
> +#define RCU_GP_TASKS 0x8
> +#define RCU_EXP_TASKS        0x4
> +#define RCU_GP_BLKD  0x2
> +#define RCU_EXP_BLKD 0x1
Purely cosmetic, but that's backwards ;-) Most of our flags etc.. are in
increasing order.

> +static void rcu_preempt_ctxt_queue(struct rcu_node *rnp, struct rcu_data 
> *rdp,
> +                                unsigned long flags) __releases(rnp->lock)
> +{
> +     int blkd_state = (rnp->gp_tasks ? RCU_GP_TASKS : 0) +
> +                      (rnp->exp_tasks ? RCU_EXP_TASKS : 0) +
> +                      (rnp->qsmask & rdp->grpmask ? RCU_GP_BLKD : 0) +
> +                      (rnp->expmask & rdp->grpmask ? RCU_EXP_BLKD : 0);

An alternative way is:

        int blkd_state = RCU_GP_TASKS  * !!rnp->gp_tasks +
                         RCU_EXP_TASKS * !!rnp->exp_tasks +
                         RCU_GP_BLKD   * !!(rnp->qsmask  & rdp->grpmask) +
                         RCU_EXP_BLKD  * !!(rnp->expmask & rdp->grpmask);

I suppose it depends on how your brain is wired which version reads
easier :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to