On 12/7/21 9:49 PM, Jason Wang wrote: > On Tue, Dec 7, 2021 at 10:45 AM Mike Christie > <michael.christie@xxxxxxxxxx> wrote: >> >> vhost_poll_flush() is a simple wrapper around vhost_work_dev_flush(). >> It gives wrong impression that we are doing some work over vhost_poll, >> while in fact it flushes vhost_poll->dev. > > This "problem" is a byproduct of 7235acdb1144 ("vhost: simplify work flushing"). > > Before that we indeed have per poll flush flush. > >> It only complicate understanding of the code and leads to mistakes >> like flushing the same vhost_dev several times in a row. >> >> Just remove vhost_poll_flush() and call vhost_work_dev_flush() directly. > > Not a native speaker but since we don't have an per work flush, is it > better to rename this simply as vhost_flush()? > What about vhost_dev_flush? For the existing naming when we have a function exported we tend to have "vhost_" then the object/struct it works on then the action. For work we have: vhost_work_queue/init (we also have vhost_has_work which doesn't follow that pattern but would sound strange as vhost_work_has so ignore that one). For dev operations we have: vhost_dev_reset_owner/set_owner/has_owner/cleanup/init For the flush operation I wanted it to reflect it flushed all work on the device, so I mashed up the work and dev naming above and I agree it's a little strange. _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization