From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: slab cache allocator problem?
Date: Thu, 31 Jan 2008 04:19:39 +0000 [thread overview]
Message-ID: <20080131041939.GA12926@linux-sh.org> (raw)
In-Reply-To: <1201645404.6269.7.camel@localhost.localdomain>
On Tue, Jan 29, 2008 at 10:23:24PM +0000, Adrian McMenamin wrote:
> Then allocate objects like this:
>
> mq->recvbufdcsp = kmem_cache_zalloc(maple_queue_cache, GFP_KERNEL);
> mq->recvbuf = (void *) P2SEGADDR(mq->recvbufdcsp);
>
[snip]
>
> But when I allocate and free them via hotplugging maple devices, I get
> things like this (after what appears to be a random number of
> hotplugs):
>
This sort of abuse of P2SEGADDR is really not what you want to be doing
in the first place. I'd really like to just get rid of the P1/P2SEGADDR
wrappers completely, as people do nothing but abuse them, and more often
than not depend on the wrappers to deal with all of their problems,
rather than thinking about what they actually want to do.
If you need to do a cacheflush after the copy, then do so explicitly. You
can probably even get away with just doing an invalidation in the read
path and a write-back in the write path, which will be faster than always
accessing it uncached. Trying to hack around dealing with the cache
management directly is nasty at best.
My guess is that ->recvbufdcsp is hitting a cached slab object that still
has cachelines associated with it which you are hitting after a few
iterations. The way to fix this is to make the cache management explicit,
both for ->recvbufdcsp and ->recvbuf. I would also wager that once this
is done, you should be able to do away with ->recvbufdcsp completely and
just use ->recvbuf.
next prev parent reply other threads:[~2008-01-31 4:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-29 22:23 slab cache allocator problem? Adrian McMenamin
2008-01-31 4:19 ` Paul Mundt [this message]
2008-01-31 23:39 ` Adrian McMenamin
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=20080131041939.GA12926@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=linux-sh@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