<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I'm using 5.4.109. I'll re-submit with changes to the second patch shortly,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
thanks</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Simon</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Michal Prívozník <mprivozn@redhat.com><br>
<b>Sent:</b> 23 August 2021 16:04<br>
<b>To:</b> Simon Rowe <simon.rowe@nutanix.com>; libvir-list@redhat.com <libvir-list@redhat.com><br>
<b>Subject:</b> Re: [PATCH 1/2] iohelper: skip lseek() and ftruncate() on block devices</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 8/23/21 4:38 PM, Simon Rowe wrote:<br>
> O_DIRECT is under control of the caller (though the --bypass-cache option). I am running in a constrained memory environment and when I don't use O_DIRECT the dump stalls at 5% load av hits 41 and the system becomes unresponsive.<br>
<br>
Fair enough. I thought that block devices are always opened without<br>
poisoning host cache. If they aren't then you patch makes sense.<br>
But, what is your kernel version? Hopefully it's not too old. Is it a<br>
special block device or just some regular disk?<br>
<br>
Looking into the kernel code, it does implement O_DIRECT for block<br>
devices:<br>
<br>
kernel.git $ git grep -npC10 "\.direct_IO" -- fs/block_dev.c<br>
fs/block_dev.c-1680-}<br>
fs/block_dev.c-1681-<br>
fs/block_dev.c=1682=static const struct address_space_operations def_blk_aops = {<br>
fs/block_dev.c-1683-    .set_page_dirty = __set_page_dirty_buffers,<br>
fs/block_dev.c-1684-    .readpage       = blkdev_readpage,<br>
fs/block_dev.c-1685-    .readahead      = blkdev_readahead,<br>
fs/block_dev.c-1686-    .writepage      = blkdev_writepage,<br>
fs/block_dev.c-1687-    .write_begin    = blkdev_write_begin,<br>
fs/block_dev.c-1688-    .write_end      = blkdev_write_end,<br>
fs/block_dev.c-1689-    .writepages     = blkdev_writepages,<br>
fs/block_dev.c:1690:    .direct_IO      = blkdev_direct_IO,<br>
fs/block_dev.c-1691-    .migratepage    = buffer_migrate_page_norefs,<br>
fs/block_dev.c-1692-    .is_dirty_writeback = buffer_check_dirty_writeback,<br>
fs/block_dev.c-1693-};<br>
fs/block_dev.c-1694-<br>
fs/block_dev.c-1695-#define     BLKDEV_FALLOC_FL_SUPPORTED                                      \<br>
fs/block_dev.c-1696-            (FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |           \<br>
fs/block_dev.c-1697-             FALLOC_FL_ZERO_RANGE | FALLOC_FL_NO_HIDE_STALE)<br>
fs/block_dev.c-1698-<br>
fs/block_dev.c-1699-static long blkdev_fallocate(struct file *file, int mode, loff_t start,<br>
fs/block_dev.c-1700-                         loff_t len)<br>
<br>
So it seems like your patch was correct after all. Would you like to<br>
resend this in v2 (I understand that patch 2/2 needs a rework) or do you<br>
want me to push this one right away?<br>
<br>
Michal<br>
<br>
</div>
</span></font></div>
</body>
</html>