linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
To: Goldwyn Rodrigues <rgoldwyn-l3A5Bk7waGM@public.gmane.org>
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	jack-IBi9RG/b67k@public.gmane.org,
	hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	adam.manzanares-Sjgp3cTcYWE@public.gmane.org,
	Goldwyn Rodrigues <rgoldwyn-IBi9RG/b67k@public.gmane.org>
Subject: Re: [PATCH 04/10] fs: Introduce RWF_NOWAIT
Date: Sat, 10 Jun 2017 06:27:03 +0100	[thread overview]
Message-ID: <20170610052703.GC6365@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20170606111939.27272-5-rgoldwyn-l3A5Bk7waGM@public.gmane.org>

On Tue, Jun 06, 2017 at 06:19:33AM -0500, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn-IBi9RG/b67k@public.gmane.org>
> 
> RWF_NOWAIT informs kernel to bail out if an AIO request will block
> for reasons such as file allocations, or a writeback triggered,
> or would block while allocating requests while performing
> direct I/O.
> 
> RWF_NOWAIT is translated to IOCB_NOWAIT for iocb->ki_flags.
> 
> The check for -EOPNOTSUPP is placed in generic_file_write_iter(). This
> is called by most filesystems, either through fsops.write_iter() or through
> the function defined by write_iter(). If not, we perform the check defined
> by .write_iter() which is called for direct IO specifically.
> 
> Filesystems xfs, btrfs and ext4 would be supported in the following patches.

Umm...  What about ->write_iter() instances outside of fs/*?  Even in fs/*,
consider e.g.
int cifs_get_writer(struct cifsInodeInfo *cinode)
{
        int rc;

start:
        rc = wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_OPLOCK_BREAK,
                         TASK_KILLABLE);

and cifs_file_write_iter() calling it before going to generic_file_write_iter().
Ditto for cifs_struct_writev()...  coda_file_write_iter() does inode_lock()
before calling vfs_iter_write().  ext2_dax_write_iter(): inode_lock().
f2fs_file_write_iter(): ditto.  fuse_file_write_iter(): ditto in case when
->writeback_cache is false.  gfs2 is O_APPEND case: almost certainly blocks.
ncp_file_write_iter(): blocks (mutex_lock(&NCP_FINFO(inode)->open_mutex)
in ncp_make_open(), not to mention anything else). ntfs_file_write_iter():
inode_lock().  orangefs_file_write_iter(): ditto.  ubifs_write_iter():
may block in update_mctime().  udf_file_write_iter(): inode_lock().

Lustre sure as hell does block before it gets anywhere near mm/filemap.c.

And that - just from looking at regular files.  Then we have sockets and
pipes, not to mention weird stuff like fs/fuse/cuse.c, etc.

  parent reply	other threads:[~2017-06-10  5:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 11:19 [PATCH 0/10 v11] No wait AIO Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 02/10] fs: Introduce filemap_range_has_page() Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 03/10] fs: Use RWF_* flags for AIO operations Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 04/10] fs: Introduce RWF_NOWAIT Goldwyn Rodrigues
     [not found]   ` <20170606111939.27272-5-rgoldwyn-l3A5Bk7waGM@public.gmane.org>
2017-06-10  5:27     ` Al Viro [this message]
2017-06-06 11:19 ` [PATCH 05/10] fs: return if direct write will trigger writeback Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 06/10] fs: Introduce IOMAP_NOWAIT Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 07/10] block: return on congested block device Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 08/10] ext4: nowait aio support Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 09/10] xfs: " Goldwyn Rodrigues
2017-06-06 11:19 ` [PATCH 10/10] btrfs: " Goldwyn Rodrigues
2017-06-08  7:39 ` [PATCH 0/10 v11] No wait AIO Christoph Hellwig
2017-06-10  5:34   ` Al Viro
2017-06-12 22:38     ` Goldwyn Rodrigues
     [not found]       ` <58bbe95e-5a4a-4387-3a00-16ed2e861bd3-l3A5Bk7waGM@public.gmane.org>
2017-06-13  6:14         ` Christoph Hellwig
2017-06-15 11:11           ` Al Viro
2017-06-15 14:55             ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2017-06-05  5:35 [PATCH 0/10 v10] " Goldwyn Rodrigues
2017-06-05  5:35 ` [PATCH 04/10] fs: Introduce RWF_NOWAIT Goldwyn Rodrigues
2017-05-24 16:41 [PATCH 0/10 v9] No wait AIO Goldwyn Rodrigues
2017-05-24 16:41 ` [PATCH 04/10] fs: Introduce RWF_NOWAIT Goldwyn Rodrigues
2017-05-25  8:30   ` Jan Kara
2017-05-11 19:17 [PATCH 0/10 v8] No wait AIO Goldwyn Rodrigues
2017-05-11 19:17 ` [PATCH 04/10] fs: Introduce RWF_NOWAIT Goldwyn Rodrigues
     [not found]   ` <20170511191710.31959-5-rgoldwyn-l3A5Bk7waGM@public.gmane.org>
2017-05-15  9:47     ` Jan Kara

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=20170610052703.GC6365@ZenIV.linux.org.uk \
    --to=viro-3bdd1+5odreifsdqtta3olvcufugdwfn@public.gmane.org \
    --cc=adam.manzanares-Sjgp3cTcYWE@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=jack-IBi9RG/b67k@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rgoldwyn-IBi9RG/b67k@public.gmane.org \
    --cc=rgoldwyn-l3A5Bk7waGM@public.gmane.org \
    --subject='Re: [PATCH 04/10] fs: Introduce RWF_NOWAIT' \
    /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

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).