Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75383
b: refs/heads/master
c: 22fb53c
h: refs/heads/master
i:
  75381: 318b3c8
  75379: 9c6d4bf
  75375: 896a836
v: v3
  • Loading branch information
Linus Torvalds committed Jan 11, 2008
1 parent 14c88cf commit 0e9c5a3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 94 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: e452e94e21e8f4a3c2ff045b301ca21c1f6d03bf
refs/heads/master: 22fb53c943b0ad4f86639bccb7ad8753be8ce435
81 changes: 3 additions & 78 deletions trunk/block/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <linux/time.h>
#include <asm/uaccess.h>

static DEFINE_PER_CPU(unsigned long long, blk_trace_cpu_offset) = { 0, };
static unsigned int blktrace_seq __read_mostly = 1;

/*
Expand All @@ -41,7 +40,7 @@ static void trace_note(struct blk_trace *bt, pid_t pid, int action,
const int cpu = smp_processor_id();

t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
t->time = ktime_to_ns(ktime_get());
t->device = bt->dev;
t->action = action;
t->pid = pid;
Expand Down Expand Up @@ -159,7 +158,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,

t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
t->sequence = ++(*sequence);
t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
t->time = ktime_to_ns(ktime_get());
t->sector = sector;
t->bytes = bytes;
t->action = what;
Expand All @@ -179,7 +178,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
EXPORT_SYMBOL_GPL(__blk_add_trace);

static struct dentry *blk_tree_root;
static struct mutex blk_tree_mutex;
static DEFINE_MUTEX(blk_tree_mutex);
static unsigned int root_users;

static inline void blk_remove_root(void)
Expand Down Expand Up @@ -505,77 +504,3 @@ void blk_trace_shutdown(struct request_queue *q)
blk_trace_remove(q);
}
}

/*
* Average offset over two calls to cpu_clock() with a gettimeofday()
* in the middle
*/
static void blk_check_time(unsigned long long *t, int this_cpu)
{
unsigned long long a, b;
struct timeval tv;

a = cpu_clock(this_cpu);
do_gettimeofday(&tv);
b = cpu_clock(this_cpu);

*t = tv.tv_sec * 1000000000 + tv.tv_usec * 1000;
*t -= (a + b) / 2;
}

/*
* calibrate our inter-CPU timings
*/
static void blk_trace_check_cpu_time(void *data)
{
unsigned long long *t;
int this_cpu = get_cpu();

t = &per_cpu(blk_trace_cpu_offset, this_cpu);

/*
* Just call it twice, hopefully the second call will be cache hot
* and a little more precise
*/
blk_check_time(t, this_cpu);
blk_check_time(t, this_cpu);

put_cpu();
}

static void blk_trace_set_ht_offsets(void)
{
#if defined(CONFIG_SCHED_SMT)
int cpu, i;

/*
* now make sure HT siblings have the same time offset
*/
preempt_disable();
for_each_online_cpu(cpu) {
unsigned long long *cpu_off, *sibling_off;

for_each_cpu_mask(i, per_cpu(cpu_sibling_map, cpu)) {
if (i == cpu)
continue;

cpu_off = &per_cpu(blk_trace_cpu_offset, cpu);
sibling_off = &per_cpu(blk_trace_cpu_offset, i);
*sibling_off = *cpu_off;
}
}
preempt_enable();
#endif
}

static __init int blk_trace_init(void)
{
mutex_init(&blk_tree_mutex);
on_each_cpu(blk_trace_check_cpu_time, NULL, 1, 1);
blk_trace_set_ht_offsets();

return 0;
}

module_init(blk_trace_init);

2 changes: 1 addition & 1 deletion trunk/drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ static int loop_thread(void *data)
static int loop_switch(struct loop_device *lo, struct file *file)
{
struct switch_request w;
struct bio *bio = bio_alloc(GFP_KERNEL, 1);
struct bio *bio = bio_alloc(GFP_KERNEL, 0);
if (!bio)
return -ENOMEM;
init_completion(&w.wait);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/ide/ide-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ static const struct dmi_system_id ide_acpi_dmi_table[] = {
DMI_MATCH(DMI_BIOS_VERSION, "KAM1.60")
},
},

{ } /* terminate list */
};

static int ide_acpi_blacklist(void)
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/mtd/chips/cfi_cmdset_0001.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,9 +1504,12 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
int ret, wbufsize, word_gap, words;
const struct kvec *vec;
unsigned long vec_seek;
unsigned long initial_adr;
int initial_len = len;

wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
adr += chip->start;
initial_adr = adr;
cmd_adr = adr & ~(wbufsize-1);

/* Let's determine this according to the interleave only once */
Expand All @@ -1519,7 +1522,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
return ret;
}

XIP_INVAL_CACHED_RANGE(map, adr, len);
XIP_INVAL_CACHED_RANGE(map, initial_adr, initial_len);
ENABLE_VPP(map);
xip_disable(map, chip, cmd_adr);

Expand Down Expand Up @@ -1610,7 +1613,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
chip->state = FL_WRITING;

ret = INVAL_CACHE_AND_WAIT(map, chip, cmd_adr,
adr, len,
initial_adr, initial_len,
chip->buffer_write_time);
if (ret) {
map_write(map, CMD(0x70), cmd_adr);
Expand Down
24 changes: 14 additions & 10 deletions trunk/drivers/video/ps3fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,6 @@ static int ps3fb_sync(struct fb_info *info, u32 frame)
u32 ddr_line_length, xdr_line_length;
u64 ddr_base, xdr_base;

acquire_console_sem();

if (frame > par->num_frames - 1) {
dev_dbg(info->device, "%s: invalid frame number (%u)\n",
__func__, frame);
Expand All @@ -464,7 +462,6 @@ static int ps3fb_sync(struct fb_info *info, u32 frame)
xdr_line_length);

out:
release_console_sem();
return error;
}

Expand All @@ -479,7 +476,10 @@ static int ps3fb_release(struct fb_info *info, int user)
if (atomic_dec_and_test(&ps3fb.f_count)) {
if (atomic_read(&ps3fb.ext_flip)) {
atomic_set(&ps3fb.ext_flip, 0);
ps3fb_sync(info, 0); /* single buffer */
if (!try_acquire_console_sem()) {
ps3fb_sync(info, 0); /* single buffer */
release_console_sem();
}
}
}
return 0;
Expand Down Expand Up @@ -865,7 +865,9 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
break;

dev_dbg(info->device, "PS3FB_IOCTL_FSEL:%d\n", val);
acquire_console_sem();
retval = ps3fb_sync(info, val);
release_console_sem();
break;

default:
Expand All @@ -885,7 +887,9 @@ static int ps3fbd(void *arg)
set_current_state(TASK_INTERRUPTIBLE);
if (ps3fb.is_kicked) {
ps3fb.is_kicked = 0;
acquire_console_sem();
ps3fb_sync(info, 0); /* single buffer */
release_console_sem();
}
schedule();
}
Expand Down Expand Up @@ -1234,12 +1238,6 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
ps3fb_flip_ctl(0, &ps3fb); /* flip off */
ps3fb.dinfo->irq.mask = 0;

if (info) {
unregister_framebuffer(info);
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
}

ps3av_register_flip_ctl(NULL, NULL);
if (ps3fb.task) {
struct task_struct *task = ps3fb.task;
Expand All @@ -1250,6 +1248,12 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
free_irq(ps3fb.irq_no, &dev->core);
ps3_irq_plug_destroy(ps3fb.irq_no);
}
if (info) {
unregister_framebuffer(info);
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
info = dev->core.driver_data = NULL;
}
iounmap((u8 __iomem *)ps3fb.dinfo);

status = lv1_gpu_context_free(ps3fb.context_handle);
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
/*
* offset and length are unused for chain entry. Clear them.
*/
prv->offset = 0;
prv->length = 0;
prv[prv_nents - 1].offset = 0;
prv[prv_nents - 1].length = 0;

/*
* Set lowest bit to indicate a link pointer, and make sure to clear
Expand Down

0 comments on commit 0e9c5a3

Please sign in to comment.