Commit beecec57 authored by James Simmons's avatar James Simmons

Merge maxwell.earthlink.net:/usr/src/linus-2.5

into maxwell.earthlink.net:/usr/src/fbdev-2.5
parents 6d90dcca 0ee29e60
......@@ -220,6 +220,9 @@ extern unsigned long irq_affinity [NR_IRQS];
((1 << cpu) & (allowed_mask))
#if CONFIG_SMP
#define IRQ_BALANCE_INTERVAL (HZ/50)
static unsigned long move(int curr_cpu, unsigned long allowed_mask, unsigned long now, int direction)
{
int search_idle = 1;
......@@ -254,8 +257,9 @@ static inline void balance_irq(int irq)
if (clustered_apic_mode)
return;
if (entry->timestamp != now) {
if (unlikely(time_after(now, entry->timestamp + IRQ_BALANCE_INTERVAL))) {
unsigned long allowed_mask;
unsigned int new_cpu;
int random_number;
rdtscl(random_number);
......@@ -263,8 +267,11 @@ static inline void balance_irq(int irq)
allowed_mask = cpu_online_map & irq_affinity[irq];
entry->timestamp = now;
entry->cpu = move(entry->cpu, allowed_mask, now, random_number);
set_ioapic_affinity(irq, 1 << entry->cpu);
new_cpu = move(entry->cpu, allowed_mask, now, random_number);
if (entry->cpu != new_cpu) {
entry->cpu = new_cpu;
set_ioapic_affinity(irq, 1 << new_cpu);
}
}
}
#else /* !SMP */
......
......@@ -326,21 +326,21 @@ IPS_DEFINE_COMPAT_TABLE( Compatable ); /* Version Compatability Ta
name: ips_hot_plug_name,
id_table: ips_pci_table,
probe: ips_insert_device,
remove: ips_remove_device,
remove: __devexit_p(ips_remove_device),
};
struct pci_driver ips_pci_driver_5i = {
name: ips_hot_plug_name,
id_table: ips_pci_table_5i,
probe: ips_insert_device,
remove: ips_remove_device,
remove: __devexit_p(ips_remove_device),
};
struct pci_driver ips_pci_driver_i960 = {
name: ips_hot_plug_name,
id_table: ips_pci_table_i960,
probe: ips_insert_device,
remove: ips_remove_device,
remove: __devexit_p(ips_remove_device),
};
#endif
......
......@@ -81,14 +81,17 @@ void __page_cache_release(struct page *page)
unsigned long flags;
spin_lock_irqsave(&_pagemap_lru_lock, flags);
if (!TestClearPageLRU(page))
BUG();
if (TestClearPageLRU(page)) {
if (PageActive(page))
del_page_from_active_list(page);
else
del_page_from_inactive_list(page);
}
if (page_count(page) != 0)
page = NULL;
spin_unlock_irqrestore(&_pagemap_lru_lock, flags);
}
if (page)
__free_pages_ok(page, 0);
}
......
......@@ -132,13 +132,15 @@ shrink_list(struct list_head *page_list, int nr_pages, zone_t *classzone,
goto activate_locked;
}
mapping = page->mapping;
/*
* Anonymous process memory without backing store. Try to
* allocate it some swap space here.
*
* XXX: implement swap clustering ?
*/
if (page->pte.chain && !page->mapping && !PagePrivate(page)) {
if (page->pte.chain && !mapping && !PagePrivate(page)) {
pte_chain_unlock(page);
if (!add_to_swap(page))
goto activate_locked;
......@@ -149,7 +151,7 @@ shrink_list(struct list_head *page_list, int nr_pages, zone_t *classzone,
* The page is mapped into the page tables of one or more
* processes. Try to unmap it here.
*/
if (page->pte.chain) {
if (page->pte.chain && mapping) {
switch (try_to_unmap(page)) {
case SWAP_ERROR:
case SWAP_FAIL:
......@@ -163,7 +165,6 @@ shrink_list(struct list_head *page_list, int nr_pages, zone_t *classzone,
}
}
pte_chain_unlock(page);
mapping = page->mapping;
/*
* FIXME: this is CPU-inefficient for shared mappings.
......@@ -398,10 +399,7 @@ static /* inline */ void refill_inactive(const int nr_pages_in)
page = list_entry(l_hold.prev, struct page, lru);
list_del(&page->lru);
if (page->pte.chain) {
if (test_and_set_bit(PG_chainlock, &page->flags)) {
list_add(&page->lru, &l_active);
continue;
}
pte_chain_lock(page);
if (page->pte.chain && page_referenced(page)) {
pte_chain_unlock(page);
list_add(&page->lru, &l_active);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment