Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35538
b: refs/heads/master
c: 7b29122
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Sep 26, 2006
1 parent 4dcd739 commit eb7c972
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be5b6d3d6cb7311893c9fbeebf094591d5f760a8
refs/heads/master: 7b29122f9ec54db5c38a66a11127d94db0817c17
6 changes: 5 additions & 1 deletion trunk/arch/i386/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,13 @@ static void map_cpu_to_logical_apicid(void)
{
int cpu = smp_processor_id();
int apicid = logical_smp_processor_id();
int node = apicid_to_node(apicid);

if (!node_online(node))
node = first_online_node;

cpu_2_logical_apicid[cpu] = apicid;
map_cpu_to_node(cpu, apicid_to_node(apicid));
map_cpu_to_node(cpu, node);
}

static void unmap_cpu_to_logical_apicid(int cpu)
Expand Down
7 changes: 5 additions & 2 deletions trunk/arch/i386/mm/boot_ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
*/

#define BOOT_PTE_PTRS (PTRS_PER_PTE*2)
#define boot_pte_index(address) \
(((address) >> PAGE_SHIFT) & (BOOT_PTE_PTRS - 1))

static unsigned long boot_pte_index(unsigned long vaddr)
{
return __pa(vaddr) >> PAGE_SHIFT;
}

static inline boot_pte_t* boot_vaddr_to_pte(void *address)
{
Expand Down
13 changes: 8 additions & 5 deletions trunk/arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,16 +771,19 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
{
#ifdef CONFIG_ACPI_NUMA
int pxm_id;
int nid;

pxm_id = acpi_get_pxm(handle);

/*
* Assuming that the container driver would have set the proximity
* domain and would have initialized pxm_to_node(pxm_id) && pxm_flag
* We don't have cpu-only-node hotadd. But if the system equips
* SRAT table, pxm is already found and node is ready.
* So, just pxm_to_nid(pxm) is OK.
* This code here is for the system which doesn't have full SRAT
* table for possible cpus.
*/
node_cpuid[cpu].nid = (pxm_id < 0) ? 0 : pxm_to_node(pxm_id);

nid = acpi_map_pxm_to_node(pxm_id);
node_cpuid[cpu].phys_id = physid;
node_cpuid[cpu].nid = nid;
#endif
return (0);
}
Expand Down
34 changes: 31 additions & 3 deletions trunk/arch/ia64/kernel/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,36 @@ EXPORT_SYMBOL(cpu_to_node_map);

cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;

void __cpuinit map_cpu_to_node(int cpu, int nid)
{
int oldnid;
if (nid < 0) { /* just initialize by zero */
cpu_to_node_map[cpu] = 0;
return;
}
/* sanity check first */
oldnid = cpu_to_node_map[cpu];
if (cpu_isset(cpu, node_to_cpu_mask[oldnid])) {
return; /* nothing to do */
}
/* we don't have cpu-driven node hot add yet...
In usual case, node is created from SRAT at boot time. */
if (!node_online(nid))
nid = first_online_node;
cpu_to_node_map[cpu] = nid;
cpu_set(cpu, node_to_cpu_mask[nid]);
return;
}

void __cpuinit unmap_cpu_from_node(int cpu, int nid)
{
WARN_ON(!cpu_isset(cpu, node_to_cpu_mask[nid]));
WARN_ON(cpu_to_node_map[cpu] != nid);
cpu_to_node_map[cpu] = 0;
cpu_clear(cpu, node_to_cpu_mask[nid]);
}


/**
* build_cpu_to_node_map - setup cpu to node and node to cpumask arrays
*
Expand All @@ -49,8 +79,6 @@ void __init build_cpu_to_node_map(void)
node = node_cpuid[i].nid;
break;
}
cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
if (node >= 0)
cpu_set(cpu, node_to_cpu_mask[node]);
map_cpu_to_node(cpu, node);
}
}
6 changes: 5 additions & 1 deletion trunk/arch/ia64/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ int arch_register_cpu(int num)
*/
if (!can_cpei_retarget() && is_cpu_cpei_target(num))
sysfs_cpus[num].cpu.no_control = 1;
#ifdef CONFIG_NUMA
map_cpu_to_node(num, node_cpuid[num].nid);
#endif
#endif

return register_cpu(&sysfs_cpus[num].cpu, num);
Expand All @@ -45,7 +48,8 @@ int arch_register_cpu(int num)

void arch_unregister_cpu(int num)
{
return unregister_cpu(&sysfs_cpus[num].cpu);
unregister_cpu(&sysfs_cpus[num].cpu);
unmap_cpu_from_node(num, cpu_to_node(num));
}
EXPORT_SYMBOL(arch_register_cpu);
EXPORT_SYMBOL(arch_unregister_cpu);
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/char/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,12 @@ static const unsigned char days_in_mo[] =
*/
static inline unsigned char rtc_is_updating(void)
{
unsigned long flags;
unsigned char uip;

spin_lock_irq(&rtc_lock);
spin_lock_irqsave(&rtc_lock, flags);
uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
spin_unlock_irq(&rtc_lock);
spin_unlock_irqrestore(&rtc_lock, flags);
return uip;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/videodev.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
break;
}

if (index<=0 || index >= vfd->tvnormsize) {
if (index < 0 || index >= vfd->tvnormsize) {
ret=-EINVAL;
break;
}
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/video/fbsysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ static ssize_t store_bl_curve(struct class_device *class_device,
u8 tmp_curve[FB_BACKLIGHT_LEVELS];
unsigned int i;

/* Some drivers don't use framebuffer_alloc(), but those also
* don't have backlights.
*/
if (!fb_info || !fb_info->bl_dev)
return -ENODEV;

if (count != (FB_BACKLIGHT_LEVELS / 8 * 24))
return -EINVAL;

Expand Down Expand Up @@ -430,6 +436,12 @@ static ssize_t show_bl_curve(struct class_device *class_device, char *buf)
ssize_t len = 0;
unsigned int i;

/* Some drivers don't use framebuffer_alloc(), but those also
* don't have backlights.
*/
if (!fb_info || !fb_info->bl_dev)
return -ENODEV;

mutex_lock(&fb_info->bl_mutex);
for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
len += snprintf(&buf[len], PAGE_SIZE,
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static inline int autofs4_can_expire(struct dentry *dentry,

if (!do_now) {
/* Too young to die */
if (time_after(ino->last_used + timeout, now))
if (!timeout || time_after(ino->last_used + timeout, now))
return 0;

/* update last_used here :-
Expand Down Expand Up @@ -253,7 +253,7 @@ static struct dentry *autofs4_expire_direct(struct super_block *sb,
struct dentry *root = dget(sb->s_root);
int do_now = how & AUTOFS_EXP_IMMEDIATE;

if (!sbi->exp_timeout || !root)
if (!root)
return NULL;

now = jiffies;
Expand Down Expand Up @@ -293,7 +293,7 @@ static struct dentry *autofs4_expire_indirect(struct super_block *sb,
int do_now = how & AUTOFS_EXP_IMMEDIATE;
int exp_leaves = how & AUTOFS_EXP_LEAVES;

if ( !sbi->exp_timeout || !root )
if (!root)
return NULL;

now = jiffies;
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/asm-ia64/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ extern int paddr_to_nid(unsigned long paddr);

#define local_nodeid (cpu_to_node_map[smp_processor_id()])

extern void map_cpu_to_node(int cpu, int nid);
extern void unmap_cpu_from_node(int cpu, int nid);


#else /* !CONFIG_NUMA */

#define paddr_to_nid(addr) 0
Expand Down
6 changes: 6 additions & 0 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,12 @@ static int mod_sysfs_setup(struct module *mod,
{
int err;

if (!module_subsys.kset.subsys) {
printk(KERN_ERR "%s: module_subsys not initialized\n",
mod->name);
err = -EINVAL;
goto out;
}
memset(&mod->mkobj.kobj, 0, sizeof(mod->mkobj.kobj));
err = kobject_set_name(&mod->mkobj.kobj, "%s", mod->name);
if (err)
Expand Down
4 changes: 3 additions & 1 deletion trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,8 +1845,10 @@ static inline void free_zone_pagesets(int cpu)
for_each_zone(zone) {
struct per_cpu_pageset *pset = zone_pcp(zone, cpu);

/* Free per_cpu_pageset if it is slab allocated */
if (pset != &boot_pageset[cpu])
kfree(pset);
zone_pcp(zone, cpu) = NULL;
kfree(pset);
}
}

Expand Down

0 comments on commit eb7c972

Please sign in to comment.