Flexible I/O Tester development
 help / color / mirror / Atom feed
* question about fork_main()
@ 2009-04-09 18:49 Francis Moreau
  2009-04-20  1:16 ` Carl Henrik Lunde
  0 siblings, 1 reply; 6+ messages in thread
From: Francis Moreau @ 2009-04-09 18:49 UTC (permalink / raw)
  To: fio

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.
-- 
Francis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question about fork_main()
  2009-04-09 18:49 question about fork_main() Francis Moreau
@ 2009-04-20  1:16 ` Carl Henrik Lunde
  2009-04-20  6:45   ` Jens Axboe
  2009-04-21 18:37   ` Francis Moreau
  0 siblings, 2 replies; 6+ messages in thread
From: Carl Henrik Lunde @ 2009-04-20  1:16 UTC (permalink / raw)
  To: Francis Moreau; +Cc: fio

On Thu, Apr 9, 2009 at 20:49, Francis Moreau <francis.moro@gmail.com> wrote:
> 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 ?

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

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


-- 
mvh
Carl Henrik

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question about fork_main()
  2009-04-20  1:16 ` Carl Henrik Lunde
@ 2009-04-20  6:45   ` Jens Axboe
  2009-04-21 18:37   ` Francis Moreau
  1 sibling, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2009-04-20  6:45 UTC (permalink / raw)
  To: Carl Henrik Lunde; +Cc: Francis Moreau, fio

On Mon, Apr 20 2009, Carl Henrik Lunde wrote:
> On Thu, Apr 9, 2009 at 20:49, Francis Moreau <francis.moro@gmail.com> wrote:
> > 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 ?
> 
> 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...

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question about fork_main()
  2009-04-20  1:16 ` Carl Henrik Lunde
  2009-04-20  6:45   ` Jens Axboe
@ 2009-04-21 18:37   ` Francis Moreau
  2009-04-21 19:01     ` Jens Axboe
  1 sibling, 1 reply; 6+ messages in thread
From: Francis Moreau @ 2009-04-21 18:37 UTC (permalink / raw)
  To: Carl Henrik Lunde; +Cc: fio

On Mon, Apr 20, 2009 at 3:16 AM, Carl Henrik Lunde <chlunde@ping.uio.no> wrote:
> On Thu, Apr 9, 2009 at 20:49, Francis Moreau <francis.moro@gmail.com> wrote:
>> 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 ?
>
> I think your observation is correct, this is not necessary, shmat in
> the child can be avoided.
>

Should I send a patch ?

thanks
-- 
Francis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question about fork_main()
  2009-04-21 18:37   ` Francis Moreau
@ 2009-04-21 19:01     ` Jens Axboe
  2009-04-21 19:13       ` Francis Moreau
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2009-04-21 19:01 UTC (permalink / raw)
  To: Francis Moreau; +Cc: Carl Henrik Lunde, fio

On Tue, Apr 21 2009, Francis Moreau wrote:
> On Mon, Apr 20, 2009 at 3:16 AM, Carl Henrik Lunde <chlunde@ping.uio.no> wrote:
> > On Thu, Apr 9, 2009 at 20:49, Francis Moreau <francis.moro@gmail.com> wrote:
> >> 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 ?
> >
> > 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 ;-)

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: question about fork_main()
  2009-04-21 19:01     ` Jens Axboe
@ 2009-04-21 19:13       ` Francis Moreau
  0 siblings, 0 replies; 6+ messages in thread
From: Francis Moreau @ 2009-04-21 19:13 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Carl Henrik Lunde, fio

Hello Jens

On Tue, Apr 21, 2009 at 9:01 PM, Jens Axboe <jens.axboe@oracle.com> wrote:
> On Tue, Apr 21 2009, Francis Moreau wrote:
>> On Mon, Apr 20, 2009 at 3:16 AM, Carl Henrik Lunde <chlunde@ping.uio.no> wrote:
>> > 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
-- 
Francis

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-21 19:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-09 18:49 question about fork_main() Francis Moreau
2009-04-20  1:16 ` Carl Henrik Lunde
2009-04-20  6:45   ` Jens Axboe
2009-04-21 18:37   ` Francis Moreau
2009-04-21 19:01     ` Jens Axboe
2009-04-21 19:13       ` Francis Moreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox