linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Matthew Wilcox <willy@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Benjamin LaHaise <bcrl@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-aio@kvack.org, linux-mm <linux-mm@kvack.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH] aio: Convert ioctx_table to XArray
Date: Tue, 11 Dec 2018 11:41:55 -0700	[thread overview]
Message-ID: <09e3d156-66fc-ca17-efac-63f080a27a1d@kernel.dk> (raw)
In-Reply-To: <20181128183531.5139-1-willy@infradead.org>

On Wed, Nov 28, 2018 at 11:35 AM Matthew Wilcox <willy@infradead.org> wrote:
> @@ -1026,24 +979,17 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id)
>         struct aio_ring __user *ring  = (void __user *)ctx_id;
>         struct mm_struct *mm = current->mm;
>         struct kioctx *ctx, *ret = NULL;
> -       struct kioctx_table *table;
>         unsigned id;
>
>         if (get_user(id, &ring->id))
>                 return NULL;
>
>         rcu_read_lock();
> -       table = rcu_dereference(mm->ioctx_table);
> -
> -       if (!table || id >= table->nr)
> -               goto out;
> -
> -       ctx = rcu_dereference(table->table[id]);
> +       ctx = xa_load(&mm->ioctx, id);
>         if (ctx && ctx->user_id == ctx_id) {
>                 if (percpu_ref_tryget_live(&ctx->users))
>                         ret = ctx;
>         }

Question on this part - do we need that RCU read lock around this now? I
don't think we do.

-- 
Jens Axboe

  parent reply	other threads:[~2018-12-11 18:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28 18:35 [PATCH] aio: Convert ioctx_table to XArray Matthew Wilcox
2018-12-06 21:08 ` Matthew Wilcox
2018-12-06 22:21 ` Jeff Moyer
2018-12-06 22:26   ` Jeff Moyer
2018-12-11 17:21     ` Jeff Moyer
2018-12-11 17:51       ` Matthew Wilcox
2018-12-11 18:02         ` Jeff Moyer
2018-12-11 18:05           ` Jens Axboe
2018-12-11 18:09             ` Jeff Moyer
2018-12-11 18:37               ` Jens Axboe
2018-12-11 18:32             ` Jens Axboe
2018-12-11 18:36               ` Jens Axboe
2018-12-11 18:51               ` Matthew Wilcox
2018-12-11 18:52                 ` Jens Axboe
2018-12-11 18:41 ` Jens Axboe [this message]
2018-12-11 18:45   ` Matthew Wilcox
2018-12-11 18:46     ` Jens Axboe
2018-12-11 18:53       ` Matthew Wilcox
2018-12-11 18:54         ` Jens Axboe
2018-12-11 18:53       ` 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=09e3d156-66fc-ca17-efac-63f080a27a1d@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=akpm@linux-foundation.org \
    --cc=bcrl@kvack.org \
    --cc=dan.carpenter@oracle.com \
    --cc=keescook@chromium.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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).