Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20091
b: refs/heads/master
c: 01840f9
h: refs/heads/master
i:
  20089: 2e5122f
  20087: 19194d2
v: v3
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Feb 8, 2006
1 parent 6fbd674 commit 2b723ec
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 48 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: 328c2a8a39e1ba43a6e54e43fc752f7035779561
refs/heads/master: 01840f9c9d7ae366311302077ace6bc39169399b
25 changes: 21 additions & 4 deletions trunk/arch/alpha/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ cpumask_t cpu_online_map;

EXPORT_SYMBOL(cpu_online_map);

/* cpus reported in the hwrpb */
static unsigned long hwrpb_cpu_present_mask __initdata = 0;

int smp_num_probed; /* Internal processor count */
int smp_num_cpus = 1; /* Number that came online. */

Expand Down Expand Up @@ -439,7 +442,7 @@ setup_smp(void)
if ((cpu->flags & 0x1cc) == 0x1cc) {
smp_num_probed++;
/* Assume here that "whami" == index */
cpu_set(i, cpu_possible_map);
hwrpb_cpu_present_mask |= (1UL << i);
cpu->pal_revision = boot_cpu_palrev;
}

Expand All @@ -450,12 +453,12 @@ setup_smp(void)
}
} else {
smp_num_probed = 1;
cpu_set(boot_cpuid, cpu_possible_map);
hwrpb_cpu_present_mask = (1UL << boot_cpuid);
}
cpu_present_mask = cpumask_of_cpu(boot_cpuid);

printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n",
smp_num_probed, cpu_possible_map.bits[0]);
smp_num_probed, hwrpb_cpu_present_mask);
}

/*
Expand All @@ -464,6 +467,8 @@ setup_smp(void)
void __init
smp_prepare_cpus(unsigned int max_cpus)
{
int cpu_count, i;

/* Take care of some initial bookkeeping. */
memset(ipi_data, 0, sizeof(ipi_data));

Expand All @@ -481,7 +486,19 @@ smp_prepare_cpus(unsigned int max_cpus)

printk(KERN_INFO "SMP starting up secondaries.\n");

smp_num_cpus = smp_num_probed;
cpu_count = 1;
for (i = 0; (i < NR_CPUS) && (cpu_count < max_cpus); i++) {
if (i == boot_cpuid)
continue;

if (((hwrpb_cpu_present_mask >> i) & 1) == 0)
continue;

cpu_set(i, cpu_possible_map);
cpu_count++;
}

smp_num_cpus = cpu_count;
}

void __devinit
Expand Down
70 changes: 32 additions & 38 deletions trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ void elv_requeue_request(request_queue_t *q, struct request *rq)

rq->flags &= ~REQ_STARTED;

elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE);
__elv_add_request(q, rq, ELEVATOR_INSERT_REQUEUE, 0);
}

static void elv_drain_elevator(request_queue_t *q)
Expand All @@ -310,11 +310,41 @@ static void elv_drain_elevator(request_queue_t *q)
}
}

void elv_insert(request_queue_t *q, struct request *rq, int where)
void __elv_add_request(request_queue_t *q, struct request *rq, int where,
int plug)
{
struct list_head *pos;
unsigned ordseq;

if (q->ordcolor)
rq->flags |= REQ_ORDERED_COLOR;

if (rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) {
/*
* toggle ordered color
*/
if (blk_barrier_rq(rq))
q->ordcolor ^= 1;

/*
* barriers implicitly indicate back insertion
*/
if (where == ELEVATOR_INSERT_SORT)
where = ELEVATOR_INSERT_BACK;

/*
* this request is scheduling boundary, update end_sector
*/
if (blk_fs_request(rq)) {
q->end_sector = rq_end_sector(rq);
q->boundary_rq = rq;
}
} else if (!(rq->flags & REQ_ELVPRIV) && where == ELEVATOR_INSERT_SORT)
where = ELEVATOR_INSERT_BACK;

if (plug)
blk_plug_device(q);

rq->q = q;

switch (where) {
Expand Down Expand Up @@ -395,42 +425,6 @@ void elv_insert(request_queue_t *q, struct request *rq, int where)
}
}

void __elv_add_request(request_queue_t *q, struct request *rq, int where,
int plug)
{
if (q->ordcolor)
rq->flags |= REQ_ORDERED_COLOR;

if (rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) {
/*
* toggle ordered color
*/
if (blk_barrier_rq(rq))
q->ordcolor ^= 1;

/*
* barriers implicitly indicate back insertion
*/
if (where == ELEVATOR_INSERT_SORT)
where = ELEVATOR_INSERT_BACK;

/*
* this request is scheduling boundary, update
* end_sector
*/
if (blk_fs_request(rq)) {
q->end_sector = rq_end_sector(rq);
q->boundary_rq = rq;
}
} else if (!(rq->flags & REQ_ELVPRIV) && where == ELEVATOR_INSERT_SORT)
where = ELEVATOR_INSERT_BACK;

if (plug)
blk_plug_device(q);

elv_insert(q, rq, where);
}

void elv_add_request(request_queue_t *q, struct request *rq, int where,
int plug)
{
Expand Down
4 changes: 2 additions & 2 deletions trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static void queue_flush(request_queue_t *q, unsigned which)
rq->end_io = end_io;
q->prepare_flush_fn(q, rq);

elv_insert(q, rq, ELEVATOR_INSERT_FRONT);
__elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0);
}

static inline struct request *start_ordered(request_queue_t *q,
Expand Down Expand Up @@ -490,7 +490,7 @@ static inline struct request *start_ordered(request_queue_t *q,
else
q->ordseq |= QUEUE_ORDSEQ_POSTFLUSH;

elv_insert(q, rq, ELEVATOR_INSERT_FRONT);
__elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0);

if (q->ordered & QUEUE_ORDERED_PREFLUSH) {
queue_flush(q, QUEUE_ORDERED_PREFLUSH);
Expand Down
3 changes: 3 additions & 0 deletions trunk/block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ static int sg_io(struct file *file, request_queue_t *q,
if (!rq->timeout)
rq->timeout = BLK_DEFAULT_TIMEOUT;

rq->retries = 0;

start_time = jiffies;

/* ignore return value. All information is passed back to caller
Expand Down Expand Up @@ -427,6 +429,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
rq->data = buffer;
rq->data_len = bytes;
rq->flags |= REQ_BLOCK_PC;
rq->retries = 0;

blk_execute_rq(q, bd_disk, rq, 0);
err = rq->errors & 0xff; /* only 8 bit SCSI status */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/macintosh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ config WINDFARM_PM91
config WINDFARM_PM112
tristate "Support for thermal management on PowerMac11,2"
depends on WINDFARM && I2C && PMAC_SMU
select I2C_POWERMAC
select I2C_PMAC_SMU
help
This driver provides thermal control for the PowerMac11,2
which are the recent dual and quad G5 machines using the
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/elevator.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ struct elevator_queue
extern void elv_dispatch_sort(request_queue_t *, struct request *);
extern void elv_add_request(request_queue_t *, struct request *, int, int);
extern void __elv_add_request(request_queue_t *, struct request *, int, int);
extern void elv_insert(request_queue_t *, struct request *, int);
extern int elv_merge(request_queue_t *, struct request **, struct bio *);
extern void elv_merge_requests(request_queue_t *, struct request *,
struct request *);
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/slob.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ EXPORT_SYMBOL(slab_reclaim_pages);

#ifdef CONFIG_SMP

void *__alloc_percpu(size_t size)
void *__alloc_percpu(size_t size, size_t align)
{
int i;
struct percpu_data *pdata = kmalloc(sizeof (*pdata), GFP_KERNEL);
Expand Down

0 comments on commit 2b723ec

Please sign in to comment.