linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org
Cc: hch@lst.de, viro@ZenIV.linux.org.uk
Subject: [PATCHSET] Re-introduce iov/bio no page referencing
Date: Wed, 27 Feb 2019 13:20:04 -0700	[thread overview]
Message-ID: <20190227202006.18844-1-axboe@kernel.dk> (raw)

The io_uring branch had a patch that enabled us to NOT get/put page
references on pages that we have registered from the application.
This patch assumed that it was safe to never do this for any ITER_BVEC,
but that turned out to be problematic for the splice direct case where
we stuff those pages into a pipe and unconditionally release them when
the pipe buffer is released.

This was fixed by always grabbing an extra page reference before doing
IO, and let the caller release that reference. However, this causes a
performance regressions since we're now doing an atomic inc/dec per
IO needlessly.

Instead of assuming that any ITER_BVEC caller knows not to put these
page references, have the caller explicitly flag it. This shifts the
iter types up a bit, so we can add a bit similar to the read/write bit
for managing this information.

Patch 2 then re-introduces the BIO_NO_PAGE_REF, which is now limited by
both ITER_BVEC _and_ the caller flagged it as safe.

Patches are on top of my io_uring branch.

-- 
Jens Axboe



             reply	other threads:[~2019-02-27 20:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 20:20 Jens Axboe [this message]
2019-02-27 20:20 ` [PATCH 1/2] iov_iter: add ITER_BVEC_FLAG_NO_REF flag Jens Axboe
2019-02-27 20:20 ` [PATCH 2/2] block: add BIO_NO_PAGE_REF flag Jens Axboe

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=20190227202006.18844-1-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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).