linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Matthew Wilcox <willy@debian.org>
Cc: linux-aio@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: aio_fsync
Date: Sat, 26 Jul 2003 16:25:46 -0700	[thread overview]
Message-ID: <20030726162546.2c1d97ad.akpm@osdl.org> (raw)
In-Reply-To: <20030718183336.GW23808@parcelfarce.linux.theplanet.co.uk>

Matthew Wilcox <willy@debian.org> wrote:
>
> i'm updating the Documentation/filesystem/Locking document.
> i notice that sys_fsync() takes the i_sem before calling ->fsync, but
> io_submit_one() does not take i_sem before calling ->aio_fsync.
> 
> is this intentional?  do we not need to protect against concurrent
> writers as sys_fsync does?

I don't think anything implements aio_fsync().

But yes, the main reason for taking i_sem there is to prevent new writes
from coming in and hopelessly livelocking the fsync.

Unless the fsync() is implemented via a radix-tree walk.  That is not
livelockable: just do a sync_page_range() across the pages from 0 to
i_size.  This can potentially blow some amounts of CPU if there are a lot
of pages in cache but only a handful are dirty.

fsync() is lame.  If we go ahead and implement this I would suggest that we
allow userspace to pass in a start/length which represents a subsection of
the file.  That's easy to do and is a ton more useful.  And all the needed
bits and pieces already exist in the O_SYNC handling in -mm: it's just a
matter of wiring it up.


--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

  reply	other threads:[~2003-07-26 23:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-18 18:33 aio_fsync Matthew Wilcox
2003-07-26 23:25 ` Andrew Morton [this message]
2003-08-06  6:21   ` aio_fsync Suparna Bhattacharya
  -- strict thread matches above, loose matches on Subject: below --
2002-11-06 15:23 aio_fsync Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030726162546.2c1d97ad.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=willy@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).