Skip to contentSkip to conversation

question about fork_main()

DISCUSSION Francis Moreau 3 participants 6 messages Apr 9, 2009 – Apr 21, 2009

lore
Share & tools
lore
#0 lore raw

hello,

I just took a look to fio source code (great tool BTW), and I'm wondering about the fork_main() comment:

/*
* We cannot pass the td data into a forked process, so attach the td
* and pass it to the thread worker.
*/

Since after a fork(2) the child inherits the attached shared memory segments from its parent, I don't see the point of this comment.

Could anybody enlight me ?

thanks.

Signature · 1 line
Francis
#1 lore raw
Quoted 10 lines · Francis Moreau

hello,

I just took a look to fio source code (great tool BTW), and I'm wondering about the fork_main() comment:

/*
�* We cannot pass the td data into a forked process, so attach the td �* and pass it to the thread worker.
�*/

Quoted 4 lines

Since after a fork(2) the child inherits the attached shared memory segments from its parent, I don't see the point of this comment.

Could anybody enlight me ?

I think your observation is correct, this is not necessary, shmat in the child can be avoided.

Quoted 9 lines

thanks.
--
Francis
--
To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to [email protected]
More majordomo info at �http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
mvh
Carl Henrik
#2 lore raw
Quoted 11 lines · Carl Henrik Lunde
Quoted 10 lines · Francis Moreau

hello,

I just took a look to fio source code (great tool BTW), and I'm wondering about the fork_main() comment:

/*
�* We cannot pass the td data into a forked process, so attach the td �* and pass it to the thread worker.
�*/

Quoted 7 lines
Quoted 4 lines

Since after a fork(2) the child inherits the attached shared memory segments from its parent, I don't see the point of this comment.

Could anybody enlight me ?

I think your observation is correct, this is not necessary, shmat in the child can be avoided.

Yes, I'm not quite sure why it does that anymore, it's been that way since 2004/5 when fio got moved to its own repo...

Signature · 1 line
Jens Axboe
#3 lore raw
In reply to Carl Henrik Lunde
Quoted 11 lines · Carl Henrik Lunde
Quoted 10 lines · Francis Moreau

hello,

I just took a look to fio source code (great tool BTW), and I'm wondering about the fork_main() comment:

/*
�* We cannot pass the td data into a forked process, so attach the td �* and pass it to the thread worker.
�*/

Quoted 8 lines
Quoted 4 lines

Since after a fork(2) the child inherits the attached shared memory segments from its parent, I don't see the point of this comment.

Could anybody enlight me ?

I think your observation is correct, this is not necessary, shmat in the child can be avoided.

Should I send a patch ?

thanks

Signature · 1 line
Francis
#4 lore raw
Quoted 15 lines · Francis Moreau
Quoted 14 lines · Carl Henrik Lunde
Quoted 13 lines · Francis Moreau

hello,

I just took a look to fio source code (great tool BTW), and I'm wondering about the fork_main() comment:

/*
�* We cannot pass the td data into a forked process, so attach the td �* and pass it to the thread worker.
�*/

Since after a fork(2) the child inherits the attached shared memory segments from its parent, I don't see the point of this comment.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Could anybody enlight me ?

I think your observation is correct, this is not necessary, shmat in the child can be avoided.

Should I send a patch ?

Sure, provided you do testing of it as well ;-)

Signature · 1 line
Jens Axboe
#5 lore raw

Hello Jens

Quoted 9 lines · Jens Axboe
Quoted 5 lines · Francis Moreau
Quoted 2 lines · Carl Henrik Lunde

I think your observation is correct, this is not necessary, shmat in the child can be avoided.

Should I send a patch ?

Sure, provided you do testing of it as well ;-)

OK, I'll do that (probably at the end of the week).

thanks

Signature · 1 line
Francis