From: Benjamin LaHaise <bcrl@kvack.org>
To: Ken Chen <kenchen@google.com>
Cc: Zach Brown <zach.brown@oracle.com>,
akpm@linux-foundation.org, linux-aio@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [patch] convert aio event reap to use atomic-op instead of spin_lock
Date: Wed, 11 Apr 2007 15:45:04 -0400 [thread overview]
Message-ID: <20070411194504.GM13621@kvack.org> (raw)
In-Reply-To: <b040c32a0704111228t5065253en9249ff88db5b1384@mail.gmail.com>
On Wed, Apr 11, 2007 at 12:28:26PM -0700, Ken Chen wrote:
> >I have mixed feelings. I think the userspace getevents support was
> >poorly designed and the simple fact that we've gone this long without it
> >says just how desperately the feature isn't needed.
>
> I kept on getting requests from application developers who want that
> feature. My initial patch was dated back May 2004.
The right way to do it involves synchronization between the kernel side
io_getevents() and the userspace code pulling events out of the ring.
Alan Cox suggested embedding a futex in the shared memory region, but I
don't think anyone ever implemented that.
> I noticed that while writing the patch. We have the same bug right
> now that nr_events is enlarged to consume the entire mmap'ed ring
> buffer pages. But yet, we don't account those in aio_max_nr. I
> didn't fix that up in this patch because I was going to do a separate
> patch on that.
It's not accounted because it is irrelevant -- the memory used by the
events is already accounted against the user's address space. The actual
number of aios in flight is clamped to the maximum number of requests
that was specified and accounted against the global reservation. The
number of events in the ringbuffer can be larger, and that doesn't hurt
anything.
> >The ring page, which is mmaped to userspace at some weird address, was
> >just written through a kmap. Do we need a flush_dcache_page()? This
> >isn't this patch's problem, but it'd need to be addressed if we're using
> >the ring from userspace.
>
> I will look into this aside from this patch.
That's probably the case. Also, any changes in this area *must* correctly
update the compat/incompat feature flags in the ring buffer header. That
has been missed in the past...
-ben
--
"Time is of no importance, Mr. President, only life is important."
Don't Email: <zyntrop@kvack.org>.
next prev parent reply other threads:[~2007-04-11 19:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-10 23:53 [patch] convert aio event reap to use atomic-op instead of spin_lock Ken Chen
2007-04-11 5:18 ` Andrew Morton
2007-04-11 16:54 ` Ken Chen
2007-04-11 18:15 ` Zach Brown
2007-04-11 18:29 ` Ken Chen
2007-04-11 18:00 ` Zach Brown
2007-04-11 19:11 ` Andrew Morton
2007-04-11 19:34 ` Zach Brown
2007-04-11 19:28 ` Ken Chen
2007-04-11 19:44 ` Zach Brown
2007-04-11 19:45 ` Benjamin LaHaise [this message]
2007-04-11 19:52 ` Zach Brown
2007-04-11 20:03 ` Benjamin LaHaise
2007-04-12 7:29 ` Ken Chen
2007-04-12 12:06 ` Jeff Moyer
2007-04-13 0:57 ` Ken Chen
2007-04-13 1:08 ` Ken Chen
2007-04-12 7:50 ` Ken Chen
2007-04-12 14:31 ` Benjamin LaHaise
2007-04-12 15:13 ` Benjamin LaHaise
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=20070411194504.GM13621@kvack.org \
--to=bcrl@kvack.org \
--cc=akpm@linux-foundation.org \
--cc=kenchen@google.com \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zach.brown@oracle.com \
/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