samples/c/1/swap.c
static void drain_cpu_pagevecs(int cpu)
{
	struct pagevec *pvecs = per_cpu(lru_add_pvecs, cpu);
	struct pagevec *pvec;
	int lru;

	for_each_lru(lru) {
		pvec = &pvecs[lru - LRU_BASE];
		if (pagevec_count(pvec))
			____pagevec_lru_add(pvec, lru);
	}

	pvec = &per_cpu(lru_rotate_pvecs, cpu);
	if (pagevec_count(pvec)) {
		unsigned long flags;

		/* No harm done if a racing interrupt already did this */
		local_irq_save(flags);
		pagevec_move_tail(pvec);
		local_irq_restore(flags);
	}
}
/*
 * Drain pages out of the cpu's pagevecs.
 * Either "cpu" is the current CPU, and preemption has already been
 * disabled; or "cpu" is being hot-unplugged, and is already dead.
 */
Drain pages out of the cpu's pagevecs.
Either "cpu" is the current CPU, and preemption has already been
disabled; or "cpu" is being hot-unplugged, and is already dead.
Drain pages out of the cpu ' s pagevecs . Either " cpu " is the current CPU and preemption has already been disabled ; or " cpu " is being hot - unplugged and is already dead .
static void drain_cpu_pagevecs(int cpu)
{
	struct pagevec *pvecs = per_cpu(lru_add_pvecs, cpu);
	struct pagevec *pvec;
	int lru;
	for_each_lru(lru) {
		pvec = &pvecs[lru - LRU_BASE];
		if (pagevec_count(pvec))
			____pagevec_lru_add(pvec, lru);
	}
	pvec = &per_cpu(lru_rotate_pvecs, cpu);
	if (pagevec_count(pvec)) {
		unsigned long flags;
		local_irq_save(flags);
		pagevec_move_tail(pvec);
		local_irq_restore(flags);
	}
}
static void drain_cpu_pagevecs ( int cpu ) { struct pagevec * pvecs = per_cpu ( lru_add_pvecs , cpu ) ; struct pagevec * pvec ; int lru ; for_each_lru ( lru ) { pvec = & pvecs [ lru - LRU_BASE ] ; if ( pagevec_count ( pvec ) ) ____pagevec_lru_add ( pvec , lru ) ; } pvec = & per_cpu ( lru_rotate_pvecs , cpu ) ; if ( pagevec_count ( pvec ) ) { unsigned long flags ; local_irq_save ( flags ) ; pagevec_move_tail ( pvec ) ; local_irq_restore ( flags ) ; } }
Drain pages out of the cpu's pagevecs.
Drain pages out of the cpu ' s pagevecs .
/* No harm done if a racing interrupt already did this */