public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: linux-kernel@vger.kernel.org, avi@redhat.com,
	kvm@vger.kernel.org, ghaskins@novell.com, rusty@rustcorp.com.au,
	bcrl@kvack.org
Subject: Re: [patch] eventfd - revised interface and cleanups (2nd rev)
Date: Tue, 23 Jun 2009 14:29:09 -0700	[thread overview]
Message-ID: <20090623142909.42776e75.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.1.10.0906231400010.17001@makko.or.mcafeemobile.com>

On Tue, 23 Jun 2009 14:03:22 -0700 (PDT)
Davide Libenzi <davidel@xmailserver.org> wrote:

> On Tue, 23 Jun 2009, Andrew Morton wrote:
> 
> > On Tue, 23 Jun 2009 12:25:36 -0700 (PDT)
> > Davide Libenzi <davidel@xmailserver.org> wrote:
> > 
> > > The following patch changes the eventfd interface to de-couple the eventfd 
> > > memory context, from the file pointer instance.
> > > Without such change, there is no clean way to racely free handle the 
> > > POLLHUP event sent when the last instance of the file* goes away.
> > > Also, now the internal eventfd APIs are using the eventfd context instead 
> > > of the file*.
> > > Another cleanup this patch does, is making AIO select EVENTFD, instead of 
> > > adding a bunch of empty function stubs inside eventfd.h in order to 
> > > handle the (AIO && !EVENTFD) case.
> > > 
> > > ...
> > >
> > > +/**
> > > + * eventfd_ctx_get - Acquires a reference to the internal eventfd context.
> > > + * @ctx: [in] Pointer to the eventfd context.
> > > + *
> > > + * Returns: In case of success, returns a pointer to the eventfd context,
> > > + *          otherwise a proper error code.
> > 
> > The description of the return value
> 
> Should functions be describing all the returned error codes, ala man pages?
> 

I think so.

> 
> > > + */
> > > +struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx)
> > > +{
> > > +	kref_get(&ctx->kref);
> > > +	return ctx;
> > > +}
> > > +EXPORT_SYMBOL_GPL(eventfd_ctx_get);
> > 
> > doesn't match the code.

You appear to have not seen the above sentence.

> > Also...
> > 
> > > + * Returns: A pointer to the eventfd file structure in case of success, or a
> > > + *          proper error pointer in case of failure.
> > 
> > 
> > > + * Returns: In case of success, it returns a pointer to the internal eventfd
> > > + *          context, otherwise a proper error code.
> > > + */
> > 
> > I'm unsure what the word "proper" means in this context.
> > 
> > The term "proper error pointer" is understandable enough - something
> > you run IS_ERR() against.  "error pointer" would suffice.
> > 
> > But the term "proper error code" is getting a bit remote from reality.
> > 
> > Unfortunately the kernel doesn't have a simple and agreed-to term for
> > an ERR_PTR() thingy.  Perhaps we should invent one.  "err_ptr"?
> 
> OK, but you tricked me once again :)
> You posted your comments/changes while you merged the old version in -mm 
> already.

yeah, I never trust people.  You might lose the email or jump on a
plane and disappear for three weeks, then it all gets forgotten about
and lost.

If the code doesn't have any apparent showstoppers I'll often merge it
with a note that it isn't finalised.

  reply	other threads:[~2009-06-23 21:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 16:47 [patch] eventfd - revised interface and cleanups Davide Libenzi
2009-06-23 16:59 ` Randy Dunlap
2009-06-23 17:04   ` Davide Libenzi
2009-06-23 17:03 ` Avi Kivity
2009-06-23 17:04   ` Davide Libenzi
2009-06-23 17:51 ` Gregory Haskins
2009-06-23 17:51   ` Davide Libenzi
2009-06-23 19:25 ` [patch] eventfd - revised interface and cleanups (2nd rev) Davide Libenzi
2009-06-23 19:48   ` Andrew Morton
2009-06-23 19:49     ` Davide Libenzi
2009-06-23 20:12   ` Andrew Morton
2009-06-23 20:59     ` Davide Libenzi
2009-06-23 21:25       ` Andrew Morton
2009-06-23 21:25         ` Davide Libenzi
2009-06-23 21:44           ` Andrew Morton
2009-06-23 22:49             ` Davide Libenzi
2009-06-23 23:18               ` Andrew Morton
2009-06-24 22:47                 ` Davide Libenzi
2009-06-24 23:12                   ` Andrew Morton
2009-06-24 23:52                     ` Davide Libenzi
2009-06-25  0:33                       ` Andrew Morton
2009-06-23 20:18   ` Andrew Morton
2009-06-23 21:03     ` Davide Libenzi
2009-06-23 21:29       ` Andrew Morton [this message]
2009-06-23 21:28         ` Davide Libenzi
2009-06-23 21:34         ` Davide Libenzi
2009-06-23 21:46           ` Andrew Morton
2009-06-23 21:48             ` Davide Libenzi
2009-06-23 22:07               ` Andrew Morton
2009-06-23 22:46   ` [patch] eventfd - revised interface and cleanups (3rd rev) Davide Libenzi
2009-06-24 23:57     ` [patch] eventfd - revised interface and cleanups (4th rev) Davide Libenzi

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=20090623142909.42776e75.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=bcrl@kvack.org \
    --cc=davidel@xmailserver.org \
    --cc=ghaskins@novell.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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