* generic_make_request not locked
@ 2013-04-30 5:39 remaper
2013-04-30 6:08 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: remaper @ 2013-04-30 5:39 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel
/*
* We only want one ->make_request_fn to be active at a time,
* else stack usage with stacked devices could be a problem.
* So use current->bio_list to keep a list of requests
* submited by a make_request_fn function.
* current->bio_list is also used as a flag to say if
* generic_make_request is currently active in this task or not.
* If it is NULL, then no make_request is active. If it is non-NULL,
* then a make_request is active, and new requests should be added
* at the tail
*/
void generic_make_request(struct bio *bio)
{
...
if (current->bio_list) {
/* make_request is active */
bio_list_add(current->bio_list, bio);
return;
}
...
}
current->bio_list is a global variable, and generic_make_request would run on multithread environment, so, i don't understand why here( bio_list_add ) not lock?
thx everybody.ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: generic_make_request not locked
2013-04-30 5:39 generic_make_request not locked remaper
@ 2013-04-30 6:08 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2013-04-30 6:08 UTC (permalink / raw)
To: remaper; +Cc: linux-fsdevel, linux-kernel
On Tue, Apr 30 2013, remaper wrote:
> /*
> * We only want one ->make_request_fn to be active at a time,
> * else stack usage with stacked devices could be a problem.
> * So use current->bio_list to keep a list of requests
> * submited by a make_request_fn function.
> * current->bio_list is also used as a flag to say if
> * generic_make_request is currently active in this task or not.
> * If it is NULL, then no make_request is active. If it is non-NULL,
> * then a make_request is active, and new requests should be added
> * at the tail
> */
> void generic_make_request(struct bio *bio)
> {
> ...
> if (current->bio_list) {
> /* make_request is active */
> bio_list_add(current->bio_list, bio);
> return;
> }
> ...
> }
>
> current->bio_list is a global variable, and generic_make_request would
> run on multithread environment, so, i don't understand why here(
> bio_list_add ) not lock? thx everybody.
'current' refers to the task currently executing task. So
current->bio_list isn't shared, hence there's no need for any locking.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-30 6:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-30 5:39 generic_make_request not locked remaper
2013-04-30 6:08 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox