Adding IO engine
Hi Jens,
I have a couple basic questions:
1) If I want to submit a new IO engine with fio and it has a dependency on an external library, how does that work when fio is compiled? Please also point me to info how to submit a new IO engine to be packaged with fio?
2) I've seen cases where the ->iomem_alloc() function (i.e. for a custom IO engine) is invoked first by fio before ->get_file_size() or ->setup(). This causes an issue since IO memory allocation can have dependency on certain initialization (for the custom IO engine) that is done in ->get_file_size(). I just wonder if that's an fio bug or how it should be? My current work around is to check in ->iomem_alloc() each time and do initializion first if has not.
Thanks,
Deyoung
Quoted 7 lines · Deyoung Hong (dhong)
Hi Jens,
I have a couple basic questions:
1) If I want to submit a new IO engine with fio and it has a dependency on an external library, how does that work when fio is compiled? Please also point me to info how to submit a new IO engine to be packaged with fio?
2) I've seen cases where the ->iomem_alloc() function (i.e. for a custom IO engine) is invoked first by fio before ->get_file_size() or ->setup(). This causes an issue since IO memory allocation can have dependency on certain initialization (for the custom IO engine) that is done in ->get_file_size(). I just wonder if that's an fio bug or how it should be?
It sounds more like a misconception re iomem_{alloc,free} API. It is about buffers I/O goes to/from, not files. As an example (and the root cause behind the API proposal), I wanted to be able to allocate buffers in DMAable memory as my engine required that to interact with hardware directly.
Being unrelated to files by design, buffer initialization occurs way before file setup as it did in fio before iomem_* API was introduced.
Regards,
Andrey
Quoted 9 lines
My current work around is to check in ->iomem_alloc() each time and do initializion first if has not.
Thanks,
Deyoung--
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
Quoted 5 lines
1) If I want to submit a new IO engine with fio and it has a dependency on an external library, how does that work when fio is compiled? Please also point me to info how to submit a new IO engine to be packaged with fio?
The pmemblk and dev-dax ioengines are relatively new. See
http://www.spinics.net/lists/fio/msg05370.html for some patches related to their library handling.
---
Robert Elliott, HPE Persistent Memory
Hi,
Quoted 4 lines · Deyoung Hong (dhong)
I have a couple basic questions:
1) If I want to submit a new IO engine with fio and it has a dependency on an external library, how does that work when fio is compiled? Please also point me to info how to submit a new IO engine to be packaged with fio?
Normally you check for the dependencies in ./configure and only output a symbol if the requirements for compiling a test program are all satisfied. A common trend is to add a --disable-* flag to ensure your engine is not built even if all its dependencies are available. You can then check for the symbol in a variety of places in the code and in the Makefile to decide what to build and when. When submitting a new engine it is also important to submit documentation about the engine to at least the HOWTO and include an example jobfile that demonstrates how to use the IO engine. An example of a recently merged IO engine can be found over on https://github.com/axboe/fio/pull/243 . Other IO engines that aren't that old are engines/pmemblk.c and engines/dev-dax.c ,
Quoted 1 line
2) I've seen cases where the ->iomem_alloc() function (i.e. for a custom IO engine) is invoked first by fio before ->get_file_size() or ->setup(). This causes an issue since IO memory allocation can have dependency on certain initialization (for the custom IO engine) that is done in ->get_file_size(). I just wonder if that's an fio bug or how it should be? My current work around is to check in ->iomem_alloc() each time and do initializion first if has not.
Perhaps you could do it in ->io_u_init() ?
Signature · 1 line
Sitsofe | http://sucs.org/~sits/
The concept of "file" can represent a special device and driver unknown to the system, and get_file_size() and/or setup() are usually the first APIs that fio should call where the device will be initialized and set its max size so that fio can know the device "file" capacity. Such device has to be initialized prior to IO (DMA) buffer allocation/free that is specific only to that device. There isn't any other fio plugin APIs that precede iomem_alloc, and I think iomem_alloc/free were added specifically to support that special device.
How is that a misconception?
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Andrey Kuzmin
Sent: Monday, April 10, 2017 12:44 PM
To: Deyoung Hong (dhong) <[email protected]>
Cc: [email protected]
Subject: Re: Adding IO engine
Quoted 7 lines · Deyoung Hong (dhong)
Hi Jens,
I have a couple basic questions:
1) If I want to submit a new IO engine with fio and it has a dependency on an external library, how does that work when fio is compiled? Please also point me to info how to submit a new IO engine to be packaged with fio?
2) I've seen cases where the ->iomem_alloc() function (i.e. for a custom IO engine) is invoked first by fio before ->get_file_size() or ->setup(). This causes an issue since IO memory allocation can have dependency on certain initialization (for the custom IO engine) that is done in ->get_file_size(). I just wonder if that's an fio bug or how it should be?
It sounds more like a misconception re iomem_{alloc,free} API. It is about buffers I/O goes to/from, not files. As an example (and the root cause behind the API proposal), I wanted to be able to allocate buffers in DMAable memory as my engine required that to interact with hardware directly.
Being unrelated to files by design, buffer initialization occurs way before file setup as it did in fio before iomem_* API was introduced.
Regards,
Andrey
Quoted 9 lines
My current work around is to check in ->iomem_alloc() each time and do initializion first if has not.
Thanks,
Deyoung--
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
--
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
On your response of 2)
No, ->io_u_init() is always called after ->get_file_size(), whereas ->iomem_alloc() is called before ->get_file_size() only in some peculiar cases.
I'd like Jens to explain if by design or in which case that ->iomem_alloc() is called before ->get_file_size?
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sitsofe Wheeler
Sent: Monday, April 10, 2017 1:31 PM
To: Deyoung Hong (dhong) <[email protected]>
Cc: [email protected]
Subject: Re: Adding IO engine
Hi,
Quoted 4 lines · Deyoung Hong (dhong)
I have a couple basic questions:
1) If I want to submit a new IO engine with fio and it has a dependency on an external library, how does that work when fio is compiled? Please also point me to info how to submit a new IO engine to be packaged with fio?
Normally you check for the dependencies in ./configure and only output a symbol if the requirements for compiling a test program are all satisfied. A common trend is to add a --disable-* flag to ensure your engine is not built even if all its dependencies are available. You can then check for the symbol in a variety of places in the code and in the Makefile to decide what to build and when. When submitting a new engine it is also important to submit documentation about the engine to at least the HOWTO and include an example jobfile that demonstrates how to use the IO engine. An example of a recently merged IO engine can be found over on https://github.com/axboe/fio/pull/243 . Other IO engines that aren't that old are engines/pmemblk.c and engines/dev-dax.c ,
Quoted 1 line
2) I've seen cases where the ->iomem_alloc() function (i.e. for a custom IO engine) is invoked first by fio before ->get_file_size() or ->setup(). This causes an issue since IO memory allocation can have dependency on certain initialization (for the custom IO engine) that is done in ->get_file_size(). I just wonder if that's an fio bug or how it should be? My current work around is to check in ->iomem_alloc() each time and do initializion first if has not.
Perhaps you could do it in ->io_u_init() ?
Signature · 5 lines
Sitsofe | http://sucs.org/~sits/ -- 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
Quoted 1 line · Deyoung Hong (dhong)
I would think both ->setup and ->get_file_size should be called before
get_file_size is not being called if the engine provides setup() method. If it doesn't, fio calls get_file_size too early, to my recollection even before the engine has been properly initialized, and that's why setup() workaround exists.
Quoted 2 lines
->iomem_alloc, but I have an fio job file (case problem reported by the user) where ->iomem_alloc is called before ->setup.
if you see this happening (although, from my year-old recollection, that's not the case with setup()), just submit a bug report showing your job file and call sequence.
Regards,
Andrey
Quoted 111 lines
My main question is
that an fio bug (minor)? If someone would like to fix it, I can send a test job file.Thanks,
Deyoung
From: Andrey Kuzmin [mailto:[email protected]]
Sent: Monday, April 10, 2017 2:40 PM
To: Deyoung Hong (dhong) <[email protected]>
Cc: [email protected]
Subject: RE: Adding IO engineOn Apr 11, 2017 00:21, "Deyoung Hong (dhong)" <[email protected]> wrote:
The concept of "file" can represent a special device and driver unknown to the system, and
get_file_size()and/orsetup()are usually the first APIs that fio should call where the device will be initialized and set its max size so that fio can know the device "file" capacity. Such device has to be initialized prior to IO (DMA) buffer allocation/free that is specific only
to that device. There isn't any other fio plugin APIs that precedeiomem_alloc, and I think iomem_alloc/free were added specifically to support that special device.No, the API was added to support I/O engines with special requirements re I/O buffer memory, with no relation to special files. If you have specific file setup requirements, your engine should provide setup method. As far as I recall, it occurs before iomem initialization.
Regards,
Andrey
How is that a misconception?
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Andrey Kuzmin
Sent: Monday, April 10, 2017 12:44 PM
To: Deyoung Hong (dhong) <[email protected]>
Cc: [email protected]
Subject: Re: Adding IO engineQuoted 8 lines · Deyoung Hong (dhong)
Hi Jens,
I have a couple basic questions:
1) If I want to submit a new IO engine with fio and it has a dependency on an external library, how does that work when fio is compiled? Please also point me to info how to submit a new IO engine to be packaged with fio?
Quoted 5 lines
2) I've seen cases where the ->iomem_alloc() function (i.e. for a custom IO engine) is invoked first by fio before ->get_file_size() or ->setup(). This causes an issue since IO memory allocation can have dependency on certain initialization (for the custom IO engine) that is done in
->get_file_size(). I just wonder if that's an fio bug or how it should be?It sounds more like a misconception re iomem_{alloc,free} API. It is about buffers I/O goes to/from, not files. As an example (and the root cause behind the API proposal), I wanted to be able to allocate buffers in DMAable memory as my engine required that to interact with hardware directly.
Being unrelated to files by design, buffer initialization occurs way before file setup as it did in fio before iomem_* API was introduced.
Regards,
AndreyQuoted 10 lines
My current work around is to check in ->iomem_alloc() each time and do
initializion first if has not.Thanks,
Deyoung--
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--
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