From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Wei Yongjun <weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH -next v3] IB/ipath: use GFP_NOWAIT under spin lock
Date: Fri, 22 Feb 2013 14:44:51 -0800 [thread overview]
Message-ID: <20130222144451.ed48f015.akpm@linux-foundation.org> (raw)
In-Reply-To: <CAOS58YMrcCwh8RhnfRTsmbfa_K_h1=n2M6ws4=MHWDxpAAoXOw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, 22 Feb 2013 14:21:58 -0800
Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> Hello, Andrew.
>
> On Fri, Feb 22, 2013 at 2:16 PM, Andrew Morton
> <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> wrote:
> > Given that this code is performing allocations under
> > spin_lock_irqsave(), it should be using idr_preload()/idr_preload_end()
> > (and perhaps even a repeat loop around those) to make the allocations
> > more reliable.
>
> It's already using preload so GFP_NOWAIT is enough to guarantee
> GFP_KERNEL level allocation.
>
Not "guarantee".
- idr_preload() might fail. It is a design error that idr_preload()
returns void - it should do what radix_tree_preload() does.
- even if idr_preload() completed the preload, an interrupt might
come in and its handler might drain this cpu's preload pool.
This all sounds like crazy will-never-happen stuff. That's what I
thought about the radix-tree code when used for pagecache. But under
extreme worloads, the cant-happens kept on happening, which is how all
that funky preload/preempt-disable stuff occurred.
It would be more robust still if the per-cpu preload magazines were
per-radixtree and per-idr, rather than kernel-wide. That would reduce
the risk of interrupt-time stealing. Or make foo_preload() return with
interrupts disabled rather than jsut preempt_disable().
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-02-22 22:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-21 5:45 [PATCH -next v2] IB/ipath: use GFP_NOWAIT under spin lock Wei Yongjun
[not found] ` <CAPgLHd965-++Kj6HE-wjHqpZjortmmCAvApSSwiXaX6YwWncHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-21 14:34 ` Marciniszyn, Mike
2013-02-21 15:33 ` Tejun Heo
[not found] ` <CAOS58YNcJ0gDmoR4M1tgJbqqzv0i=5EkoAr=OhoTSrozfw-ZtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-21 15:34 ` Tejun Heo
[not found] ` <CAOS58YOHt7OaBHRwwqjLF8xZtVaj=BeFUXFAxW0owb4_BxC3Rg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-22 2:48 ` [PATCH -next v3] " Wei Yongjun
[not found] ` <CAPgLHd8_WyQiDpJwRWwNVPbSvVcpMj1bMu7h2QmfJpscd0LOFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-22 22:16 ` Andrew Morton
[not found] ` <20130222141642.247ee792.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2013-02-22 22:21 ` Tejun Heo
[not found] ` <CAOS58YMrcCwh8RhnfRTsmbfa_K_h1=n2M6ws4=MHWDxpAAoXOw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-22 22:44 ` Andrew Morton [this message]
[not found] ` <20130222144451.ed48f015.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2013-02-22 22:51 ` Tejun Heo
[not found] ` <CAOS58YMo3rABCLpKYRr7pRqeMo+rmGbbUJDj5xxE08pb-SyBqw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-22 22:58 ` Tejun Heo
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=20130222144451.ed48f015.akpm@linux-foundation.org \
--to=akpm-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.