提交 2a383c63 编写于 作者: L Linus Torvalds

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] Quicklist support for IA64
  [IA64] fix Kprobes reentrancy
  [IA64] SN: validate smp_affinity mask on intr redirect
  [IA64] drivers/char/snsc_event.c:206: warning: unused variable `p'
  [IA64] mca.c:121: warning: 'cpe_poll_timer' defined but not used
  [IA64] Fix - Section mismatch: reference to .init.data:mvec_name
  [IA64] more warning cleanups
  [IA64] Wire up epoll_pwait and utimensat
  [IA64] Fix warnings resulting from type-checking in dev_dbg()
  [IA64] typo s/kenrel/kernel/
...@@ -31,6 +31,10 @@ config ZONE_DMA ...@@ -31,6 +31,10 @@ config ZONE_DMA
def_bool y def_bool y
depends on !IA64_SGI_SN2 depends on !IA64_SGI_SN2
config QUICKLIST
bool
default y
config MMU config MMU
bool bool
default y default y
......
...@@ -63,7 +63,7 @@ use_swiotlb (struct device *dev) ...@@ -63,7 +63,7 @@ use_swiotlb (struct device *dev)
return dev && dev->dma_mask && !hwiommu_dma_supported(dev, *dev->dma_mask); return dev && dev->dma_mask && !hwiommu_dma_supported(dev, *dev->dma_mask);
} }
void void __init
hwsw_init (void) hwsw_init (void)
{ {
/* default to a smallish 2MB sw I/O TLB */ /* default to a smallish 2MB sw I/O TLB */
......
...@@ -1583,5 +1583,7 @@ sys_call_table: ...@@ -1583,5 +1583,7 @@ sys_call_table:
data8 sys_vmsplice data8 sys_vmsplice
data8 sys_ni_syscall // reserved for move_pages data8 sys_ni_syscall // reserved for move_pages
data8 sys_getcpu data8 sys_getcpu
data8 sys_epoll_pwait // 1305
data8 sys_utimensat
.org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
...@@ -291,5 +291,5 @@ module_init(err_inject_init); ...@@ -291,5 +291,5 @@ module_init(err_inject_init);
module_exit(err_inject_exit); module_exit(err_inject_exit);
MODULE_AUTHOR("Fenghua Yu <fenghua.yu@intel.com>"); MODULE_AUTHOR("Fenghua Yu <fenghua.yu@intel.com>");
MODULE_DESCRIPTION("MC error injection kenrel sysfs interface"); MODULE_DESCRIPTION("MC error injection kernel sysfs interface");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -104,6 +104,17 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir) ...@@ -104,6 +104,17 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
irq_redir[irq] = (char) (redir & 0xff); irq_redir[irq] = (char) (redir & 0xff);
} }
} }
bool is_affinity_mask_valid(cpumask_t cpumask)
{
if (ia64_platform_is("sn2")) {
/* Only allow one CPU to be specified in the smp_affinity mask */
if (cpus_weight(cpumask) != 1)
return false;
}
return true;
}
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
......
...@@ -370,14 +370,18 @@ static int __kprobes valid_kprobe_addr(int template, int slot, ...@@ -370,14 +370,18 @@ static int __kprobes valid_kprobe_addr(int template, int slot,
static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
{ {
kcb->prev_kprobe.kp = kprobe_running(); unsigned int i;
kcb->prev_kprobe.status = kcb->kprobe_status; i = atomic_add_return(1, &kcb->prev_kprobe_index);
kcb->prev_kprobe[i-1].kp = kprobe_running();
kcb->prev_kprobe[i-1].status = kcb->kprobe_status;
} }
static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
{ {
__get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; unsigned int i;
kcb->kprobe_status = kcb->prev_kprobe.status; i = atomic_sub_return(1, &kcb->prev_kprobe_index);
__get_cpu_var(current_kprobe) = kcb->prev_kprobe[i].kp;
kcb->kprobe_status = kcb->prev_kprobe[i].status;
} }
static void __kprobes set_current_kprobe(struct kprobe *p, static void __kprobes set_current_kprobe(struct kprobe *p,
......
...@@ -35,7 +35,7 @@ lookup_machvec (const char *name) ...@@ -35,7 +35,7 @@ lookup_machvec (const char *name)
return 0; return 0;
} }
void void __init
machvec_init (const char *name) machvec_init (const char *name)
{ {
struct ia64_machine_vector *mv; struct ia64_machine_vector *mv;
......
...@@ -118,7 +118,9 @@ static ia64_mc_info_t ia64_mc_info; ...@@ -118,7 +118,9 @@ static ia64_mc_info_t ia64_mc_info;
#define CPE_HISTORY_LENGTH 5 #define CPE_HISTORY_LENGTH 5
#define CMC_HISTORY_LENGTH 5 #define CMC_HISTORY_LENGTH 5
#ifdef CONFIG_ACPI
static struct timer_list cpe_poll_timer; static struct timer_list cpe_poll_timer;
#endif
static struct timer_list cmc_poll_timer; static struct timer_list cmc_poll_timer;
/* /*
* This variable tells whether we are currently in polling mode. * This variable tells whether we are currently in polling mode.
......
...@@ -88,7 +88,7 @@ void show_mem(void) ...@@ -88,7 +88,7 @@ void show_mem(void)
printk(KERN_INFO "%d pages shared\n", total_shared); printk(KERN_INFO "%d pages shared\n", total_shared);
printk(KERN_INFO "%d pages swap cached\n", total_cached); printk(KERN_INFO "%d pages swap cached\n", total_cached);
printk(KERN_INFO "Total of %ld pages in page table cache\n", printk(KERN_INFO "Total of %ld pages in page table cache\n",
pgtable_quicklist_total_size()); quicklist_total_size());
printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages());
} }
......
...@@ -561,7 +561,7 @@ void show_mem(void) ...@@ -561,7 +561,7 @@ void show_mem(void)
printk(KERN_INFO "%d pages shared\n", total_shared); printk(KERN_INFO "%d pages shared\n", total_shared);
printk(KERN_INFO "%d pages swap cached\n", total_cached); printk(KERN_INFO "%d pages swap cached\n", total_cached);
printk(KERN_INFO "Total of %ld pages in page table cache\n", printk(KERN_INFO "Total of %ld pages in page table cache\n",
pgtable_quicklist_total_size()); quicklist_total_size());
printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages());
} }
......
...@@ -39,9 +39,6 @@ ...@@ -39,9 +39,6 @@
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
DEFINE_PER_CPU(unsigned long *, __pgtable_quicklist);
DEFINE_PER_CPU(long, __pgtable_quicklist_size);
extern void ia64_tlb_init (void); extern void ia64_tlb_init (void);
unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL; unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL;
...@@ -56,54 +53,6 @@ EXPORT_SYMBOL(vmem_map); ...@@ -56,54 +53,6 @@ EXPORT_SYMBOL(vmem_map);
struct page *zero_page_memmap_ptr; /* map entry for zero page */ struct page *zero_page_memmap_ptr; /* map entry for zero page */
EXPORT_SYMBOL(zero_page_memmap_ptr); EXPORT_SYMBOL(zero_page_memmap_ptr);
#define MIN_PGT_PAGES 25UL
#define MAX_PGT_FREES_PER_PASS 16L
#define PGT_FRACTION_OF_NODE_MEM 16
static inline long
max_pgt_pages(void)
{
u64 node_free_pages, max_pgt_pages;
#ifndef CONFIG_NUMA
node_free_pages = nr_free_pages();
#else
node_free_pages = node_page_state(numa_node_id(), NR_FREE_PAGES);
#endif
max_pgt_pages = node_free_pages / PGT_FRACTION_OF_NODE_MEM;
max_pgt_pages = max(max_pgt_pages, MIN_PGT_PAGES);
return max_pgt_pages;
}
static inline long
min_pages_to_free(void)
{
long pages_to_free;
pages_to_free = pgtable_quicklist_size - max_pgt_pages();
pages_to_free = min(pages_to_free, MAX_PGT_FREES_PER_PASS);
return pages_to_free;
}
void
check_pgt_cache(void)
{
long pages_to_free;
if (unlikely(pgtable_quicklist_size <= MIN_PGT_PAGES))
return;
preempt_disable();
while (unlikely((pages_to_free = min_pages_to_free()) > 0)) {
while (pages_to_free--) {
free_page((unsigned long)pgtable_quicklist_alloc());
}
preempt_enable();
preempt_disable();
}
preempt_enable();
}
void void
lazy_mmu_prot_update (pte_t pte) lazy_mmu_prot_update (pte_t pte)
{ {
......
...@@ -364,7 +364,7 @@ void sn_bus_store_sysdata(struct pci_dev *dev) ...@@ -364,7 +364,7 @@ void sn_bus_store_sysdata(struct pci_dev *dev)
element = kzalloc(sizeof(struct sysdata_el), GFP_KERNEL); element = kzalloc(sizeof(struct sysdata_el), GFP_KERNEL);
if (!element) { if (!element) {
dev_dbg(dev, "%s: out of memory!\n", __FUNCTION__); dev_dbg(&dev->dev, "%s: out of memory!\n", __FUNCTION__);
return; return;
} }
element->sysdata = SN_PCIDEV_INFO(dev); element->sysdata = SN_PCIDEV_INFO(dev);
......
...@@ -574,7 +574,7 @@ xpc_update_partition_info(struct xpc_partition *part, u8 remote_rp_version, ...@@ -574,7 +574,7 @@ xpc_update_partition_info(struct xpc_partition *part, u8 remote_rp_version,
u64 remote_vars_pa, struct xpc_vars *remote_vars) u64 remote_vars_pa, struct xpc_vars *remote_vars)
{ {
part->remote_rp_version = remote_rp_version; part->remote_rp_version = remote_rp_version;
dev_dbg(xpc_part, " remote_rp_version = 0x%016lx\n", dev_dbg(xpc_part, " remote_rp_version = 0x%016x\n",
part->remote_rp_version); part->remote_rp_version);
part->remote_rp_stamp = *remote_rp_stamp; part->remote_rp_stamp = *remote_rp_stamp;
......
...@@ -343,8 +343,8 @@ xpnet_dev_open(struct net_device *dev) ...@@ -343,8 +343,8 @@ xpnet_dev_open(struct net_device *dev)
enum xpc_retval ret; enum xpc_retval ret;
dev_dbg(xpnet, "calling xpc_connect(%d, 0x%p, NULL, %ld, %ld, %d, " dev_dbg(xpnet, "calling xpc_connect(%d, 0x%p, NULL, %ld, %ld, %ld, "
"%d)\n", XPC_NET_CHANNEL, xpnet_connection_activity, "%ld)\n", XPC_NET_CHANNEL, xpnet_connection_activity,
XPNET_MSG_SIZE, XPNET_MSG_NENTRIES, XPNET_MAX_KTHREADS, XPNET_MSG_SIZE, XPNET_MSG_NENTRIES, XPNET_MAX_KTHREADS,
XPNET_MAX_IDLE_KTHREADS); XPNET_MAX_IDLE_KTHREADS);
......
...@@ -203,8 +203,6 @@ scdrv_dispatch_event(char *event, int len) ...@@ -203,8 +203,6 @@ scdrv_dispatch_event(char *event, int len)
class = (code & EV_CLASS_MASK); class = (code & EV_CLASS_MASK);
if (class == EV_CLASS_PWRD_NOTIFY || code == ENV_PWRDN_PEND) { if (class == EV_CLASS_PWRD_NOTIFY || code == ENV_PWRDN_PEND) {
struct task_struct *p;
if (snsc_shutting_down) if (snsc_shutting_down)
return; return;
......
...@@ -249,19 +249,19 @@ static int sn_slot_enable(struct hotplug_slot *bss_hotplug_slot, ...@@ -249,19 +249,19 @@ static int sn_slot_enable(struct hotplug_slot *bss_hotplug_slot,
if (rc == PCI_SLOT_ALREADY_UP) { if (rc == PCI_SLOT_ALREADY_UP) {
dev_dbg(slot->pci_bus->self, "is already active\n"); dev_dbg(&slot->pci_bus->self->dev, "is already active\n");
return 1; /* return 1 to user */ return 1; /* return 1 to user */
} }
if (rc == PCI_L1_ERR) { if (rc == PCI_L1_ERR) {
dev_dbg(slot->pci_bus->self, dev_dbg(&slot->pci_bus->self->dev,
"L1 failure %d with message: %s", "L1 failure %d with message: %s",
resp.resp_sub_errno, resp.resp_l1_msg); resp.resp_sub_errno, resp.resp_l1_msg);
return -EPERM; return -EPERM;
} }
if (rc) { if (rc) {
dev_dbg(slot->pci_bus->self, dev_dbg(&slot->pci_bus->self->dev,
"insert failed with error %d sub-error %d\n", "insert failed with error %d sub-error %d\n",
rc, resp.resp_sub_errno); rc, resp.resp_sub_errno);
return -EIO; return -EIO;
...@@ -287,25 +287,25 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot, ...@@ -287,25 +287,25 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot,
if ((action == PCI_REQ_SLOT_ELIGIBLE) && if ((action == PCI_REQ_SLOT_ELIGIBLE) &&
(rc == PCI_SLOT_ALREADY_DOWN)) { (rc == PCI_SLOT_ALREADY_DOWN)) {
dev_dbg(slot->pci_bus->self, "Slot %s already inactive\n"); dev_dbg(&slot->pci_bus->self->dev, "Slot %s already inactive\n", slot->physical_path);
return 1; /* return 1 to user */ return 1; /* return 1 to user */
} }
if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_EMPTY_33MHZ)) { if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_EMPTY_33MHZ)) {
dev_dbg(slot->pci_bus->self, dev_dbg(&slot->pci_bus->self->dev,
"Cannot remove last 33MHz card\n"); "Cannot remove last 33MHz card\n");
return -EPERM; return -EPERM;
} }
if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_L1_ERR)) { if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_L1_ERR)) {
dev_dbg(slot->pci_bus->self, dev_dbg(&slot->pci_bus->self->dev,
"L1 failure %d with message \n%s\n", "L1 failure %d with message \n%s\n",
resp.resp_sub_errno, resp.resp_l1_msg); resp.resp_sub_errno, resp.resp_l1_msg);
return -EPERM; return -EPERM;
} }
if ((action == PCI_REQ_SLOT_ELIGIBLE) && rc) { if ((action == PCI_REQ_SLOT_ELIGIBLE) && rc) {
dev_dbg(slot->pci_bus->self, dev_dbg(&slot->pci_bus->self->dev,
"remove failed with error %d sub-error %d\n", "remove failed with error %d sub-error %d\n",
rc, resp.resp_sub_errno); rc, resp.resp_sub_errno);
return -EIO; return -EIO;
...@@ -317,12 +317,12 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot, ...@@ -317,12 +317,12 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot,
if ((action == PCI_REQ_SLOT_DISABLE) && !rc) { if ((action == PCI_REQ_SLOT_DISABLE) && !rc) {
pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus);
pcibus_info->pbi_enabled_devices &= ~(1 << device_num); pcibus_info->pbi_enabled_devices &= ~(1 << device_num);
dev_dbg(slot->pci_bus->self, "remove successful\n"); dev_dbg(&slot->pci_bus->self->dev, "remove successful\n");
return 0; return 0;
} }
if ((action == PCI_REQ_SLOT_DISABLE) && rc) { if ((action == PCI_REQ_SLOT_DISABLE) && rc) {
dev_dbg(slot->pci_bus->self,"remove failed rc = %d\n", rc); dev_dbg(&slot->pci_bus->self->dev,"remove failed rc = %d\n", rc);
} }
return rc; return rc;
...@@ -375,7 +375,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) ...@@ -375,7 +375,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
num_funcs = pci_scan_slot(slot->pci_bus, num_funcs = pci_scan_slot(slot->pci_bus,
PCI_DEVFN(slot->device_num + 1, 0)); PCI_DEVFN(slot->device_num + 1, 0));
if (!num_funcs) { if (!num_funcs) {
dev_dbg(slot->pci_bus->self, "no device in slot\n"); dev_dbg(&slot->pci_bus->self->dev, "no device in slot\n");
mutex_unlock(&sn_hotplug_mutex); mutex_unlock(&sn_hotplug_mutex);
return -ENODEV; return -ENODEV;
} }
...@@ -427,7 +427,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) ...@@ -427,7 +427,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
phandle = PCI_CONTROLLER(slot->pci_bus)->acpi_handle; phandle = PCI_CONTROLLER(slot->pci_bus)->acpi_handle;
if (acpi_bus_get_device(phandle, &pdevice)) { if (acpi_bus_get_device(phandle, &pdevice)) {
dev_dbg(slot->pci_bus->self, dev_dbg(&slot->pci_bus->self->dev,
"no parent device, assuming NULL\n"); "no parent device, assuming NULL\n");
pdevice = NULL; pdevice = NULL;
} }
...@@ -479,10 +479,10 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) ...@@ -479,10 +479,10 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
mutex_unlock(&sn_hotplug_mutex); mutex_unlock(&sn_hotplug_mutex);
if (rc == 0) if (rc == 0)
dev_dbg(slot->pci_bus->self, dev_dbg(&slot->pci_bus->self->dev,
"insert operation successful\n"); "insert operation successful\n");
else else
dev_dbg(slot->pci_bus->self, dev_dbg(&slot->pci_bus->self->dev,
"insert operation failed rc = %d\n", rc); "insert operation failed rc = %d\n", rc);
return rc; return rc;
...@@ -659,16 +659,16 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus) ...@@ -659,16 +659,16 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
if (rc) if (rc)
goto register_err; goto register_err;
} }
dev_dbg(pci_bus->self, "Registered bus with hotplug\n"); dev_dbg(&pci_bus->self->dev, "Registered bus with hotplug\n");
return rc; return rc;
register_err: register_err:
dev_dbg(pci_bus->self, "bus failed to register with err = %d\n", dev_dbg(&pci_bus->self->dev, "bus failed to register with err = %d\n",
rc); rc);
alloc_err: alloc_err:
if (rc == -ENOMEM) if (rc == -ENOMEM)
dev_dbg(pci_bus->self, "Memory allocation error\n"); dev_dbg(&pci_bus->self->dev, "Memory allocation error\n");
/* destroy THIS element */ /* destroy THIS element */
if (bss_hotplug_slot) if (bss_hotplug_slot)
...@@ -701,10 +701,10 @@ static int sn_pci_hotplug_init(void) ...@@ -701,10 +701,10 @@ static int sn_pci_hotplug_init(void)
rc = sn_pci_bus_valid(pci_bus); rc = sn_pci_bus_valid(pci_bus);
if (rc != 1) { if (rc != 1) {
dev_dbg(pci_bus->self, "not a valid hotplug bus\n"); dev_dbg(&pci_bus->self->dev, "not a valid hotplug bus\n");
continue; continue;
} }
dev_dbg(pci_bus->self, "valid hotplug bus\n"); dev_dbg(&pci_bus->self->dev, "valid hotplug bus\n");
rc = sn_hotplug_slot_register(pci_bus); rc = sn_hotplug_slot_register(pci_bus);
if (!rc) { if (!rc) {
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
* 02/29/00 D.Mosberger moved most things into hw_irq.h * 02/29/00 D.Mosberger moved most things into hw_irq.h
*/ */
#include <linux/types.h>
#include <linux/cpumask.h>
#define NR_IRQS 256 #define NR_IRQS 256
#define NR_IRQ_VECTORS NR_IRQS #define NR_IRQ_VECTORS NR_IRQS
...@@ -29,5 +32,8 @@ extern void disable_irq (unsigned int); ...@@ -29,5 +32,8 @@ extern void disable_irq (unsigned int);
extern void disable_irq_nosync (unsigned int); extern void disable_irq_nosync (unsigned int);
extern void enable_irq (unsigned int); extern void enable_irq (unsigned int);
extern void set_irq_affinity_info (unsigned int irq, int dest, int redir); extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
bool is_affinity_mask_valid(cpumask_t cpumask);
#define is_affinity_mask_valid is_affinity_mask_valid
#endif /* _ASM_IA64_IRQ_H */ #endif /* _ASM_IA64_IRQ_H */
...@@ -71,13 +71,15 @@ struct prev_kprobe { ...@@ -71,13 +71,15 @@ struct prev_kprobe {
#define MAX_PARAM_RSE_SIZE (0x60+0x60/0x3f) #define MAX_PARAM_RSE_SIZE (0x60+0x60/0x3f)
/* per-cpu kprobe control block */ /* per-cpu kprobe control block */
#define ARCH_PREV_KPROBE_SZ 2
struct kprobe_ctlblk { struct kprobe_ctlblk {
unsigned long kprobe_status; unsigned long kprobe_status;
struct pt_regs jprobe_saved_regs; struct pt_regs jprobe_saved_regs;
unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE]; unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE];
unsigned long *bsp; unsigned long *bsp;
unsigned long cfm; unsigned long cfm;
struct prev_kprobe prev_kprobe; atomic_t prev_kprobe_index;
struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
}; };
#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
......
...@@ -18,71 +18,18 @@ ...@@ -18,71 +18,18 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/page-flags.h> #include <linux/page-flags.h>
#include <linux/threads.h> #include <linux/threads.h>
#include <linux/quicklist.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
DECLARE_PER_CPU(unsigned long *, __pgtable_quicklist);
#define pgtable_quicklist __ia64_per_cpu_var(__pgtable_quicklist)
DECLARE_PER_CPU(long, __pgtable_quicklist_size);
#define pgtable_quicklist_size __ia64_per_cpu_var(__pgtable_quicklist_size)
static inline long pgtable_quicklist_total_size(void)
{
long ql_size = 0;
int cpuid;
for_each_online_cpu(cpuid) {
ql_size += per_cpu(__pgtable_quicklist_size, cpuid);
}
return ql_size;
}
static inline void *pgtable_quicklist_alloc(void)
{
unsigned long *ret = NULL;
preempt_disable();
ret = pgtable_quicklist;
if (likely(ret != NULL)) {
pgtable_quicklist = (unsigned long *)(*ret);
ret[0] = 0;
--pgtable_quicklist_size;
preempt_enable();
} else {
preempt_enable();
ret = (unsigned long *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
}
return ret;
}
static inline void pgtable_quicklist_free(void *pgtable_entry)
{
#ifdef CONFIG_NUMA
int nid = page_to_nid(virt_to_page(pgtable_entry));
if (unlikely(nid != numa_node_id())) {
free_page((unsigned long)pgtable_entry);
return;
}
#endif
preempt_disable();
*(unsigned long *)pgtable_entry = (unsigned long)pgtable_quicklist;
pgtable_quicklist = (unsigned long *)pgtable_entry;
++pgtable_quicklist_size;
preempt_enable();
}
static inline pgd_t *pgd_alloc(struct mm_struct *mm) static inline pgd_t *pgd_alloc(struct mm_struct *mm)
{ {
return pgtable_quicklist_alloc(); return quicklist_alloc(0, GFP_KERNEL, NULL);
} }
static inline void pgd_free(pgd_t * pgd) static inline void pgd_free(pgd_t * pgd)
{ {
pgtable_quicklist_free(pgd); quicklist_free(0, NULL, pgd);
} }
#ifdef CONFIG_PGTABLE_4 #ifdef CONFIG_PGTABLE_4
...@@ -94,12 +41,12 @@ pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud) ...@@ -94,12 +41,12 @@ pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud)
static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
{ {
return pgtable_quicklist_alloc(); return quicklist_alloc(0, GFP_KERNEL, NULL);
} }
static inline void pud_free(pud_t * pud) static inline void pud_free(pud_t * pud)
{ {
pgtable_quicklist_free(pud); quicklist_free(0, NULL, pud);
} }
#define __pud_free_tlb(tlb, pud) pud_free(pud) #define __pud_free_tlb(tlb, pud) pud_free(pud)
#endif /* CONFIG_PGTABLE_4 */ #endif /* CONFIG_PGTABLE_4 */
...@@ -112,12 +59,12 @@ pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd) ...@@ -112,12 +59,12 @@ pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
{ {
return pgtable_quicklist_alloc(); return quicklist_alloc(0, GFP_KERNEL, NULL);
} }
static inline void pmd_free(pmd_t * pmd) static inline void pmd_free(pmd_t * pmd)
{ {
pgtable_quicklist_free(pmd); quicklist_free(0, NULL, pmd);
} }
#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd)
...@@ -137,28 +84,31 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte) ...@@ -137,28 +84,31 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
static inline struct page *pte_alloc_one(struct mm_struct *mm, static inline struct page *pte_alloc_one(struct mm_struct *mm,
unsigned long addr) unsigned long addr)
{ {
void *pg = pgtable_quicklist_alloc(); void *pg = quicklist_alloc(0, GFP_KERNEL, NULL);
return pg ? virt_to_page(pg) : NULL; return pg ? virt_to_page(pg) : NULL;
} }
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
unsigned long addr) unsigned long addr)
{ {
return pgtable_quicklist_alloc(); return quicklist_alloc(0, GFP_KERNEL, NULL);
} }
static inline void pte_free(struct page *pte) static inline void pte_free(struct page *pte)
{ {
pgtable_quicklist_free(page_address(pte)); quicklist_free_page(0, NULL, pte);
} }
static inline void pte_free_kernel(pte_t * pte) static inline void pte_free_kernel(pte_t * pte)
{ {
pgtable_quicklist_free(pte); quicklist_free(0, NULL, pte);
} }
#define __pte_free_tlb(tlb, pte) pte_free(pte) static inline void check_pgt_cache(void)
{
quicklist_trim(0, NULL, 25, 16);
}
extern void check_pgt_cache(void); #define __pte_free_tlb(tlb, pte) pte_free(pte)
#endif /* _ASM_IA64_PGALLOC_H */ #endif /* _ASM_IA64_PGALLOC_H */
...@@ -294,11 +294,13 @@ ...@@ -294,11 +294,13 @@
#define __NR_vmsplice 1302 #define __NR_vmsplice 1302
/* 1303 reserved for move_pages */ /* 1303 reserved for move_pages */
#define __NR_getcpu 1304 #define __NR_getcpu 1304
#define __NR_epoll_pwait 1305
#define __NR_utimensat 1306
#ifdef __KERNEL__ #ifdef __KERNEL__
#define NR_syscalls 281 /* length of syscall table */ #define NR_syscalls 283 /* length of syscall table */
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_RT_SIGSUSPEND
......
...@@ -27,6 +27,10 @@ static int irq_affinity_read_proc(char *page, char **start, off_t off, ...@@ -27,6 +27,10 @@ static int irq_affinity_read_proc(char *page, char **start, off_t off,
return len; return len;
} }
#ifndef is_affinity_mask_valid
#define is_affinity_mask_valid(val) 1
#endif
int no_irq_affinity; int no_irq_affinity;
static int irq_affinity_write_proc(struct file *file, const char __user *buffer, static int irq_affinity_write_proc(struct file *file, const char __user *buffer,
unsigned long count, void *data) unsigned long count, void *data)
...@@ -42,6 +46,9 @@ static int irq_affinity_write_proc(struct file *file, const char __user *buffer, ...@@ -42,6 +46,9 @@ static int irq_affinity_write_proc(struct file *file, const char __user *buffer,
if (err) if (err)
return err; return err;
if (!is_affinity_mask_valid(new_value))
return -EINVAL;
/* /*
* Do not allow disabling IRQs completely - it's a too easy * Do not allow disabling IRQs completely - it's a too easy
* way to make the system unusable accidentally :-) At least * way to make the system unusable accidentally :-) At least
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册