Project

General

Profile

Revision 4534af0a balance.c

View differences:

balance.c
296 296
   The IRQs with small number of interrupts have very low load or very
297 297
   high load (in a case of NAPI). */
298 298
int choose_irqs_to_move(lub_list_t *cpus, lub_list_t *balance_irqs,
299
	float threshold, birq_choose_strategy_e strategy)
299
	float threshold, birq_choose_strategy_e strategy,
300
	cpumask_t *exclude_cpus)
300 301
{
301 302
	lub_list_node_t *iter;
302 303
	cpu_t *overloaded_cpu = NULL;
......
308 309

  
309 310
	/* Stage 1: Try to move active IRQs from excluded-CPUs */
310 311

  
312
	if (!cpus_empty(*exclude_cpus)) {
313
		/* Iterate CPU list and find excluded ones */
314
		for (iter = lub_list_iterator_init(cpus); iter;
315
			iter = lub_list_iterator_next(iter)) {
316
			lub_list_node_t *iter2;
317
			cpu_t *cpu = (cpu_t *)lub_list_node__get_data(iter);
318
			if (!cpu_isset(cpu->id, *exclude_cpus))
319
				continue;
320
			/* Move all active IRQs to another CPUs */
321
			for (iter2 = lub_list_iterator_init(cpu->irqs); iter2;
322
				iter2 = lub_list_iterator_next(iter2)) {
323
				irq_t *irq = (irq_t *)lub_list_node__get_data(iter2);
324
				if (irq->intr == 0)
325
					continue;
326
				lub_list_add(balance_irqs, irq);
327
			}
328
		}
329
	}
330

  
311 331
	/* Stage 2: Move IRQs from overloaded CPUs */
332

  
312 333
	/* Search for overloaded CPUs */
313 334
	if (!(overloaded_cpu = most_overloaded_cpu(cpus, threshold)))
314 335
		return 0;

Also available in: Unified diff