Re: [PATCH 2/2] mm: compaction: Minimise the time IRQs are disabled while isolating pages for migration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 25, 2011 at 11:32:04PM +0100, Johannes Weiner wrote:
> I don't understand why this conditional is broken up like this.
> cond_resched() will have the right checks anyway.  Okay, you would
> save fatal_signal_pending() in the 'did one cluster' case.  Is it that
> expensive?  Couldn't this be simpler like
> 
> 		did_cluster = ((low_pfn + 1) % SWAP_CLUSTER_MAX) == 0
> 		lock_contended = spin_is_contended(&zone->lru_lock);
> 		if (did_cluster || lock_contended || need_resched()) {
> 			spin_unlock_irq(&zone->lru_lock);
> 			cond_resched();
> 			spin_lock_irq(&zone->lru_lock);
> 			if (fatal_signal_pending(current))
> 				break;
> 		}
> 
> instead?

If we don't release irqs first, how can need_resched get set in the
first place if the local apic irq can't run? I guess that's why
there's no cond_resched_lock_irq. BTW, I never liked too much clearing
interrupts for locks that can't ever be taken from irq (it's a
scalability boost to reduce contention but it makes things like above
confusing and it increases irq latency a bit.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]