On Tue, Jun 07, 2022 at 12:34:50PM +0200, Jan Kara wrote: > On Tue 07-06-22 04:11:06, Al Viro wrote: > > New helper to be used instead of direct checks for IOCB_DSYNC: > > iocb_is_dsync(iocb). Checks converted, which allows to avoid > > the IS_SYNC(iocb->ki_filp->f_mapping->host) part (4 cache lines) > > from iocb_flags() - it's checked in iocb_is_dsync() instead > > > > Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> > > Does it really matter that much when we have io_is_direct() just two lines > above which does: IS_DAX(filp->f_mapping->host)? > > Also presumably even if we got rid of the IS_DAX check, we'll need to do > file->f_mapping->host traversal sooner rather than later anyway so it is > not clear to me how much it helps performance to defer this traversal to a > bit later. ... which would be out of the part of codepath that is shared with e.g. reads and writes on pipes. > Finally it seems a bit error prone to be checking some IOCB_ flags directly > while IOCB_DSYNC needs to be checked with iocb_is_dsync() instead. I think > we'll grow some place mistakenly checking IOCB_DSYNC sooner rather than > later. So maybe at least rename IOCB_DSYNC to __IOCB_DSYNC to make it more > obvious in the name that something unusual is going on? That might make sense...