From: Christoph Hellwig <hch@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: support@coraid.com, "Ed L. Cashin" <ecashin@coraid.com>,
linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: Re: PATCH 2.6.21-rc1 aoe: handle zero _count pages in bios
Date: Fri, 2 Mar 2007 02:29:19 +0000 [thread overview]
Message-ID: <20070302022919.GA26285@infradead.org> (raw)
In-Reply-To: <20070301174204.a550dd3a.akpm@linux-foundation.org>
On Thu, Mar 01, 2007 at 05:42:04PM -0800, Andrew Morton wrote:
> Something funny is going on here.
Not so funny for those who've tried to sort out the issue over
the past years and just got ignored..
> Generally, one should increment the refcount of a page when it is put into
> some container. That means that the page should get +1 when it is added to
> a bio. (direct-io does this, but the mpage.c pagecache code cheats, and
> relies upon PG_locked and PG-writeback protecting the page).
It's a slab page, and slab pages aren't refcounted (which is a good thing
as you don't own the whole page)
> Similarly, the network code (or its caller) should be incrementing the
> page's refcount as the page goes into a container (ie: the skb) and
> decrementing it as the page is removed.
>
> But someone somewhere is breaking those rules. Who?
slab code.
> So. Who is breaking refcounting protocol here? Perhaps it is AOE, failing
> to increment the refcount on pages as they are added to an skb?
>
> (Do we know which callsite in XFS is adding zero-ref pages to a BIO, btw?)
For example all log I/O is done from kmalloce pages.
Anyway, to rehash what I've been trying to get clarified for ages:
(1) should we allow to pass slab pages into bios
and
(2) if yes what's the way lower layers are supposed to handle them
for any possible refcounting operations like networking or rdma.
There's also a pontial caller in ext3 that can send down kmalloc'ed
buffers: journal_write_metadata_buffer() in need_copy_out && !done_copy_out
case. But apparently that's an almost dead code path as I've never
seen anyone tripping this one, it's always XFS that people report.
next prev parent reply other threads:[~2007-03-02 2:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-01 23:15 PATCH 2.6.21-rc1 aoe: handle zero _count pages in bios Ed L. Cashin
2007-03-02 1:42 ` Andrew Morton
2007-03-02 2:29 ` Christoph Hellwig [this message]
2007-03-02 3:22 ` Andrew Morton
2007-03-02 4:30 ` Christoph Hellwig
2007-03-02 4:48 ` Andrew Morton
2007-03-02 4:49 ` Christoph Hellwig
2007-03-02 5:00 ` Andrew Morton
2007-03-02 5:03 ` Christoph Hellwig
2007-03-02 5:09 ` Andrew Morton
2007-03-02 5:15 ` Christoph Hellwig
2007-03-02 15:51 ` Sam Hopkins
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=20070302022919.GA26285@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=ecashin@coraid.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=support@coraid.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