Messages in this thread | | | Date | Wed, 7 Oct 2015 15:35:45 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH tip/core/rcu 04/18] rcu: Use single-stage IPI algorithm for RCU expedited grace period |
| |
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 :-)
| |