All of lore.kernel.org
 help / color / mirror / Atom feed
* Fwd: does xfs support aio_fsync?
       [not found] <CAB-bdyRWCJLDde4izM_H-Bh9wPg-Enas+D4VvTROWEpVy0ZgZg@mail.gmail.com>
@ 2022-10-28 22:11 ` Neutron Sharc
  2022-10-28 22:58   ` Darrick J. Wong
  2022-10-29 21:01   ` Dave Chinner
  0 siblings, 2 replies; 4+ messages in thread
From: Neutron Sharc @ 2022-10-28 22:11 UTC (permalink / raw)
  To: linux-xfs

Hello all,
I have a workload that benefits the most if I can issue async fsync
after many async writes are completed. I was under the impression that
xfs/ext4 both support async fsync so I can use libaio to submit fsync.
When I tested with io_submit(fsync),  it always returned EINVAL.  So I
browsed the linux source (both kernel 3.10,  4.14)  and I found
xfs/xfs_file.c doesn't implement "aio_fsync", nor does ext4/file.c.

I found an old post which said aio_fsync was already included in xfs
(https://www.spinics.net/lists/xfs/msg28408.html)

What xfs or kernel version should I use to get aio_fsync working?  Thanks all.


Shawn

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fwd: does xfs support aio_fsync?
  2022-10-28 22:11 ` Fwd: does xfs support aio_fsync? Neutron Sharc
@ 2022-10-28 22:58   ` Darrick J. Wong
  2022-10-29 21:01   ` Dave Chinner
  1 sibling, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2022-10-28 22:58 UTC (permalink / raw)
  To: Neutron Sharc; +Cc: linux-xfs

On Fri, Oct 28, 2022 at 03:11:15PM -0700, Neutron Sharc wrote:
> Hello all,
> I have a workload that benefits the most if I can issue async fsync
> after many async writes are completed. I was under the impression that
> xfs/ext4 both support async fsync so I can use libaio to submit fsync.
> When I tested with io_submit(fsync),  it always returned EINVAL.  So I
> browsed the linux source (both kernel 3.10,  4.14)  and I found
> xfs/xfs_file.c doesn't implement "aio_fsync", nor does ext4/file.c.
> 
> I found an old post which said aio_fsync was already included in xfs
> (https://www.spinics.net/lists/xfs/msg28408.html)
> 
> What xfs or kernel version should I use to get aio_fsync working?  Thanks all.

$ git blame -L 1606,+2 fs/aio.c
a3c0d439e4d92 (Christoph Hellwig 2018-03-27 19:18:57 +0200 1606) static void aio_fsync_work(struct work_struct *work)
a3c0d439e4d92 (Christoph Hellwig 2018-03-27 19:18:57 +0200 1607) {

...some time around the 4.19 LTS?

--D

> 
> 
> Shawn

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fwd: does xfs support aio_fsync?
  2022-10-28 22:11 ` Fwd: does xfs support aio_fsync? Neutron Sharc
  2022-10-28 22:58   ` Darrick J. Wong
@ 2022-10-29 21:01   ` Dave Chinner
  2022-10-30 16:44     ` Shawn
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2022-10-29 21:01 UTC (permalink / raw)
  To: Neutron Sharc; +Cc: linux-xfs

On Fri, Oct 28, 2022 at 03:11:15PM -0700, Neutron Sharc wrote:
> Hello all,
> I have a workload that benefits the most if I can issue async fsync
> after many async writes are completed. I was under the impression that
> xfs/ext4 both support async fsync so I can use libaio to submit fsync.
> When I tested with io_submit(fsync),  it always returned EINVAL.  So I
> browsed the linux source (both kernel 3.10,  4.14)  and I found
> xfs/xfs_file.c doesn't implement "aio_fsync", nor does ext4/file.c.

Generic support for IOCB_CMD_FSYNC and IOCB_CMD_FDSYNC was added
into 4.17. As a result it should be supported by almost all
filesystems, not just XFS....

> I found an old post which said aio_fsync was already included in xfs
> (https://www.spinics.net/lists/xfs/msg28408.html)

Yeah, the code that went into fs/aio.c was pretty much a generic
version of this.

> What xfs or kernel version should I use to get aio_fsync working?  Thanks all.

Just a kernel that isn't ancient. If you are looking for features,
always check latest code first, then go back and find when it was
merged (git log, git blame, etc). That's all I did....

-Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fwd: does xfs support aio_fsync?
  2022-10-29 21:01   ` Dave Chinner
@ 2022-10-30 16:44     ` Shawn
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn @ 2022-10-30 16:44 UTC (permalink / raw)
  To: Dave Chinner; +Cc: linux-xfs

Yes I upgraded to kernel 4.18 and async fsync works as expected.
Thank you Darrick, and Dave for your quick response!


Shawn

On Sat, Oct 29, 2022 at 2:01 PM Dave Chinner <david@fromorbit.com> wrote:
>
> On Fri, Oct 28, 2022 at 03:11:15PM -0700, Neutron Sharc wrote:
> > Hello all,
> > I have a workload that benefits the most if I can issue async fsync
> > after many async writes are completed. I was under the impression that
> > xfs/ext4 both support async fsync so I can use libaio to submit fsync.
> > When I tested with io_submit(fsync),  it always returned EINVAL.  So I
> > browsed the linux source (both kernel 3.10,  4.14)  and I found
> > xfs/xfs_file.c doesn't implement "aio_fsync", nor does ext4/file.c.
>
> Generic support for IOCB_CMD_FSYNC and IOCB_CMD_FDSYNC was added
> into 4.17. As a result it should be supported by almost all
> filesystems, not just XFS....
>
> > I found an old post which said aio_fsync was already included in xfs
> > (https://www.spinics.net/lists/xfs/msg28408.html)
>
> Yeah, the code that went into fs/aio.c was pretty much a generic
> version of this.
>
> > What xfs or kernel version should I use to get aio_fsync working?  Thanks all.
>
> Just a kernel that isn't ancient. If you are looking for features,
> always check latest code first, then go back and find when it was
> merged (git log, git blame, etc). That's all I did....
>
> -Dave.
> --
> Dave Chinner
> david@fromorbit.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-30 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAB-bdyRWCJLDde4izM_H-Bh9wPg-Enas+D4VvTROWEpVy0ZgZg@mail.gmail.com>
2022-10-28 22:11 ` Fwd: does xfs support aio_fsync? Neutron Sharc
2022-10-28 22:58   ` Darrick J. Wong
2022-10-29 21:01   ` Dave Chinner
2022-10-30 16:44     ` Shawn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.