linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Linus Torvalds <torvalds@linuxfoundation.org>,
	Christoph Hellwig <hch@lst.de>,
	Matthew Wilcox <willy@infradead.org>,
	Daniel Vetter <daniel@ffwll.ch>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>
Subject: [patch V4 0/8] mm/highmem: Preemptible variant of kmap_atomic & friends
Date: Wed, 18 Nov 2020 20:48:38 +0100	[thread overview]
Message-ID: <20201118194838.753436396@linutronix.de> (raw)

This is the outstanding set of patches for the preemptible kmap_*()
implementation. The previous version is here:

  https://lore.kernel.org/r/20201103092712.714480842@linutronix.de

The following changes come with it:

 - Better debugging for kmap* by enforcing the temporary mappings even for
   lowmem pages when the architecture allows it.

 - Support for enforced mappings on X86 for both 32 and 64 bit. As
   KMAP_LOCAL is already independent from HIGHMEM this needs only the extra
   fixmap space on 64bit and no further code changes.

 - Removing the RT dependency from migrate_disable/enable(). This patch
   still needs some help from the scheduler folks vs. the comment in
   preempt.h.

 - Switching from per CPU storage of the kmap index to a per task storage
   by adding a pteval array to the per task storage which contains the
   ptevals of the currently active temporary kmaps

 - Adding context switch code which checks whether the outgoing or the
   incoming task has active temporary kmaps. If so, the outgoing task's
   kmaps are removed and the incoming task's kmaps are restored.

 - Adding new interfaces k[un]map_local*() which are not disabling
   preemption and can be called from any context (except NMI).

   Contrary to kmap() which provides preemptible and "persistant" mappings,
   these interfaces are meant to replace the temporary mappings provided by
   kmap_atomic*() today.

This allows to get rid of conditional mapping choices and allows to have
preemptible short term "mappings" on 64bit which are today enforced to be
non-preemptible due to the highmem constraints. It clearly puts overhead on
the highmem users, but highmem is slow anyway.

This is not a wholesale conversion which makes kmap_atomic magically
preemptible because there might be usage sites which rely on the implicit
preempt disable. So this needs to be done on a case by case basis and the
call sites converted to kmap_local().

Changes vs. V3:

   - Rebased on top of the merged consolidation patches and on top of
     the latest version of migrate disable support.

   - New debug features (enforced mappings)

   - Dropped the conversion patches as they need review from the respective
     subsystems and better go through the relevant trees for 5.12

The series is based on

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/mm

with

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core

merged in.

It is also available from git:

   git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git highmem

Thanks,

	tglx
---
 Documentation/driver-api/io-mapping.rst |   74 +++++++++++--------
 arch/x86/Kconfig                        |    1 
 arch/x86/include/asm/fixmap.h           |   12 ++-
 arch/x86/include/asm/pgtable_64_types.h |    6 +
 arch/x86/kernel/crash_dump_32.c         |   48 ++----------
 include/asm-generic/kmap_size.h         |    2 
 include/linux/highmem-internal.h        |   58 +++++++++++++++
 include/linux/highmem.h                 |   43 +++++++----
 include/linux/io-mapping.h              |   30 +++++++
 include/linux/kernel.h                  |   21 +++--
 include/linux/preempt.h                 |   38 ----------
 include/linux/sched.h                   |   11 ++
 kernel/entry/common.c                   |    2 
 kernel/fork.c                           |    1 
 kernel/sched/core.c                     |   63 ++++++++++++++--
 kernel/sched/sched.h                    |    4 -
 lib/Kconfig.debug                       |   22 +++++
 lib/smp_processor_id.c                  |    2 
 mm/highmem.c                            |  121 ++++++++++++++++++++++++++++----
 19 files changed, 400 insertions(+), 159 deletions(-)




             reply	other threads:[~2020-11-18 20:58 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 19:48 Thomas Gleixner [this message]
2020-11-18 19:48 ` [patch V4 1/8] mm/highmem: Provide and use CONFIG_DEBUG_KMAP_LOCAL Thomas Gleixner
2020-11-24 14:20   ` [tip: core/mm] " tip-bot2 for Thomas Gleixner
2020-11-18 19:48 ` [patch V4 2/8] mm/highmem: Provide CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP Thomas Gleixner
2020-11-18 21:13   ` Linus Torvalds
2020-11-19  8:46     ` Mel Gorman
2020-11-19 17:19       ` Linus Torvalds
2020-11-24 14:20   ` [tip: core/mm] " tip-bot2 for Thomas Gleixner
2020-11-18 19:48 ` [patch V4 3/8] x86: Support kmap_local() forced debugging Thomas Gleixner
2020-11-24 14:20   ` [tip: core/mm] " tip-bot2 for Thomas Gleixner
2021-01-06 23:01   ` [BUG] from " Steven Rostedt
2021-01-07  1:03     ` Linus Torvalds
2021-01-07  1:16       ` Steven Rostedt
2021-01-07  1:49       ` Steven Rostedt
2021-01-07  1:49       ` Jakub Kicinski
2021-01-07  2:11         ` Willem de Bruijn
2021-01-07  4:44           ` Willem de Bruijn
2021-01-07 19:47             ` Linus Torvalds
2021-01-07 20:52               ` Steven Rostedt
2021-01-07 21:07                 ` Willem de Bruijn
2020-11-18 19:48 ` [patch V4 4/8] sched: Make migrate_disable/enable() independent of RT Thomas Gleixner
2020-11-19  9:38   ` Mel Gorman
2020-11-19 11:14     ` Peter Zijlstra
2020-11-19 12:14       ` Mel Gorman
2020-11-19 14:17         ` Steven Rostedt
2020-11-19 17:23       ` Linus Torvalds
2020-11-19 18:28         ` Peter Zijlstra
2020-11-20  1:33           ` Thomas Gleixner
2020-11-20  9:29             ` Peter Zijlstra
2020-11-22 23:16               ` Andy Lutomirski
2020-11-23 21:15                 ` Thomas Gleixner
2020-11-23 21:25                   ` Thomas Gleixner
2020-11-23 22:07                     ` Andy Lutomirski
2020-11-23 23:10                       ` Thomas Gleixner
2020-11-24 10:29   ` [tip: sched/core] " tip-bot2 for Thomas Gleixner
2020-11-18 19:48 ` [patch V4 5/8] sched: highmem: Store local kmaps in task struct Thomas Gleixner
2020-11-19 11:33   ` Peter Zijlstra
2020-11-19 11:51   ` Peter Zijlstra
2020-11-19 12:12     ` Peter Zijlstra
2020-11-19 14:11       ` Thomas Gleixner
2020-11-24 14:20   ` [tip: core/mm] " tip-bot2 for Thomas Gleixner
2020-11-18 19:48 ` [patch V4 6/8] mm/highmem: Provide kmap_local* Thomas Gleixner
2020-11-24 14:20   ` [tip: core/mm] " tip-bot2 for Thomas Gleixner
2020-11-18 19:48 ` [patch V4 7/8] io-mapping: Provide iomap_local variant Thomas Gleixner
2020-11-24 14:20   ` [tip: core/mm] " tip-bot2 for Thomas Gleixner
2020-11-18 19:48 ` [patch V4 8/8] x86/crashdump/32: Simplify copy_oldmem_page() Thomas Gleixner
2020-11-24 14:20   ` [tip: core/mm] " tip-bot2 for Thomas Gleixner
2020-11-24  8:03 ` [patch V4 0/8] mm/highmem: Preemptible variant of kmap_atomic & friends Peter Zijlstra

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=20201118194838.753436396@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=daniel@ffwll.ch \
    --cc=dietmar.eggemann@arm.com \
    --cc=hch@lst.de \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    --cc=torvalds@linuxfoundation.org \
    --cc=vincent.guittot@linaro.org \
    --cc=willy@infradead.org \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).