>>> On 16.08.17 at 07:14, <chao....@intel.com> wrote: > +static inline bool pi_over_limit(unsigned int cpu) > +{ > + /* Compare w/ constant first to save a division and an add */ > + if ( likely(read_atomic(&per_cpu(vmx_pi_blocking, cpu).counter) <= > + PI_LIST_FIXED_LIMIT) ) > + return 0;
false > + else Pointless else. > +static unsigned int pi_get_blocking_cpu(unsigned int cpu, unsigned long > *flags) > +{ > + spinlock_t *pi_blocking_list_lock; > + > + for ( ; ; ) > + { > + while ( unlikely(pi_over_limit(cpu)) ) > + cpu = cpumask_cycle(cpu, &cpu_online_map); > + > + pi_blocking_list_lock = &per_cpu(vmx_pi_blocking, cpu).lock; > + if ( flags ) > + spin_lock_irqsave(pi_blocking_list_lock, *flags); > + else > + spin_lock(pi_blocking_list_lock); This is ugly, but I think I see why you want it this way. Let's see what the maintainers think. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel