Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75236
b: refs/heads/master
c: a5a9711
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras committed Jan 2, 2008
1 parent 17de6a3 commit d133a83
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 159 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: ef5fa1b191fc4cda7233491626585d1397535e26
refs/heads/master: a5a971129cc6155e26315fd28a450505ccc35fd8
9 changes: 0 additions & 9 deletions trunk/arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,6 @@ void do_notify_spus_active(void)
mutex_unlock(&cbe_spu_info[node].list_mutex);
}
}
EXPORT_SYMBOL_GPL(do_notify_spus_active);

#ifndef MODULE
void notify_spus_active(void)
{
do_notify_spus_active();
}
EXPORT_SYMBOL_GPL(notify_spus_active);
#endif

/**
* spu_bind_context - bind spu context to physical spu
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ default_entry:
/* Do an early initialization of the fixmap area */
movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax
addl $0x67, %eax /* 0x67 == _PAGE_TABLE */
addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */
movl %eax, 4092(%edx)

xorl %ebx,%ebx /* This is the boot CPU (BSP) */
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/leds/led-class.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
goto err_out;

/* add to the list of leds */
down_write(&leds_list_lock);
write_lock(&leds_list_lock);
list_add_tail(&led_cdev->node, &leds_list);
up_write(&leds_list_lock);
write_unlock(&leds_list_lock);

#ifdef CONFIG_LEDS_TRIGGERS
init_rwsem(&led_cdev->trigger_lock);
Expand Down Expand Up @@ -155,9 +155,9 @@ void led_classdev_unregister(struct led_classdev *led_cdev)

device_unregister(led_cdev->dev);

down_write(&leds_list_lock);
write_lock(&leds_list_lock);
list_del(&led_cdev->node);
up_write(&leds_list_lock);
write_unlock(&leds_list_lock);
}
EXPORT_SYMBOL_GPL(led_classdev_unregister);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/leds/led-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/rwsem.h>
#include <linux/spinlock.h>
#include <linux/leds.h>
#include "leds.h"

DECLARE_RWSEM(leds_list_lock);
DEFINE_RWLOCK(leds_list_lock);
LIST_HEAD(leds_list);

EXPORT_SYMBOL_GPL(leds_list);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/leds/led-triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ int led_trigger_register(struct led_trigger *trigger)
up_write(&triggers_list_lock);

/* Register with any LEDs that have this as a default trigger */
down_read(&leds_list_lock);
read_lock(&leds_list_lock);
list_for_each_entry(led_cdev, &leds_list, node) {
down_write(&led_cdev->trigger_lock);
if (!led_cdev->trigger && led_cdev->default_trigger &&
!strcmp(led_cdev->default_trigger, trigger->name))
led_trigger_set(led_cdev, trigger);
up_write(&led_cdev->trigger_lock);
}
up_read(&leds_list_lock);
read_unlock(&leds_list_lock);

return 0;
}
Expand Down Expand Up @@ -212,14 +212,14 @@ void led_trigger_unregister(struct led_trigger *trigger)
up_write(&triggers_list_lock);

/* Remove anyone actively using this trigger */
down_read(&leds_list_lock);
read_lock(&leds_list_lock);
list_for_each_entry(led_cdev, &leds_list, node) {
down_write(&led_cdev->trigger_lock);
if (led_cdev->trigger == trigger)
led_trigger_set(led_cdev, NULL);
up_write(&led_cdev->trigger_lock);
}
up_read(&leds_list_lock);
read_unlock(&leds_list_lock);
}

void led_trigger_unregister_simple(struct led_trigger *trigger)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/leds/leds-locomo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
static void locomoled_brightness_set(struct led_classdev *led_cdev,
enum led_brightness value, int offset)
{
struct locomo_dev *locomo_dev = LOCOMO_DEV(led_cdev->dev->parent);
struct locomo_dev *locomo_dev = LOCOMO_DEV(led_cdev->dev);
unsigned long flags;

local_irq_save(flags);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/leds/leds.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define __LEDS_H_INCLUDED

#include <linux/device.h>
#include <linux/rwsem.h>
#include <linux/leds.h>

static inline void led_set_brightness(struct led_classdev *led_cdev,
Expand All @@ -27,7 +26,7 @@ static inline void led_set_brightness(struct led_classdev *led_cdev,
led_cdev->brightness_set(led_cdev, value);
}

extern struct rw_semaphore leds_list_lock;
extern rwlock_t leds_list_lock;
extern struct list_head leds_list;

#ifdef CONFIG_LEDS_TRIGGERS
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/asm-x86/byteorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
} v;
v.u = val;
#ifdef CONFIG_X86_BSWAP
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b));
#else
v.s.a = ___arch__swab32(v.s.a);
v.s.b = ___arch__swab32(v.s.b);
__asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
asm("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
#endif
return v.u;
}
Expand Down
74 changes: 35 additions & 39 deletions trunk/include/asm-x86/msr.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,24 +191,56 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)

#define wrmsrl(msr,val) wrmsr(msr,(__u32)((__u64)(val)),((__u64)(val))>>32)

/* wrmsr with exception handling */
#define wrmsr_safe(msr,a,b) ({ int ret__; \
asm volatile("2: wrmsr ; xorl %0,%0\n" \
"1:\n\t" \
".section .fixup,\"ax\"\n\t" \
"3: movl %4,%0 ; jmp 1b\n\t" \
".previous\n\t" \
".section __ex_table,\"a\"\n" \
" .align 8\n\t" \
" .quad 2b,3b\n\t" \
".previous" \
: "=a" (ret__) \
: "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \
ret__; })

#define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32))

#define rdmsr_safe(msr,a,b) \
({ int ret__; \
asm volatile ("1: rdmsr\n" \
"2:\n" \
".section .fixup,\"ax\"\n" \
"3: movl %4,%0\n" \
" jmp 2b\n" \
".previous\n" \
".section __ex_table,\"a\"\n" \
" .align 8\n" \
" .quad 1b,3b\n" \
".previous":"=&bDS" (ret__), "=a"(*(a)), "=d"(*(b)) \
:"c"(msr), "i"(-EIO), "0"(0)); \
ret__; })

#define rdtsc(low,high) \
__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))

#define rdtscl(low) \
__asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")

#define rdtscp(low,high,aux) \
__asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))

#define rdtscll(val) do { \
unsigned int __a,__d; \
__asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); \
asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \
(val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
} while(0)

#define rdtscpll(val, aux) do { \
unsigned long __a, __d; \
__asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
(val) = (__d << 32) | __a; \
} while (0)

Expand All @@ -221,7 +253,6 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
: "=a" (low), "=d" (high) \
: "c" (counter))


static inline void cpuid(int op, unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
Expand Down Expand Up @@ -289,40 +320,6 @@ static inline unsigned int cpuid_edx(unsigned int op)
return edx;
}

#ifdef __KERNEL__

/* wrmsr with exception handling */
#define wrmsr_safe(msr,a,b) ({ int ret__; \
asm volatile("2: wrmsr ; xorl %0,%0\n" \
"1:\n\t" \
".section .fixup,\"ax\"\n\t" \
"3: movl %4,%0 ; jmp 1b\n\t" \
".previous\n\t" \
".section __ex_table,\"a\"\n" \
" .align 8\n\t" \
" .quad 2b,3b\n\t" \
".previous" \
: "=a" (ret__) \
: "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \
ret__; })

#define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32))

#define rdmsr_safe(msr,a,b) \
({ int ret__; \
asm volatile ("1: rdmsr\n" \
"2:\n" \
".section .fixup,\"ax\"\n" \
"3: movl %4,%0\n" \
" jmp 2b\n" \
".previous\n" \
".section __ex_table,\"a\"\n" \
" .align 8\n" \
" .quad 1b,3b\n" \
".previous":"=&bDS" (ret__), "=a"(*(a)), "=d"(*(b)) \
:"c"(msr), "i"(-EIO), "0"(0)); \
ret__; })

#ifdef CONFIG_SMP
void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
Expand All @@ -346,7 +343,6 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
return wrmsr_safe(msr_no, l, h);
}
#endif /* CONFIG_SMP */
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */

#endif /* !__i386__ */
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/slub_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,4 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
}
#endif

extern const struct seq_operations slabinfo_op;

#endif /* _LINUX_SLUB_DEF_H */
105 changes: 13 additions & 92 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3076,19 +3076,6 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
return slab_alloc(s, gfpflags, node, caller);
}

static unsigned long count_partial(struct kmem_cache_node *n)
{
unsigned long flags;
unsigned long x = 0;
struct page *page;

spin_lock_irqsave(&n->list_lock, flags);
list_for_each_entry(page, &n->partial, lru)
x += page->inuse;
spin_unlock_irqrestore(&n->list_lock, flags);
return x;
}

#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)
static int validate_slab(struct kmem_cache *s, struct page *page,
unsigned long *map)
Expand Down Expand Up @@ -3471,6 +3458,19 @@ static int list_locations(struct kmem_cache *s, char *buf,
return n;
}

static unsigned long count_partial(struct kmem_cache_node *n)
{
unsigned long flags;
unsigned long x = 0;
struct page *page;

spin_lock_irqsave(&n->list_lock, flags);
list_for_each_entry(page, &n->partial, lru)
x += page->inuse;
spin_unlock_irqrestore(&n->list_lock, flags);
return x;
}

enum slab_stat_type {
SL_FULL,
SL_PARTIAL,
Expand Down Expand Up @@ -4123,82 +4123,3 @@ static int __init slab_sysfs_init(void)

__initcall(slab_sysfs_init);
#endif

/*
* The /proc/slabinfo ABI
*/
#ifdef CONFIG_PROC_FS

static void print_slabinfo_header(struct seq_file *m)
{
seq_puts(m, "slabinfo - version: 2.1\n");
seq_puts(m, "# name <active_objs> <num_objs> <objsize> "
"<objperslab> <pagesperslab>");
seq_puts(m, " : tunables <limit> <batchcount> <sharedfactor>");
seq_puts(m, " : slabdata <active_slabs> <num_slabs> <sharedavail>");
seq_putc(m, '\n');
}

static void *s_start(struct seq_file *m, loff_t *pos)
{
loff_t n = *pos;

down_read(&slub_lock);
if (!n)
print_slabinfo_header(m);

return seq_list_start(&slab_caches, *pos);
}

static void *s_next(struct seq_file *m, void *p, loff_t *pos)
{
return seq_list_next(p, &slab_caches, pos);
}

static void s_stop(struct seq_file *m, void *p)
{
up_read(&slub_lock);
}

static int s_show(struct seq_file *m, void *p)
{
unsigned long nr_partials = 0;
unsigned long nr_slabs = 0;
unsigned long nr_inuse = 0;
unsigned long nr_objs;
struct kmem_cache *s;
int node;

s = list_entry(p, struct kmem_cache, list);

for_each_online_node(node) {
struct kmem_cache_node *n = get_node(s, node);

if (!n)
continue;

nr_partials += n->nr_partial;
nr_slabs += atomic_long_read(&n->nr_slabs);
nr_inuse += count_partial(n);
}

nr_objs = nr_slabs * s->objects;
nr_inuse += (nr_slabs - nr_partials) * s->objects;

seq_printf(m, "%-17s %6lu %6lu %6u %4u %4d", s->name, nr_inuse,
nr_objs, s->size, s->objects, (1 << s->order));
seq_printf(m, " : tunables %4u %4u %4u", 0, 0, 0);
seq_printf(m, " : slabdata %6lu %6lu %6lu", nr_slabs, nr_slabs,
0UL);
seq_putc(m, '\n');
return 0;
}

const struct seq_operations slabinfo_op = {
.start = s_start,
.next = s_next,
.stop = s_stop,
.show = s_show,
};

#endif /* CONFIG_PROC_FS */

0 comments on commit d133a83

Please sign in to comment.