Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75060
b: refs/heads/master
c: bd87f1f
h: refs/heads/master
v: v3
  • Loading branch information
Barry Kasindorf authored and Ingo Molnar committed Dec 18, 2007
1 parent 4372bd3 commit 49e380e
Show file tree
Hide file tree
Showing 24 changed files with 230 additions and 201 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: 51dad801e271f3754a728e5b9a2ef974576490cc
refs/heads/master: bd87f1f028ddaad45d4a9a3621dfe688c840ba41
22 changes: 16 additions & 6 deletions trunk/arch/x86/oprofile/op_model_athlon.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file op_model_athlon.h
* athlon / K7 model-specific MSR operations
* athlon / K7 / K8 / Family 10h model-specific MSR operations
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
Expand Down Expand Up @@ -31,12 +31,16 @@
#define CTRL_WRITE(l,h,msrs,c) do {wrmsr(msrs->controls[(c)].addr, (l), (h));} while (0)
#define CTRL_SET_ACTIVE(n) (n |= (1<<22))
#define CTRL_SET_INACTIVE(n) (n &= ~(1<<22))
#define CTRL_CLEAR(x) (x &= (1<<21))
#define CTRL_CLEAR_LO(x) (x &= (1<<21))
#define CTRL_CLEAR_HI(x) (x &= 0xfffffcf0)
#define CTRL_SET_ENABLE(val) (val |= 1<<20)
#define CTRL_SET_USR(val,u) (val |= ((u & 1) << 16))
#define CTRL_SET_KERN(val,k) (val |= ((k & 1) << 17))
#define CTRL_SET_UM(val, m) (val |= (m << 8))
#define CTRL_SET_EVENT(val, e) (val |= e)
#define CTRL_SET_EVENT_LOW(val, e) (val |= (e & 0xff))
#define CTRL_SET_EVENT_HIGH(val, e) (val |= ((e >> 8) & 0xf))
#define CTRL_SET_HOST_ONLY(val, h) (val |= ((h & 1) << 9))
#define CTRL_SET_GUEST_ONLY(val, h) (val |= ((h & 1) << 8))

static unsigned long reset_value[NUM_COUNTERS];

Expand Down Expand Up @@ -70,7 +74,8 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs)
if (unlikely(!CTRL_IS_RESERVED(msrs,i)))
continue;
CTRL_READ(low, high, msrs, i);
CTRL_CLEAR(low);
CTRL_CLEAR_LO(low);
CTRL_CLEAR_HI(high);
CTRL_WRITE(low, high, msrs, i);
}

Expand All @@ -89,12 +94,17 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs)
CTR_WRITE(counter_config[i].count, msrs, i);

CTRL_READ(low, high, msrs, i);
CTRL_CLEAR(low);
CTRL_CLEAR_LO(low);
CTRL_CLEAR_HI(high);
CTRL_SET_ENABLE(low);
CTRL_SET_USR(low, counter_config[i].user);
CTRL_SET_KERN(low, counter_config[i].kernel);
CTRL_SET_UM(low, counter_config[i].unit_mask);
CTRL_SET_EVENT(low, counter_config[i].event);
CTRL_SET_EVENT_LOW(low, counter_config[i].event);
CTRL_SET_EVENT_HIGH(high, counter_config[i].event);
CTRL_SET_HOST_ONLY(high, 0);
CTRL_SET_GUEST_ONLY(high, 0);

CTRL_WRITE(low, high, msrs, i);
} else {
reset_value[i] = 0;
Expand Down
11 changes: 4 additions & 7 deletions trunk/block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ static void as_remove_queued_request(struct request_queue *q,
}

/*
* as_fifo_expired returns 0 if there are no expired requests on the fifo,
* as_fifo_expired returns 0 if there are no expired reads on the fifo,
* 1 otherwise. It is ratelimited so that we only perform the check once per
* `fifo_expire' interval. Otherwise a large number of expired requests
* would create a hopeless seekstorm.
Expand Down Expand Up @@ -1097,8 +1097,7 @@ static int as_dispatch_request(struct request_queue *q, int force)
ad->batch_data_dir = REQ_ASYNC;
ad->current_write_count = ad->write_batch_count;
ad->write_batch_idled = 0;
rq = rq_entry_fifo(ad->fifo_list[REQ_ASYNC].next);
ad->last_check_fifo[REQ_ASYNC] = jiffies;
rq = ad->next_rq[ad->batch_data_dir];
goto dispatch_request;
}

Expand Down Expand Up @@ -1160,7 +1159,7 @@ static void as_add_request(struct request_queue *q, struct request *rq)
as_add_rq_rb(ad, rq);

/*
* set expire time and add to fifo list
* set expire time (only used for reads) and add to fifo list
*/
rq_set_fifo_time(rq, jiffies + ad->fifo_expire[data_dir]);
list_add_tail(&rq->queuelist, &ad->fifo_list[data_dir]);
Expand Down Expand Up @@ -1464,9 +1463,7 @@ static struct elevator_type iosched_as = {

static int __init as_init(void)
{
elv_register(&iosched_as);

return 0;
return elv_register(&iosched_as);
}

static void __exit as_exit(void)
Expand Down
8 changes: 6 additions & 2 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,8 @@ static struct elevator_type iosched_cfq = {

static int __init cfq_init(void)
{
int ret;

/*
* could be 0 on HZ < 1000 setups
*/
Expand All @@ -2290,9 +2292,11 @@ static int __init cfq_init(void)
if (cfq_slab_setup())
return -ENOMEM;

elv_register(&iosched_cfq);
ret = elv_register(&iosched_cfq);
if (ret)
cfq_slab_kill();

return 0;
return ret;
}

static void __exit cfq_exit(void)
Expand Down
4 changes: 1 addition & 3 deletions trunk/block/deadline-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,7 @@ static struct elevator_type iosched_deadline = {

static int __init deadline_init(void)
{
elv_register(&iosched_deadline);

return 0;
return elv_register(&iosched_deadline);
}

static void __exit deadline_exit(void)
Expand Down
3 changes: 2 additions & 1 deletion trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ void elv_unregister_queue(struct request_queue *q)
__elv_unregister_queue(q->elevator);
}

void elv_register(struct elevator_type *e)
int elv_register(struct elevator_type *e)
{
char *def = "";

Expand All @@ -975,6 +975,7 @@ void elv_register(struct elevator_type *e)
def = " (default)";

printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def);
return 0;
}
EXPORT_SYMBOL_GPL(elv_register);

Expand Down
4 changes: 1 addition & 3 deletions trunk/block/noop-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ static struct elevator_type elevator_noop = {

static int __init noop_init(void)
{
elv_register(&elevator_noop);

return 0;
return elv_register(&elevator_noop);
}

static void __exit noop_exit(void)
Expand Down
4 changes: 2 additions & 2 deletions trunk/block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
rq->cmd_len = hdr->cmd_len;
rq->cmd_type = REQ_TYPE_BLOCK_PC;

rq->timeout = msecs_to_jiffies(hdr->timeout);
rq->timeout = (hdr->timeout * HZ) / 1000;
if (!rq->timeout)
rq->timeout = q->sg_timeout;
if (!rq->timeout)
Expand Down Expand Up @@ -366,7 +366,7 @@ static int sg_io(struct file *file, struct request_queue *q,
*/
blk_execute_rq(q, bd_disk, rq, 0);

hdr->duration = jiffies_to_msecs(jiffies - start_time);
hdr->duration = ((jiffies - start_time) * 1000) / HZ;

return blk_complete_sghdr_rq(rq, hdr, bio);
out:
Expand Down
Loading

0 comments on commit 49e380e

Please sign in to comment.