From: konrad.wilk@oracle.com (Konrad Rzeszutek Wilk)
To: linux-arm-kernel@lists.infradead.org
Subject: Compilation problem with drivers/staging/zsmalloc when !SMP on ARM
Date: Tue, 22 Jan 2013 15:33:52 -0500 [thread overview]
Message-ID: <20130122203352.GC12371@phenom.dumpdata.com> (raw)
In-Reply-To: <20130121152440.GJ23505@n2100.arm.linux.org.uk>
On Mon, Jan 21, 2013 at 03:24:40PM +0000, Russell King - ARM Linux wrote:
> On Fri, Jan 18, 2013 at 11:37:25PM -0500, Konrad Rzeszutek Wilk wrote:
> > On Fri, Jan 18, 2013 at 01:45:27PM -0800, Greg Kroah-Hartman wrote:
> > > On Fri, Jan 18, 2013 at 09:08:59PM +0000, Russell King - ARM Linux wrote:
> > > > On Fri, Jan 18, 2013 at 02:24:15PM -0600, Matt Sealey wrote:
> > > > > Hello all,
> > > > >
> > > > > I wonder if anyone can shed some light on this linking problem I have
> > > > > right now. If I configure my kernel without SMP support (it is a very
> > > > > lean config for i.MX51 with device tree support only) I hit this error
> > > > > on linking:
> > > >
> > > > Yes, I looked at this, and I've decided that I will _not_ fix this export,
> > > > neither will I accept a patch to add an export.
> > > >
> > > > As far as I can see, this code is buggy in a SMP environment. There's
> > > > apparantly no guarantee that:
> > > >
> > > > 1. the mapping will be created on a particular CPU.
> > > > 2. the mapping will then be used only on this specific CPU.
> > > > 3. no guarantee that another CPU won't speculatively prefetch from this
> > > > region.
> >
> > I thought the code had per_cpu for it - so that you wouldn't do that unless
> > you really went out the way to do it.
>
> Actually, yes, you're right - that negates point (4) and possibly (2),
> but (3) is still a concern. (3) shouldn't be that much of an issue
> _provided_ that the virtual addresses aren't explicitly made use of by
> other CPUs. Is that guaranteed by the zsmalloc code? (IOW, does it
> own the virtual region it places these mappings in?)
It does own them but it does also hand them off. So the users of it
might be put on a different CPU. I think, I need to trace the call-chain.
>
> What is the performance difference between having and not having this
> optimization? Can you provide some measurements please?
Oh boy, there were somewhere.
>
> Lastly, as you hold per_cpu stuff across this, that means preemption
> is disabled - and any kind of scheduling is also a bug. Is there
> any reason the kmap stuff can't be used? Has this been tried? How
> does it compare numerically with the existing solutions?
It was really dependent on the architecture. On x86 the copying
was superior, but on ARM it was sllow.
WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Matt Sealey <matt@genesi-usa.com>,
Linux ARM Kernel ML <linux-arm-kernel@lists.infradead.org>,
devel@driverdev.osuosl.org, LKML <linux-kernel@vger.kernel.org>,
Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
Seth Jennings <sjenning@linux.vnet.ibm.com>
Subject: Re: Compilation problem with drivers/staging/zsmalloc when !SMP on ARM
Date: Tue, 22 Jan 2013 15:33:52 -0500 [thread overview]
Message-ID: <20130122203352.GC12371@phenom.dumpdata.com> (raw)
In-Reply-To: <20130121152440.GJ23505@n2100.arm.linux.org.uk>
On Mon, Jan 21, 2013 at 03:24:40PM +0000, Russell King - ARM Linux wrote:
> On Fri, Jan 18, 2013 at 11:37:25PM -0500, Konrad Rzeszutek Wilk wrote:
> > On Fri, Jan 18, 2013 at 01:45:27PM -0800, Greg Kroah-Hartman wrote:
> > > On Fri, Jan 18, 2013 at 09:08:59PM +0000, Russell King - ARM Linux wrote:
> > > > On Fri, Jan 18, 2013 at 02:24:15PM -0600, Matt Sealey wrote:
> > > > > Hello all,
> > > > >
> > > > > I wonder if anyone can shed some light on this linking problem I have
> > > > > right now. If I configure my kernel without SMP support (it is a very
> > > > > lean config for i.MX51 with device tree support only) I hit this error
> > > > > on linking:
> > > >
> > > > Yes, I looked at this, and I've decided that I will _not_ fix this export,
> > > > neither will I accept a patch to add an export.
> > > >
> > > > As far as I can see, this code is buggy in a SMP environment. There's
> > > > apparantly no guarantee that:
> > > >
> > > > 1. the mapping will be created on a particular CPU.
> > > > 2. the mapping will then be used only on this specific CPU.
> > > > 3. no guarantee that another CPU won't speculatively prefetch from this
> > > > region.
> >
> > I thought the code had per_cpu for it - so that you wouldn't do that unless
> > you really went out the way to do it.
>
> Actually, yes, you're right - that negates point (4) and possibly (2),
> but (3) is still a concern. (3) shouldn't be that much of an issue
> _provided_ that the virtual addresses aren't explicitly made use of by
> other CPUs. Is that guaranteed by the zsmalloc code? (IOW, does it
> own the virtual region it places these mappings in?)
It does own them but it does also hand them off. So the users of it
might be put on a different CPU. I think, I need to trace the call-chain.
>
> What is the performance difference between having and not having this
> optimization? Can you provide some measurements please?
Oh boy, there were somewhere.
>
> Lastly, as you hold per_cpu stuff across this, that means preemption
> is disabled - and any kind of scheduling is also a bug. Is there
> any reason the kmap stuff can't be used? Has this been tried? How
> does it compare numerically with the existing solutions?
It was really dependent on the architecture. On x86 the copying
was superior, but on ARM it was sllow.
next prev parent reply other threads:[~2013-01-22 20:33 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-18 20:24 Compilation problem with drivers/staging/zsmalloc when !SMP on ARM Matt Sealey
2013-01-18 20:24 ` Matt Sealey
2013-01-18 21:08 ` Russell King - ARM Linux
2013-01-18 21:08 ` Russell King - ARM Linux
2013-01-18 21:45 ` Greg Kroah-Hartman
2013-01-18 21:45 ` Greg Kroah-Hartman
2013-01-19 4:37 ` Konrad Rzeszutek Wilk
2013-01-19 4:37 ` Konrad Rzeszutek Wilk
2013-01-21 15:24 ` Russell King - ARM Linux
2013-01-21 15:24 ` Russell King - ARM Linux
2013-01-22 20:33 ` Konrad Rzeszutek Wilk [this message]
2013-01-22 20:33 ` Konrad Rzeszutek Wilk
2013-01-19 1:11 ` Matt Sealey
2013-01-19 1:11 ` Matt Sealey
2013-01-19 4:46 ` Konrad Rzeszutek Wilk
2013-01-19 4:46 ` Konrad Rzeszutek Wilk
2013-01-21 5:55 ` Minchan Kim
2013-01-21 5:55 ` Minchan Kim
2013-01-21 16:00 ` Matt Sealey
2013-01-21 16:00 ` Matt Sealey
2013-01-22 15:48 ` Minchan Kim
2013-01-22 15:48 ` Minchan Kim
2013-01-22 20:34 ` Konrad Rzeszutek Wilk
2013-01-22 20:34 ` Konrad Rzeszutek Wilk
2013-01-21 16:20 ` Matt Sealey
2013-01-21 16:20 ` Matt Sealey
2013-01-21 16:29 ` Russell King - ARM Linux
2013-01-21 16:29 ` Russell King - ARM Linux
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=20130122203352.GC12371@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=linux-arm-kernel@lists.infradead.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.