From: Ralf Baechle <ralf@linux-mips.org>
To: "Krzysztof Hałasa" <khalasa@piap.pl>
Cc: linux-mips@linux-mips.org, linux-media@vger.kernel.org
Subject: Re: Suspected cache coherency problem on V4L2 and AR7100 CPU
Date: Wed, 9 Oct 2013 10:17:07 +0200 [thread overview]
Message-ID: <20131009081707.GL1615@linux-mips.org> (raw)
In-Reply-To: <m38uy37x5r.fsf@t19.piap.pl>
On Wed, Oct 09, 2013 at 08:53:20AM +0200, Krzysztof Hałasa wrote:
> > 16K is a silver bullet solution to all cache aliasing problems. So if
> > your issue persists with 16K page size, it's not a cache aliasing issue.
> > Aside there are generally performance gains from the bigger page size.
>
> I wonder why isn't the issue present in other cases. Perhaps remapping
> of a userspace address and accessing it with kseg0 isn't a frequent
> operation.
>
> Shouldn't we change the default page size (on affected CPUs) to 16 KB
> then? Alternatively, we could flush/invalidate the cache when needed -
> is it a viable option?
The kernel is supposed to perform the necessary cache flushing, so any
remaining aliasing issue would be considered a bug. But the code is
performance sensitive, some of the problem cases are twisted and complex
so bugs and unsolved corner cases show up every now and then.
The historic default is 4K page size - on some processors such as the
venerable R3000 it's also the only page size available. Some application
code wants to know the page size and has wisely hardcoded 4K. Also
a "fix" to binutils many years ago reduced the alignment of generated
binaries so they'd not run on a kernel with larger page size. The
kernel configuration defaults are chosen to just work out of the box,
and 4K page size is the safest choice.
Anyway, binutils got "unfixed" again years ago so chances are 16K
will just work.
Does it work for you, even solve your problem?
Ralf
next prev parent reply other threads:[~2013-10-09 8:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-03 14:00 Suspected cache coherency problem on V4L2 and AR7100 CPU Krzysztof Hałasa
2013-10-04 8:06 ` Krzysztof Hałasa
2013-10-07 8:38 ` Krzysztof Hałasa
2013-10-07 14:24 ` Ralf Baechle
2013-10-08 8:24 ` Krzysztof Hałasa
2013-10-08 12:07 ` Ralf Baechle
2013-10-09 6:53 ` Krzysztof Hałasa
2013-10-09 8:17 ` Ralf Baechle [this message]
2013-10-09 13:05 ` Krzysztof Hałasa
2013-10-08 10:46 ` Krzysztof Hałasa
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=20131009081707.GL1615@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=khalasa@piap.pl \
--cc=linux-media@vger.kernel.org \
--cc=linux-mips@linux-mips.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