Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f74cd637
Commit
f74cd637
authored
Nov 24, 2014
by
Jens Axboe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-3.19/core' into for-3.19/drivers
parents
c78b4713
394ffa50
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
23 deletions
+52
-23
block/bio.c
block/bio.c
+28
-0
block/blk-mq.c
block/blk-mq.c
+10
-21
block/genhd.c
block/genhd.c
+9
-2
include/linux/bio.h
include/linux/bio.h
+5
-0
No files found.
block/bio.c
View file @
f74cd637
...
@@ -1739,6 +1739,34 @@ void bio_check_pages_dirty(struct bio *bio)
...
@@ -1739,6 +1739,34 @@ void bio_check_pages_dirty(struct bio *bio)
}
}
}
}
void
generic_start_io_acct
(
int
rw
,
unsigned
long
sectors
,
struct
hd_struct
*
part
)
{
int
cpu
=
part_stat_lock
();
part_round_stats
(
cpu
,
part
);
part_stat_inc
(
cpu
,
part
,
ios
[
rw
]);
part_stat_add
(
cpu
,
part
,
sectors
[
rw
],
sectors
);
part_inc_in_flight
(
part
,
rw
);
part_stat_unlock
();
}
EXPORT_SYMBOL
(
generic_start_io_acct
);
void
generic_end_io_acct
(
int
rw
,
struct
hd_struct
*
part
,
unsigned
long
start_time
)
{
unsigned
long
duration
=
jiffies
-
start_time
;
int
cpu
=
part_stat_lock
();
part_stat_add
(
cpu
,
part
,
ticks
[
rw
],
duration
);
part_round_stats
(
cpu
,
part
);
part_dec_in_flight
(
part
,
rw
);
part_stat_unlock
();
}
EXPORT_SYMBOL
(
generic_end_io_acct
);
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
void
bio_flush_dcache_pages
(
struct
bio
*
bi
)
void
bio_flush_dcache_pages
(
struct
bio
*
bi
)
{
{
...
...
block/blk-mq.c
View file @
f74cd637
...
@@ -798,10 +798,11 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
...
@@ -798,10 +798,11 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
*/
*/
static
int
blk_mq_hctx_next_cpu
(
struct
blk_mq_hw_ctx
*
hctx
)
static
int
blk_mq_hctx_next_cpu
(
struct
blk_mq_hw_ctx
*
hctx
)
{
{
int
cpu
=
hctx
->
next_cpu
;
if
(
hctx
->
queue
->
nr_hw_queues
==
1
)
return
WORK_CPU_UNBOUND
;
if
(
--
hctx
->
next_cpu_batch
<=
0
)
{
if
(
--
hctx
->
next_cpu_batch
<=
0
)
{
int
next_cpu
;
int
cpu
=
hctx
->
next_cpu
,
next_cpu
;
next_cpu
=
cpumask_next
(
hctx
->
next_cpu
,
hctx
->
cpumask
);
next_cpu
=
cpumask_next
(
hctx
->
next_cpu
,
hctx
->
cpumask
);
if
(
next_cpu
>=
nr_cpu_ids
)
if
(
next_cpu
>=
nr_cpu_ids
)
...
@@ -809,9 +810,11 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
...
@@ -809,9 +810,11 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
hctx
->
next_cpu
=
next_cpu
;
hctx
->
next_cpu
=
next_cpu
;
hctx
->
next_cpu_batch
=
BLK_MQ_CPU_WORK_BATCH
;
hctx
->
next_cpu_batch
=
BLK_MQ_CPU_WORK_BATCH
;
return
cpu
;
}
}
return
cpu
;
return
hctx
->
next_
cpu
;
}
}
void
blk_mq_run_hw_queue
(
struct
blk_mq_hw_ctx
*
hctx
,
bool
async
)
void
blk_mq_run_hw_queue
(
struct
blk_mq_hw_ctx
*
hctx
,
bool
async
)
...
@@ -830,14 +833,8 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
...
@@ -830,14 +833,8 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
put_cpu
();
put_cpu
();
}
}
if
(
hctx
->
queue
->
nr_hw_queues
==
1
)
kblockd_schedule_delayed_work_on
(
blk_mq_hctx_next_cpu
(
hctx
),
kblockd_schedule_delayed_work
(
&
hctx
->
run_work
,
0
);
&
hctx
->
run_work
,
0
);
else
{
unsigned
int
cpu
;
cpu
=
blk_mq_hctx_next_cpu
(
hctx
);
kblockd_schedule_delayed_work_on
(
cpu
,
&
hctx
->
run_work
,
0
);
}
}
}
void
blk_mq_run_queues
(
struct
request_queue
*
q
,
bool
async
)
void
blk_mq_run_queues
(
struct
request_queue
*
q
,
bool
async
)
...
@@ -929,16 +926,8 @@ static void blk_mq_delay_work_fn(struct work_struct *work)
...
@@ -929,16 +926,8 @@ static void blk_mq_delay_work_fn(struct work_struct *work)
void
blk_mq_delay_queue
(
struct
blk_mq_hw_ctx
*
hctx
,
unsigned
long
msecs
)
void
blk_mq_delay_queue
(
struct
blk_mq_hw_ctx
*
hctx
,
unsigned
long
msecs
)
{
{
unsigned
long
tmo
=
msecs_to_jiffies
(
msecs
);
kblockd_schedule_delayed_work_on
(
blk_mq_hctx_next_cpu
(
hctx
),
&
hctx
->
delay_work
,
msecs_to_jiffies
(
msecs
));
if
(
hctx
->
queue
->
nr_hw_queues
==
1
)
kblockd_schedule_delayed_work
(
&
hctx
->
delay_work
,
tmo
);
else
{
unsigned
int
cpu
;
cpu
=
blk_mq_hctx_next_cpu
(
hctx
);
kblockd_schedule_delayed_work_on
(
cpu
,
&
hctx
->
delay_work
,
tmo
);
}
}
}
EXPORT_SYMBOL
(
blk_mq_delay_queue
);
EXPORT_SYMBOL
(
blk_mq_delay_queue
);
...
...
block/genhd.c
View file @
f74cd637
...
@@ -1070,9 +1070,16 @@ int disk_expand_part_tbl(struct gendisk *disk, int partno)
...
@@ -1070,9 +1070,16 @@ int disk_expand_part_tbl(struct gendisk *disk, int partno)
struct
disk_part_tbl
*
old_ptbl
=
disk
->
part_tbl
;
struct
disk_part_tbl
*
old_ptbl
=
disk
->
part_tbl
;
struct
disk_part_tbl
*
new_ptbl
;
struct
disk_part_tbl
*
new_ptbl
;
int
len
=
old_ptbl
?
old_ptbl
->
len
:
0
;
int
len
=
old_ptbl
?
old_ptbl
->
len
:
0
;
int
target
=
partno
+
1
;
int
i
,
target
;
size_t
size
;
size_t
size
;
int
i
;
/*
* check for int overflow, since we can get here from blkpg_ioctl()
* with a user passed 'partno'.
*/
target
=
partno
+
1
;
if
(
target
<
0
)
return
-
EINVAL
;
/* disk_max_parts() is zero during initialization, ignore if so */
/* disk_max_parts() is zero during initialization, ignore if so */
if
(
disk_max_parts
(
disk
)
&&
target
>
disk_max_parts
(
disk
))
if
(
disk_max_parts
(
disk
)
&&
target
>
disk_max_parts
(
disk
))
...
...
include/linux/bio.h
View file @
f74cd637
...
@@ -443,6 +443,11 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
...
@@ -443,6 +443,11 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
extern
void
bio_set_pages_dirty
(
struct
bio
*
bio
);
extern
void
bio_set_pages_dirty
(
struct
bio
*
bio
);
extern
void
bio_check_pages_dirty
(
struct
bio
*
bio
);
extern
void
bio_check_pages_dirty
(
struct
bio
*
bio
);
void
generic_start_io_acct
(
int
rw
,
unsigned
long
sectors
,
struct
hd_struct
*
part
);
void
generic_end_io_acct
(
int
rw
,
struct
hd_struct
*
part
,
unsigned
long
start_time
);
#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment