From: Andrew Morton <akpm@linux-foundation.org>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org,
linux-mips@linux-mips.org, linux-xtensa@linux-xtensa.org,
linux-kernel@vger.kernel.org,
Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Subject: Re: [PATCH v2] mm/highmem: make kmap cache coloring aware
Date: Wed, 23 Jul 2014 14:17:21 -0700 [thread overview]
Message-ID: <20140723141721.d6a58555f124a7024d010067@linux-foundation.org> (raw)
In-Reply-To: <1405616598-14798-1-git-send-email-jcmvbkbc@gmail.com>
On Thu, 17 Jul 2014 21:03:18 +0400 Max Filippov <jcmvbkbc@gmail.com> wrote:
> From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
>
> Provide hooks that allow architectures with aliasing cache to align
> mapping address of high pages according to their color. Such architectures
> may enforce similar coloring of low- and high-memory page mappings and
> reuse existing cache management functions to support highmem.
>
> ...
>
> --- a/mm/highmem.c
> +++ b/mm/highmem.c
> @@ -44,6 +44,14 @@ DEFINE_PER_CPU(int, __kmap_atomic_idx);
> */
> #ifdef CONFIG_HIGHMEM
>
> +#ifndef ARCH_PKMAP_COLORING
> +#define set_pkmap_color(pg, cl) /* */
> +#define get_last_pkmap_nr(p, cl) (p)
> +#define get_next_pkmap_nr(p, cl) (((p) + 1) & LAST_PKMAP_MASK)
> +#define is_no_more_pkmaps(p, cl) (!(p))
> +#define get_next_pkmap_counter(c, cl) ((c) - 1)
> +#endif
This is the old-school way of doing things. The new Linus-approved way is
#ifndef set_pkmap_color
#define set_pkmap_color ...
#define get_last_pkmap_nr ...
#endif
so we don't need to add yet another symbol and to avoid typos, etc.
Secondly, please identify which per-arch header file is responsible for
defining these symbols. Document that here and make sure that
mm/highmem.c is directly including that file. Otherwise we end up with
different architectures using different header files and it's all a big
mess.
Thirdly, macros are nasty things. It would be nicer to do
#ifndef set_pkmap_color
static inline void set_pkmap_color(...)
{
...
}
#define set_pkmap_color set_pkmap_color
...
#endif
Fourthly, please document these proposed interfaces with code comments.
Fifthly, it would be very useful to publish the performance testing
results for at least one architecture so that we can determine the
patchset's desirability. And perhaps to motivate other architectures
to implement this.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-07-23 21:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 17:03 Max Filippov
2014-07-22 0:58 ` David Rientjes
2014-07-22 1:14 ` Leonid Yegoshin
2014-07-22 1:20 ` David Rientjes
2014-07-22 9:44 ` Max Filippov
2014-07-23 21:17 ` Andrew Morton [this message]
2014-07-24 0:38 ` Max Filippov
2014-07-24 22:21 ` Andrew Morton
2014-07-25 2:12 ` Leonid Yegoshin
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=20140723141721.d6a58555f124a7024d010067@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Leonid.Yegoshin@imgtec.com \
--cc=jcmvbkbc@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-mm@kvack.org \
--cc=linux-xtensa@linux-xtensa.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