[dm-devel] Limiting in-flight requests
Mauro Condarelli
ziobyte at gmail.com
Tue Jan 16 09:36:06 UTC 2018
Hi,
this is my first post here, so feel free to redirect me if I'm trespassing
in some way.
I'm trying to build a custom dm target to be used as filter for normal
filesystem operations.
I managed to build a working prototype, but field-testing it I found that,
in certain conditions (e.g.: untarring a large tar full of many small
files) the number of in-flight requests rapidly rises to several thousands.
This is a problem since I allocate some pages for each remapping (I
essentially double the allocation for the time request is fully handled by
underlying device); this leads to memory starvation and, possibly, even to
kernel panics.
I tried limiting the number/size of in-flight requests by returning
DM_MAPIO_REQUEUE when resource consumption exceeded a certain threshold;
This doesn't seem to work because the error is not trapped at dm-stage, but
it is reported directly to filesystem and, from there, to application (tar
or mkfs.ext4).
What is the correct way to tell dm to stop sending more requests, for a
short while (i.e.: till some old requests are completed)?
Note: I'm using kernel v4.4.9 so I don't have DM_MAPIO_DELAY_REQUEUE
Note2: in my target.map I re-allocate the scatterlist, save the original
one and substitute; I do the reverse in .end_io.
Thanks in advance
Mauro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20180116/a9f74abf/attachment.htm>
More information about the dm-devel
mailing list