public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: John Myers <jgmyers@netscape.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Re: aio_poll in 2.6?
Date: Fri, 16 May 2003 19:50:25 -0700	[thread overview]
Message-ID: <20030516195025.4bf5dd8d.akpm@digeo.com> (raw)
In-Reply-To: <200305170054.RAA10802@pagarcia.nscp.aoltw.net>

John Myers <jgmyers@netscape.com> wrote:
>
> It's basically waiting for someone to merge the patch.  There were
> some people making unsubstantiated claims that it didn't scale, but
> the available benchmarks showed that it scaled perfectly across the
> parameters tested.

What is the testing status of this?

Have any real-life applications been converted?

Does it require libaio changes to test?

>  
> +int async_poll(struct kiocb *iocb, int events);
> +

growl.  Please don't put function prototypes in .c files.  It defeats
typechecking.  I've moved this to aio.h.

> +int async_poll(struct kiocb *iocb, int events)
> +{
> +	unsigned int mask;
> +	struct async_poll_iocb *apiocb = kiocb_to_apiocb(iocb);
> +
> +	/* Fast path */
> +	if (iocb->ki_filp->f_op && iocb->ki_filp->f_op->poll) {
> +		mask = iocb->ki_filp->f_op->poll(iocb->ki_filp, NULL);
> +		mask &= events | POLLERR | POLLHUP;
> +		if (mask & events)
> +			return events;
> +	}
> +
> +	init_poll_funcptr(&apiocb->pt, async_poll_queue_proc);
> +	apiocb->armed = &apiocb;
> +	apiocb->outofmem = 0;
> +	apiocb->events = events;
> +	apiocb->ehead = NULL;
> +
> +	iocb->ki_users++;

There is no locking around this modification of ->ki_users.  Is this
correct?

> +	wmb();

Barriers always need comments explaining why they are there.

> +
> +	mask = DEFAULT_POLLMASK;
> +	if (iocb->ki_filp->f_op && iocb->ki_filp->f_op->poll)
> +		mask = iocb->ki_filp->f_op->poll(iocb->ki_filp, &apiocb->pt);
> +	mask &= events | POLLERR | POLLHUP;
> + 	if (mask && xchg(&apiocb->armed, NULL)) {
> +		async_poll_freewait(apiocb, NULL);
> +		aio_complete(iocb, mask, 0);
> +	}
> +	if (unlikely(apiocb->outofmem) && xchg(&apiocb->armed, NULL)) {
> +		async_poll_freewait(apiocb, NULL);
> +		aio_put_req(iocb);
> +		aio_put_req(iocb);

Is the double-put intentional?



  reply	other threads:[~2003-05-17  2:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.mc7vl0v.u7u2ah@ifi.uio.no>
2003-05-17  0:54 ` [PATCH] Re: aio_poll in 2.6? John Myers
2003-05-17  2:50   ` Andrew Morton [this message]
2003-05-19 19:38     ` [PATCH] Re: aio_poll in 2.6 John Myers
2003-05-19 19:48       ` Alan Cox
2003-05-19 21:16         ` Andrew Morton
2003-05-19 21:33           ` John Myers
2003-05-19 22:54             ` Andrew Morton

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=20030516195025.4bf5dd8d.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=jgmyers@netscape.com \
    --cc=linux-kernel@vger.kernel.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