[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49B8807A.5080302@cosmosbay.com>
Date: Thu, 12 Mar 2009 04:24:42 +0100
From: Eric Dumazet <dada1@...mosbay.com>
To: Benjamin LaHaise <bcrl@...ck.org>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Jeff Moyer <jmoyer@...hat.com>, Avi Kivity <avi@...hat.com>,
linux-aio <linux-aio@...ck.org>, zach.brown@...cle.com,
linux-kernel@...r.kernel.org,
Davide Libenzi <davidel@...ilserver.org>
Subject: Re: [patch] aio: remove aio-max-nr and instead use the memlock rlimit
to limit the number of pages pinned for the aio completion ring
Benjamin LaHaise a écrit :
> On Thu, Mar 12, 2009 at 03:39:51AM +0100, Eric Dumazet wrote:
>> Assuming that __fput() cannot be called from interrupt context.
>> -> fput() should not be called from interrupt context as well.
>
> It doesn't get called in irq context. The atomic dec is done in irq
> context, and if that is the last user of the file descriptor, it's
> placed on a work queue and then released in process context.
>
really_put_req() itself can be called from interrupt context, unless I am wrong.
(its 4:24 am here ;) )
if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count))) {
get_ioctx(ctx);
spin_lock(&fput_lock);
list_add(&req->ki_list, &fput_head);
spin_unlock(&fput_lock);
queue_work(aio_wq, &fput_work);
} else
really_put_req(ctx, req); /* from interrupt context */
static inline void really_put_req(struct kioctx *ctx, struct kiocb *req)
{
assert_spin_locked(&ctx->ctx_lock);
if (!IS_ERR(req->ki_eventfd))
fput(req->ki_eventfd); /* BANG : can be called from interrupt context */
if (req->ki_dtor)
req->ki_dtor(req);
if (req->ki_iovec != &req->ki_inline_vec)
kfree(req->ki_iovec);
kmem_cache_free(kiocb_cachep, req);
ctx->reqs_active--;
if (unlikely(!ctx->reqs_active && ctx->dead))
wake_up(&ctx->wait);
}
Thank you
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists