Merge 6e17c6de3d ("Merge tag 'mm-stable-2023-06-24-19-15' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 6.5-rc1 Change-Id: Ia13992c4a055b9c1ea2209a11834fd1393d06647 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -670,7 +670,7 @@ Description: Preferred MTE tag checking mode
|
||||
"async" Prefer asynchronous mode
|
||||
================ ==============================================
|
||||
|
||||
See also: Documentation/arm64/memory-tagging-extension.rst
|
||||
See also: Documentation/arch/arm64/memory-tagging-extension.rst
|
||||
|
||||
What: /sys/devices/system/cpu/nohz_full
|
||||
Date: Apr 2015
|
||||
|
||||
@@ -297,7 +297,7 @@ Lock order is as follows::
|
||||
|
||||
Page lock (PG_locked bit of page->flags)
|
||||
mm->page_table_lock or split pte_lock
|
||||
lock_page_memcg (memcg->move_lock)
|
||||
folio_memcg_lock (memcg->move_lock)
|
||||
mapping->i_pages lock
|
||||
lruvec->lru_lock.
|
||||
|
||||
|
||||
@@ -1580,6 +1580,13 @@ PAGE_SIZE multiple when read back.
|
||||
|
||||
Healthy workloads are not expected to reach this limit.
|
||||
|
||||
memory.swap.peak
|
||||
A read-only single value file which exists on non-root
|
||||
cgroups.
|
||||
|
||||
The max swap usage recorded for the cgroup and its
|
||||
descendants since the creation of the cgroup.
|
||||
|
||||
memory.swap.max
|
||||
A read-write single value file which exists on non-root
|
||||
cgroups. The default is "max".
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
EL0 is indicated by /sys/devices/system/cpu/aarch32_el0
|
||||
and hot-unplug operations may be restricted.
|
||||
|
||||
See Documentation/arm64/asymmetric-32bit.rst for more
|
||||
See Documentation/arch/arm64/asymmetric-32bit.rst for more
|
||||
information.
|
||||
|
||||
amd_iommu= [HW,X86-64]
|
||||
|
||||
@@ -119,9 +119,9 @@ set size has chronologically changed.::
|
||||
Data Access Pattern Aware Memory Management
|
||||
===========================================
|
||||
|
||||
Below three commands make every memory region of size >=4K that doesn't
|
||||
accessed for >=60 seconds in your workload to be swapped out. ::
|
||||
Below command makes every memory region of size >=4K that has not accessed for
|
||||
>=60 seconds in your workload to be swapped out. ::
|
||||
|
||||
$ echo "#min-size max-size min-acc max-acc min-age max-age action" > test_scheme
|
||||
$ echo "4K max 0 0 60s max pageout" >> test_scheme
|
||||
$ damo schemes -c test_scheme <pid of your workload>
|
||||
$ sudo damo schemes --damos_access_rate 0 0 --damos_sz_region 4K max \
|
||||
--damos_age 60s max --damos_action pageout \
|
||||
<pid of your workload>
|
||||
|
||||
@@ -10,9 +10,8 @@ DAMON provides below interfaces for different users.
|
||||
`This <https://github.com/awslabs/damo>`_ is for privileged people such as
|
||||
system administrators who want a just-working human-friendly interface.
|
||||
Using this, users can use the DAMON’s major features in a human-friendly way.
|
||||
It may not be highly tuned for special cases, though. It supports both
|
||||
virtual and physical address spaces monitoring. For more detail, please
|
||||
refer to its `usage document
|
||||
It may not be highly tuned for special cases, though. For more detail,
|
||||
please refer to its `usage document
|
||||
<https://github.com/awslabs/damo/blob/next/USAGE.md>`_.
|
||||
- *sysfs interface.*
|
||||
:ref:`This <sysfs_interface>` is for privileged user space programmers who
|
||||
@@ -20,11 +19,7 @@ DAMON provides below interfaces for different users.
|
||||
features by reading from and writing to special sysfs files. Therefore,
|
||||
you can write and use your personalized DAMON sysfs wrapper programs that
|
||||
reads/writes the sysfs files instead of you. The `DAMON user space tool
|
||||
<https://github.com/awslabs/damo>`_ is one example of such programs. It
|
||||
supports both virtual and physical address spaces monitoring. Note that this
|
||||
interface provides only simple :ref:`statistics <damos_stats>` for the
|
||||
monitoring results. For detailed monitoring results, DAMON provides a
|
||||
:ref:`tracepoint <tracepoint>`.
|
||||
<https://github.com/awslabs/damo>`_ is one example of such programs.
|
||||
- *debugfs interface. (DEPRECATED!)*
|
||||
:ref:`This <debugfs_interface>` is almost identical to :ref:`sysfs interface
|
||||
<sysfs_interface>`. This is deprecated, so users should move to the
|
||||
@@ -139,7 +134,7 @@ scheme of the kdamond. Writing ``clear_schemes_tried_regions`` to ``state``
|
||||
file clears the DAMON-based operating scheme action tried regions directory for
|
||||
each DAMON-based operation scheme of the kdamond. For details of the
|
||||
DAMON-based operation scheme action tried regions directory, please refer to
|
||||
:ref:tried_regions section <sysfs_schemes_tried_regions>`.
|
||||
:ref:`tried_regions section <sysfs_schemes_tried_regions>`.
|
||||
|
||||
If the state is ``on``, reading ``pid`` shows the pid of the kdamond thread.
|
||||
|
||||
@@ -259,12 +254,9 @@ be equal or smaller than ``start`` of directory ``N+1``.
|
||||
contexts/<N>/schemes/
|
||||
---------------------
|
||||
|
||||
For usual DAMON-based data access aware memory management optimizations, users
|
||||
would normally want the system to apply a memory management action to a memory
|
||||
region of a specific access pattern. DAMON receives such formalized operation
|
||||
schemes from the user and applies those to the target memory regions. Users
|
||||
can get and set the schemes by reading from and writing to files under this
|
||||
directory.
|
||||
The directory for DAMON-based Operation Schemes (:ref:`DAMOS
|
||||
<damon_design_damos>`). Users can get and set the schemes by reading from and
|
||||
writing to files under this directory.
|
||||
|
||||
In the beginning, this directory has only one file, ``nr_schemes``. Writing a
|
||||
number (``N``) to the file creates the number of child directories named ``0``
|
||||
@@ -277,12 +269,12 @@ In each scheme directory, five directories (``access_pattern``, ``quotas``,
|
||||
``watermarks``, ``filters``, ``stats``, and ``tried_regions``) and one file
|
||||
(``action``) exist.
|
||||
|
||||
The ``action`` file is for setting and getting what action you want to apply to
|
||||
memory regions having specific access pattern of the interest. The keywords
|
||||
that can be written to and read from the file and their meaning are as below.
|
||||
The ``action`` file is for setting and getting the scheme's :ref:`action
|
||||
<damon_design_damos_action>`. The keywords that can be written to and read
|
||||
from the file and their meaning are as below.
|
||||
|
||||
Note that support of each action depends on the running DAMON operations set
|
||||
`implementation <sysfs_contexts>`.
|
||||
:ref:`implementation <sysfs_contexts>`.
|
||||
|
||||
- ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``.
|
||||
Supported by ``vaddr`` and ``fvaddr`` operations set.
|
||||
@@ -304,32 +296,21 @@ Note that support of each action depends on the running DAMON operations set
|
||||
schemes/<N>/access_pattern/
|
||||
---------------------------
|
||||
|
||||
The target access pattern of each DAMON-based operation scheme is constructed
|
||||
with three ranges including the size of the region in bytes, number of
|
||||
monitored accesses per aggregate interval, and number of aggregated intervals
|
||||
for the age of the region.
|
||||
The directory for the target access :ref:`pattern
|
||||
<damon_design_damos_access_pattern>` of the given DAMON-based operation scheme.
|
||||
|
||||
Under the ``access_pattern`` directory, three directories (``sz``,
|
||||
``nr_accesses``, and ``age``) each having two files (``min`` and ``max``)
|
||||
exist. You can set and get the access pattern for the given scheme by writing
|
||||
to and reading from the ``min`` and ``max`` files under ``sz``,
|
||||
``nr_accesses``, and ``age`` directories, respectively.
|
||||
``nr_accesses``, and ``age`` directories, respectively. Note that the ``min``
|
||||
and the ``max`` form a closed interval.
|
||||
|
||||
schemes/<N>/quotas/
|
||||
-------------------
|
||||
|
||||
Optimal ``target access pattern`` for each ``action`` is workload dependent, so
|
||||
not easy to find. Worse yet, setting a scheme of some action too aggressive
|
||||
can cause severe overhead. To avoid such overhead, users can limit time and
|
||||
size quota for each scheme. In detail, users can ask DAMON to try to use only
|
||||
up to specific time (``time quota``) for applying the action, and to apply the
|
||||
action to only up to specific amount (``size quota``) of memory regions having
|
||||
the target access pattern within a given time interval (``reset interval``).
|
||||
|
||||
When the quota limit is expected to be exceeded, DAMON prioritizes found memory
|
||||
regions of the ``target access pattern`` based on their size, access frequency,
|
||||
and age. For personalized prioritization, users can set the weights for the
|
||||
three properties.
|
||||
The directory for the :ref:`quotas <damon_design_damos_quotas>` of the given
|
||||
DAMON-based operation scheme.
|
||||
|
||||
Under ``quotas`` directory, three files (``ms``, ``bytes``,
|
||||
``reset_interval_ms``) and one directory (``weights``) having three files
|
||||
@@ -337,23 +318,26 @@ Under ``quotas`` directory, three files (``ms``, ``bytes``,
|
||||
|
||||
You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, and
|
||||
``reset interval`` in milliseconds by writing the values to the three files,
|
||||
respectively. You can also set the prioritization weights for size, access
|
||||
frequency, and age in per-thousand unit by writing the values to the three
|
||||
files under the ``weights`` directory.
|
||||
respectively. Then, DAMON tries to use only up to ``time quota`` milliseconds
|
||||
for applying the ``action`` to memory regions of the ``access_pattern``, and to
|
||||
apply the action to only up to ``bytes`` bytes of memory regions within the
|
||||
``reset_interval_ms``. Setting both ``ms`` and ``bytes`` zero disables the
|
||||
quota limits.
|
||||
|
||||
You can also set the :ref:`prioritization weights
|
||||
<damon_design_damos_quotas_prioritization>` for size, access frequency, and age
|
||||
in per-thousand unit by writing the values to the three files under the
|
||||
``weights`` directory.
|
||||
|
||||
schemes/<N>/watermarks/
|
||||
-----------------------
|
||||
|
||||
To allow easy activation and deactivation of each scheme based on system
|
||||
status, DAMON provides a feature called watermarks. The feature receives five
|
||||
values called ``metric``, ``interval``, ``high``, ``mid``, and ``low``. The
|
||||
``metric`` is the system metric such as free memory ratio that can be measured.
|
||||
If the metric value of the system is higher than the value in ``high`` or lower
|
||||
than ``low`` at the memoent, the scheme is deactivated. If the value is lower
|
||||
than ``mid``, the scheme is activated.
|
||||
The directory for the :ref:`watermarks <damon_design_damos_watermarks>` of the
|
||||
given DAMON-based operation scheme.
|
||||
|
||||
Under the watermarks directory, five files (``metric``, ``interval_us``,
|
||||
``high``, ``mid``, and ``low``) for setting each value exist. You can set and
|
||||
``high``, ``mid``, and ``low``) for setting the metric, the time interval
|
||||
between check of the metric, and the three watermarks exist. You can set and
|
||||
get the five values by writing to the files, respectively.
|
||||
|
||||
Keywords and meanings of those that can be written to the ``metric`` file are
|
||||
@@ -367,12 +351,8 @@ The ``interval`` should written in microseconds unit.
|
||||
schemes/<N>/filters/
|
||||
--------------------
|
||||
|
||||
Users could know something more than the kernel for specific types of memory.
|
||||
In the case, users could do their own management for the memory and hence
|
||||
doesn't want DAMOS bothers that. Users could limit DAMOS by setting the access
|
||||
pattern of the scheme and/or the monitoring regions for the purpose, but that
|
||||
can be inefficient in some cases. In such cases, users could set non-access
|
||||
pattern driven filters using files in this directory.
|
||||
The directory for the :ref:`filters <damon_design_damos_filters>` of the given
|
||||
DAMON-based operation scheme.
|
||||
|
||||
In the beginning, this directory has only one file, ``nr_filters``. Writing a
|
||||
number (``N``) to the file creates the number of child directories named ``0``
|
||||
@@ -432,13 +412,17 @@ starting from ``0`` under this directory. Each directory contains files
|
||||
exposing detailed information about each of the memory region that the
|
||||
corresponding scheme's ``action`` has tried to be applied under this directory,
|
||||
during next :ref:`aggregation interval <sysfs_monitoring_attrs>`. The
|
||||
information includes address range, ``nr_accesses``, , and ``age`` of the
|
||||
region.
|
||||
information includes address range, ``nr_accesses``, and ``age`` of the region.
|
||||
|
||||
The directories will be removed when another special keyword,
|
||||
``clear_schemes_tried_regions``, is written to the relevant
|
||||
``kdamonds/<N>/state`` file.
|
||||
|
||||
The expected usage of this directory is investigations of schemes' behaviors,
|
||||
and query-like efficient data access monitoring results retrievals. For the
|
||||
latter use case, in particular, users can set the ``action`` as ``stat`` and
|
||||
set the ``access pattern`` as their interested pattern that they want to query.
|
||||
|
||||
tried_regions/<N>/
|
||||
------------------
|
||||
|
||||
@@ -600,15 +584,10 @@ update.
|
||||
Schemes
|
||||
-------
|
||||
|
||||
For usual DAMON-based data access aware memory management optimizations, users
|
||||
would simply want the system to apply a memory management action to a memory
|
||||
region of a specific access pattern. DAMON receives such formalized operation
|
||||
schemes from the user and applies those to the target processes.
|
||||
|
||||
Users can get and set the schemes by reading from and writing to ``schemes``
|
||||
debugfs file. Reading the file also shows the statistics of each scheme. To
|
||||
the file, each of the schemes should be represented in each line in below
|
||||
form::
|
||||
Users can get and set the DAMON-based operation :ref:`schemes
|
||||
<damon_design_damos>` by reading from and writing to ``schemes`` debugfs file.
|
||||
Reading the file also shows the statistics of each scheme. To the file, each
|
||||
of the schemes should be represented in each line in below form::
|
||||
|
||||
<target access pattern> <action> <quota> <watermarks>
|
||||
|
||||
@@ -617,8 +596,9 @@ You can disable schemes by simply writing an empty string to the file.
|
||||
Target Access Pattern
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``<target access pattern>`` is constructed with three ranges in below
|
||||
form::
|
||||
The target access :ref:`pattern <damon_design_damos_access_pattern>` of the
|
||||
scheme. The ``<target access pattern>`` is constructed with three ranges in
|
||||
below form::
|
||||
|
||||
min-size max-size min-acc max-acc min-age max-age
|
||||
|
||||
@@ -631,9 +611,9 @@ closed interval.
|
||||
Action
|
||||
~~~~~~
|
||||
|
||||
The ``<action>`` is a predefined integer for memory management actions, which
|
||||
DAMON will apply to the regions having the target access pattern. The
|
||||
supported numbers and their meanings are as below.
|
||||
The ``<action>`` is a predefined integer for memory management :ref:`actions
|
||||
<damon_design_damos_action>`. The supported numbers and their meanings are as
|
||||
below.
|
||||
|
||||
- 0: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Ignored if
|
||||
``target`` is ``paddr``.
|
||||
@@ -649,10 +629,8 @@ supported numbers and their meanings are as below.
|
||||
Quota
|
||||
~~~~~
|
||||
|
||||
Optimal ``target access pattern`` for each ``action`` is workload dependent, so
|
||||
not easy to find. Worse yet, setting a scheme of some action too aggressive
|
||||
can cause severe overhead. To avoid such overhead, users can limit time and
|
||||
size quota for the scheme via the ``<quota>`` in below form::
|
||||
Users can set the :ref:`quotas <damon_design_damos_quotas>` of the given scheme
|
||||
via the ``<quota>`` in below form::
|
||||
|
||||
<ms> <sz> <reset interval> <priority weights>
|
||||
|
||||
@@ -662,19 +640,17 @@ the action to memory regions of the ``target access pattern`` within the
|
||||
``<sz>`` bytes of memory regions within the ``<reset interval>``. Setting both
|
||||
``<ms>`` and ``<sz>`` zero disables the quota limits.
|
||||
|
||||
When the quota limit is expected to be exceeded, DAMON prioritizes found memory
|
||||
regions of the ``target access pattern`` based on their size, access frequency,
|
||||
and age. For personalized prioritization, users can set the weights for the
|
||||
three properties in ``<priority weights>`` in below form::
|
||||
For the :ref:`prioritization <damon_design_damos_quotas_prioritization>`, users
|
||||
can set the weights for the three properties in ``<priority weights>`` in below
|
||||
form::
|
||||
|
||||
<size weight> <access frequency weight> <age weight>
|
||||
|
||||
Watermarks
|
||||
~~~~~~~~~~
|
||||
|
||||
Some schemes would need to run based on current value of the system's specific
|
||||
metrics like free memory ratio. For such cases, users can specify watermarks
|
||||
for the condition.::
|
||||
Users can specify :ref:`watermarks <damon_design_damos_watermarks>` of the
|
||||
given scheme via ``<watermarks>`` in below form::
|
||||
|
||||
<metric> <check interval> <high mark> <middle mark> <low mark>
|
||||
|
||||
@@ -797,10 +773,12 @@ root directory only.
|
||||
Tracepoint for Monitoring Results
|
||||
=================================
|
||||
|
||||
DAMON provides the monitoring results via a tracepoint,
|
||||
``damon:damon_aggregated``. While the monitoring is turned on, you could
|
||||
record the tracepoint events and show results using tracepoint supporting tools
|
||||
like ``perf``. For example::
|
||||
Users can get the monitoring results via the :ref:`tried_regions
|
||||
<sysfs_schemes_tried_regions>` or a tracepoint, ``damon:damon_aggregated``.
|
||||
While the tried regions directory is useful for getting a snapshot, the
|
||||
tracepoint is useful for getting a full record of the results. While the
|
||||
monitoring is turned on, you could record the tracepoint events and show
|
||||
results using tracepoint supporting tools like ``perf``. For example::
|
||||
|
||||
# echo on > monitor_on
|
||||
# perf record -e damon:damon_aggregated &
|
||||
|
||||
@@ -949,7 +949,7 @@ user space can read performance monitor counter registers directly.
|
||||
|
||||
The default value is 0 (access disabled).
|
||||
|
||||
See Documentation/arm64/perf.rst for more information.
|
||||
See Documentation/arch/arm64/perf.rst for more information.
|
||||
|
||||
|
||||
pid_max
|
||||
|
||||
@@ -540,7 +540,7 @@ ACPI_OS_NAME
|
||||
ACPI Objects
|
||||
------------
|
||||
Detailed expectations for ACPI tables and object are listed in the file
|
||||
Documentation/arm64/acpi_object_usage.rst.
|
||||
Documentation/arch/arm64/acpi_object_usage.rst.
|
||||
|
||||
|
||||
References
|
||||
@@ -102,7 +102,7 @@ HWCAP_ASIMDHP
|
||||
|
||||
HWCAP_CPUID
|
||||
EL0 access to certain ID registers is available, to the extent
|
||||
described by Documentation/arm64/cpu-feature-registers.rst.
|
||||
described by Documentation/arch/arm64/cpu-feature-registers.rst.
|
||||
|
||||
These ID registers may imply the availability of features.
|
||||
|
||||
@@ -163,12 +163,12 @@ HWCAP_SB
|
||||
HWCAP_PACA
|
||||
Functionality implied by ID_AA64ISAR1_EL1.APA == 0b0001 or
|
||||
ID_AA64ISAR1_EL1.API == 0b0001, as described by
|
||||
Documentation/arm64/pointer-authentication.rst.
|
||||
Documentation/arch/arm64/pointer-authentication.rst.
|
||||
|
||||
HWCAP_PACG
|
||||
Functionality implied by ID_AA64ISAR1_EL1.GPA == 0b0001 or
|
||||
ID_AA64ISAR1_EL1.GPI == 0b0001, as described by
|
||||
Documentation/arm64/pointer-authentication.rst.
|
||||
Documentation/arch/arm64/pointer-authentication.rst.
|
||||
|
||||
HWCAP2_DCPODP
|
||||
Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0010.
|
||||
@@ -226,7 +226,7 @@ HWCAP2_BTI
|
||||
|
||||
HWCAP2_MTE
|
||||
Functionality implied by ID_AA64PFR1_EL1.MTE == 0b0010, as described
|
||||
by Documentation/arm64/memory-tagging-extension.rst.
|
||||
by Documentation/arch/arm64/memory-tagging-extension.rst.
|
||||
|
||||
HWCAP2_ECV
|
||||
Functionality implied by ID_AA64MMFR0_EL1.ECV == 0b0001.
|
||||
@@ -239,11 +239,11 @@ HWCAP2_RPRES
|
||||
|
||||
HWCAP2_MTE3
|
||||
Functionality implied by ID_AA64PFR1_EL1.MTE == 0b0011, as described
|
||||
by Documentation/arm64/memory-tagging-extension.rst.
|
||||
by Documentation/arch/arm64/memory-tagging-extension.rst.
|
||||
|
||||
HWCAP2_SME
|
||||
Functionality implied by ID_AA64PFR1_EL1.SME == 0b0001, as described
|
||||
by Documentation/arm64/sme.rst.
|
||||
by Documentation/arch/arm64/sme.rst.
|
||||
|
||||
HWCAP2_SME_I16I64
|
||||
Functionality implied by ID_AA64SMFR0_EL1.I16I64 == 0b1111.
|
||||
+1
-1
@@ -221,7 +221,7 @@ programs should not retry in case of a non-zero system call return.
|
||||
``NT_ARM_TAGGED_ADDR_CTRL`` allow ``ptrace()`` access to the tagged
|
||||
address ABI control and MTE configuration of a process as per the
|
||||
``prctl()`` options described in
|
||||
Documentation/arm64/tagged-address-abi.rst and above. The corresponding
|
||||
Documentation/arch/arm64/tagged-address-abi.rst and above. The corresponding
|
||||
``regset`` is 1 element of 8 bytes (``sizeof(long))``).
|
||||
|
||||
Core dump support
|
||||
@@ -465,4 +465,4 @@ References
|
||||
[2] arch/arm64/include/uapi/asm/ptrace.h
|
||||
AArch64 Linux ptrace ABI definitions
|
||||
|
||||
[3] Documentation/arm64/cpu-feature-registers.rst
|
||||
[3] Documentation/arch/arm64/cpu-feature-registers.rst
|
||||
@@ -606,7 +606,7 @@ References
|
||||
[2] arch/arm64/include/uapi/asm/ptrace.h
|
||||
AArch64 Linux ptrace ABI definitions
|
||||
|
||||
[3] Documentation/arm64/cpu-feature-registers.rst
|
||||
[3] Documentation/arch/arm64/cpu-feature-registers.rst
|
||||
|
||||
[4] ARM IHI0055C
|
||||
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055c/IHI0055C_beta_aapcs64.pdf
|
||||
+1
-1
@@ -107,7 +107,7 @@ following behaviours are guaranteed:
|
||||
|
||||
|
||||
A definition of the meaning of tagged pointers on AArch64 can be found
|
||||
in Documentation/arm64/tagged-pointers.rst.
|
||||
in Documentation/arch/arm64/tagged-pointers.rst.
|
||||
|
||||
3. AArch64 Tagged Address ABI Exceptions
|
||||
-----------------------------------------
|
||||
+1
-1
@@ -22,7 +22,7 @@ Passing tagged addresses to the kernel
|
||||
All interpretation of userspace memory addresses by the kernel assumes
|
||||
an address tag of 0x00, unless the application enables the AArch64
|
||||
Tagged Address ABI explicitly
|
||||
(Documentation/arm64/tagged-address-abi.rst).
|
||||
(Documentation/arch/arm64/tagged-address-abi.rst).
|
||||
|
||||
This includes, but is not limited to, addresses found in:
|
||||
|
||||
@@ -11,7 +11,7 @@ implementation.
|
||||
|
||||
arc/index
|
||||
arm/index
|
||||
../arm64/index
|
||||
arm64/index
|
||||
ia64/index
|
||||
../loongarch/index
|
||||
m68k/index
|
||||
|
||||
@@ -107,9 +107,12 @@ effectively disables ``panic_on_warn`` for KASAN reports.
|
||||
Alternatively, independent of ``panic_on_warn``, the ``kasan.fault=`` boot
|
||||
parameter can be used to control panic and reporting behaviour:
|
||||
|
||||
- ``kasan.fault=report`` or ``=panic`` controls whether to only print a KASAN
|
||||
report or also panic the kernel (default: ``report``). The panic happens even
|
||||
if ``kasan_multi_shot`` is enabled.
|
||||
- ``kasan.fault=report``, ``=panic``, or ``=panic_on_write`` controls whether
|
||||
to only print a KASAN report, panic the kernel, or panic the kernel on
|
||||
invalid writes only (default: ``report``). The panic happens even if
|
||||
``kasan_multi_shot`` is enabled. Note that when using asynchronous mode of
|
||||
Hardware Tag-Based KASAN, ``kasan.fault=panic_on_write`` always panics on
|
||||
asynchronously checked accesses (including reads).
|
||||
|
||||
Software and Hardware Tag-Based KASAN modes (see the section about various
|
||||
modes below) support altering stack trace collection behavior:
|
||||
|
||||
@@ -36,6 +36,7 @@ Running the selftests (hotplug tests are run in limited mode)
|
||||
|
||||
To build the tests::
|
||||
|
||||
$ make headers
|
||||
$ make -C tools/testing/selftests
|
||||
|
||||
To run the tests::
|
||||
|
||||
@@ -259,7 +259,7 @@ description: |+
|
||||
http://infocenter.arm.com/help/index.jsp
|
||||
|
||||
[5] ARM Linux Kernel documentation - Booting AArch64 Linux
|
||||
Documentation/arm64/booting.rst
|
||||
Documentation/arch/arm64/booting.rst
|
||||
|
||||
[6] RISC-V Linux Kernel documentation - CPUs bindings
|
||||
Documentation/devicetree/bindings/riscv/cpus.yaml
|
||||
|
||||
@@ -4,31 +4,55 @@
|
||||
Design
|
||||
======
|
||||
|
||||
Configurable Layers
|
||||
===================
|
||||
|
||||
DAMON provides data access monitoring functionality while making the accuracy
|
||||
and the overhead controllable. The fundamental access monitorings require
|
||||
primitives that dependent on and optimized for the target address space. On
|
||||
the other hand, the accuracy and overhead tradeoff mechanism, which is the core
|
||||
of DAMON, is in the pure logic space. DAMON separates the two parts in
|
||||
different layers and defines its interface to allow various low level
|
||||
primitives implementations configurable with the core logic. We call the low
|
||||
level primitives implementations monitoring operations.
|
||||
Overall Architecture
|
||||
====================
|
||||
|
||||
Due to this separated design and the configurable interface, users can extend
|
||||
DAMON for any address space by configuring the core logics with appropriate
|
||||
monitoring operations. If appropriate one is not provided, users can implement
|
||||
the operations on their own.
|
||||
DAMON subsystem is configured with three layers including
|
||||
|
||||
- Operations Set: Implements fundamental operations for DAMON that depends on
|
||||
the given monitoring target address-space and available set of
|
||||
software/hardware primitives,
|
||||
- Core: Implements core logics including monitoring overhead/accurach control
|
||||
and access-aware system operations on top of the operations set layer, and
|
||||
- Modules: Implements kernel modules for various purposes that provides
|
||||
interfaces for the user space, on top of the core layer.
|
||||
|
||||
|
||||
Configurable Operations Set
|
||||
---------------------------
|
||||
|
||||
For data access monitoring and additional low level work, DAMON needs a set of
|
||||
implementations for specific operations that are dependent on and optimized for
|
||||
the given target address space. On the other hand, the accuracy and overhead
|
||||
tradeoff mechanism, which is the core logic of DAMON, is in the pure logic
|
||||
space. DAMON separates the two parts in different layers, namely DAMON
|
||||
Operations Set and DAMON Core Logics Layers, respectively. It further defines
|
||||
the interface between the layers to allow various operations sets to be
|
||||
configured with the core logic.
|
||||
|
||||
Due to this design, users can extend DAMON for any address space by configuring
|
||||
the core logic to use the appropriate operations set. If any appropriate set
|
||||
is unavailable, users can implement one on their own.
|
||||
|
||||
For example, physical memory, virtual memory, swap space, those for specific
|
||||
processes, NUMA nodes, files, and backing memory devices would be supportable.
|
||||
Also, if some architectures or devices support special optimized access check
|
||||
primitives, those will be easily configurable.
|
||||
Also, if some architectures or devices supporting special optimized access
|
||||
check primitives, those will be easily configurable.
|
||||
|
||||
|
||||
Reference Implementations of Address Space Specific Monitoring Operations
|
||||
=========================================================================
|
||||
Programmable Modules
|
||||
--------------------
|
||||
|
||||
Core layer of DAMON is implemented as a framework, and exposes its application
|
||||
programming interface to all kernel space components such as subsystems and
|
||||
modules. For common use cases of DAMON, DAMON subsystem provides kernel
|
||||
modules that built on top of the core layer using the API, which can be easily
|
||||
used by the user space end users.
|
||||
|
||||
|
||||
Operations Set Layer
|
||||
====================
|
||||
|
||||
The monitoring operations are defined in two parts:
|
||||
|
||||
@@ -90,8 +114,12 @@ conflict with the reclaim logic using ``PG_idle`` and ``PG_young`` page flags,
|
||||
as Idle page tracking does.
|
||||
|
||||
|
||||
Address Space Independent Core Mechanisms
|
||||
=========================================
|
||||
Core Logics
|
||||
===========
|
||||
|
||||
|
||||
Monitoring
|
||||
----------
|
||||
|
||||
Below four sections describe each of the DAMON core mechanisms and the five
|
||||
monitoring attributes, ``sampling interval``, ``aggregation interval``,
|
||||
@@ -100,7 +128,7 @@ regions``.
|
||||
|
||||
|
||||
Access Frequency Monitoring
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The output of DAMON says what pages are how frequently accessed for a given
|
||||
duration. The resolution of the access frequency is controlled by setting
|
||||
@@ -127,7 +155,7 @@ size of the target workload grows.
|
||||
|
||||
|
||||
Region Based Sampling
|
||||
---------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To avoid the unbounded increase of the overhead, DAMON groups adjacent pages
|
||||
that assumed to have the same access frequencies into a region. As long as the
|
||||
@@ -144,7 +172,7 @@ assumption is not guaranteed.
|
||||
|
||||
|
||||
Adaptive Regions Adjustment
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Even somehow the initial monitoring target regions are well constructed to
|
||||
fulfill the assumption (pages in same region have similar access frequencies),
|
||||
@@ -162,8 +190,22 @@ In this way, DAMON provides its best-effort quality and minimal overhead while
|
||||
keeping the bounds users set for their trade-off.
|
||||
|
||||
|
||||
Age Tracking
|
||||
~~~~~~~~~~~~
|
||||
|
||||
By analyzing the monitoring results, users can also find how long the current
|
||||
access pattern of a region has maintained. That could be used for good
|
||||
understanding of the access pattern. For example, page placement algorithm
|
||||
utilizing both the frequency and the recency could be implemented using that.
|
||||
To make such access pattern maintained period analysis easier, DAMON maintains
|
||||
yet another counter called ``age`` in each region. For each ``aggregation
|
||||
interval``, DAMON checks if the region's size and access frequency
|
||||
(``nr_accesses``) has significantly changed. If so, the counter is reset to
|
||||
zero. Otherwise, the counter is increased.
|
||||
|
||||
|
||||
Dynamic Target Space Updates Handling
|
||||
-------------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The monitoring target address range could dynamically changed. For example,
|
||||
virtual memory could be dynamically mapped and unmapped. Physical memory could
|
||||
@@ -174,3 +216,246 @@ monitoring operations to check dynamic changes including memory mapping changes
|
||||
and applies it to monitoring operations-related data structures such as the
|
||||
abstracted monitoring target memory area only for each of a user-specified time
|
||||
interval (``update interval``).
|
||||
|
||||
|
||||
.. _damon_design_damos:
|
||||
|
||||
Operation Schemes
|
||||
-----------------
|
||||
|
||||
One common purpose of data access monitoring is access-aware system efficiency
|
||||
optimizations. For example,
|
||||
|
||||
paging out memory regions that are not accessed for more than two minutes
|
||||
|
||||
or
|
||||
|
||||
using THP for memory regions that are larger than 2 MiB and showing a high
|
||||
access frequency for more than one minute.
|
||||
|
||||
One straightforward approach for such schemes would be profile-guided
|
||||
optimizations. That is, getting data access monitoring results of the
|
||||
workloads or the system using DAMON, finding memory regions of special
|
||||
characteristics by profiling the monitoring results, and making system
|
||||
operation changes for the regions. The changes could be made by modifying or
|
||||
providing advice to the software (the application and/or the kernel), or
|
||||
reconfiguring the hardware. Both offline and online approaches could be
|
||||
available.
|
||||
|
||||
Among those, providing advice to the kernel at runtime would be flexible and
|
||||
effective, and therefore widely be used. However, implementing such schemes
|
||||
could impose unnecessary redundancy and inefficiency. The profiling could be
|
||||
redundant if the type of interest is common. Exchanging the information
|
||||
including monitoring results and operation advice between kernel and user
|
||||
spaces could be inefficient.
|
||||
|
||||
To allow users to reduce such redundancy and inefficiencies by offloading the
|
||||
works, DAMON provides a feature called Data Access Monitoring-based Operation
|
||||
Schemes (DAMOS). It lets users specify their desired schemes at a high
|
||||
level. For such specifications, DAMON starts monitoring, finds regions having
|
||||
the access pattern of interest, and applies the user-desired operation actions
|
||||
to the regions as soon as found.
|
||||
|
||||
|
||||
.. _damon_design_damos_action:
|
||||
|
||||
Operation Action
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
The management action that the users desire to apply to the regions of their
|
||||
interest. For example, paging out, prioritizing for next reclamation victim
|
||||
selection, advising ``khugepaged`` to collapse or split, or doing nothing but
|
||||
collecting statistics of the regions.
|
||||
|
||||
The list of supported actions is defined in DAMOS, but the implementation of
|
||||
each action is in the DAMON operations set layer because the implementation
|
||||
normally depends on the monitoring target address space. For example, the code
|
||||
for paging specific virtual address ranges out would be different from that for
|
||||
physical address ranges. And the monitoring operations implementation sets are
|
||||
not mandated to support all actions of the list. Hence, the availability of
|
||||
specific DAMOS action depends on what operations set is selected to be used
|
||||
together.
|
||||
|
||||
Applying an action to a region is considered as changing the region's
|
||||
characteristics. Hence, DAMOS resets the age of regions when an action is
|
||||
applied to those.
|
||||
|
||||
|
||||
.. _damon_design_damos_access_pattern:
|
||||
|
||||
Target Access Pattern
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The access pattern of the schemes' interest. The patterns are constructed with
|
||||
the properties that DAMON's monitoring results provide, specifically the size,
|
||||
the access frequency, and the age. Users can describe their access pattern of
|
||||
interest by setting minimum and maximum values of the three properties. If a
|
||||
region's three properties are in the ranges, DAMOS classifies it as one of the
|
||||
regions that the scheme is having an interest in.
|
||||
|
||||
|
||||
.. _damon_design_damos_quotas:
|
||||
|
||||
Quotas
|
||||
~~~~~~
|
||||
|
||||
DAMOS upper-bound overhead control feature. DAMOS could incur high overhead if
|
||||
the target access pattern is not properly tuned. For example, if a huge memory
|
||||
region having the access pattern of interest is found, applying the scheme's
|
||||
action to all pages of the huge region could consume unacceptably large system
|
||||
resources. Preventing such issues by tuning the access pattern could be
|
||||
challenging, especially if the access patterns of the workloads are highly
|
||||
dynamic.
|
||||
|
||||
To mitigate that situation, DAMOS provides an upper-bound overhead control
|
||||
feature called quotas. It lets users specify an upper limit of time that DAMOS
|
||||
can use for applying the action, and/or a maximum bytes of memory regions that
|
||||
the action can be applied within a user-specified time duration.
|
||||
|
||||
|
||||
.. _damon_design_damos_quotas_prioritization:
|
||||
|
||||
Prioritization
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
A mechanism for making a good decision under the quotas. When the action
|
||||
cannot be applied to all regions of interest due to the quotas, DAMOS
|
||||
prioritizes regions and applies the action to only regions having high enough
|
||||
priorities so that it will not exceed the quotas.
|
||||
|
||||
The prioritization mechanism should be different for each action. For example,
|
||||
rarely accessed (colder) memory regions would be prioritized for page-out
|
||||
scheme action. In contrast, the colder regions would be deprioritized for huge
|
||||
page collapse scheme action. Hence, the prioritization mechanisms for each
|
||||
action are implemented in each DAMON operations set, together with the actions.
|
||||
|
||||
Though the implementation is up to the DAMON operations set, it would be common
|
||||
to calculate the priority using the access pattern properties of the regions.
|
||||
Some users would want the mechanisms to be personalized for their specific
|
||||
case. For example, some users would want the mechanism to weigh the recency
|
||||
(``age``) more than the access frequency (``nr_accesses``). DAMOS allows users
|
||||
to specify the weight of each access pattern property and passes the
|
||||
information to the underlying mechanism. Nevertheless, how and even whether
|
||||
the weight will be respected are up to the underlying prioritization mechanism
|
||||
implementation.
|
||||
|
||||
|
||||
.. _damon_design_damos_watermarks:
|
||||
|
||||
Watermarks
|
||||
~~~~~~~~~~
|
||||
|
||||
Conditional DAMOS (de)activation automation. Users might want DAMOS to run
|
||||
only under certain situations. For example, when a sufficient amount of free
|
||||
memory is guaranteed, running a scheme for proactive reclamation would only
|
||||
consume unnecessary system resources. To avoid such consumption, the user would
|
||||
need to manually monitor some metrics such as free memory ratio, and turn
|
||||
DAMON/DAMOS on or off.
|
||||
|
||||
DAMOS allows users to offload such works using three watermarks. It allows the
|
||||
users to configure the metric of their interest, and three watermark values,
|
||||
namely high, middle, and low. If the value of the metric becomes above the
|
||||
high watermark or below the low watermark, the scheme is deactivated. If the
|
||||
metric becomes below the mid watermark but above the low watermark, the scheme
|
||||
is activated. If all schemes are deactivated by the watermarks, the monitoring
|
||||
is also deactivated. In this case, the DAMON worker thread only periodically
|
||||
checks the watermarks and therefore incurs nearly zero overhead.
|
||||
|
||||
|
||||
.. _damon_design_damos_filters:
|
||||
|
||||
Filters
|
||||
~~~~~~~
|
||||
|
||||
Non-access pattern-based target memory regions filtering. If users run
|
||||
self-written programs or have good profiling tools, they could know something
|
||||
more than the kernel, such as future access patterns or some special
|
||||
requirements for specific types of memory. For example, some users may know
|
||||
only anonymous pages can impact their program's performance. They can also
|
||||
have a list of latency-critical processes.
|
||||
|
||||
To let users optimize DAMOS schemes with such special knowledge, DAMOS provides
|
||||
a feature called DAMOS filters. The feature allows users to set an arbitrary
|
||||
number of filters for each scheme. Each filter specifies the type of target
|
||||
memory, and whether it should exclude the memory of the type (filter-out), or
|
||||
all except the memory of the type (filter-in).
|
||||
|
||||
As of this writing, anonymous page type and memory cgroup type are supported by
|
||||
the feature. Some filter target types can require additional arguments. For
|
||||
example, the memory cgroup filter type asks users to specify the file path of
|
||||
the memory cgroup for the filter. Hence, users can apply specific schemes to
|
||||
only anonymous pages, non-anonymous pages, pages of specific cgroups, all pages
|
||||
excluding those of specific cgroups, and any combination of those.
|
||||
|
||||
|
||||
Application Programming Interface
|
||||
---------------------------------
|
||||
|
||||
The programming interface for kernel space data access-aware applications.
|
||||
DAMON is a framework, so it does nothing by itself. Instead, it only helps
|
||||
other kernel components such as subsystems and modules building their data
|
||||
access-aware applications using DAMON's core features. For this, DAMON exposes
|
||||
its all features to other kernel components via its application programming
|
||||
interface, namely ``include/linux/damon.h``. Please refer to the API
|
||||
:doc:`document </mm/damon/api>` for details of the interface.
|
||||
|
||||
|
||||
Modules
|
||||
=======
|
||||
|
||||
Because the core of DAMON is a framework for kernel components, it doesn't
|
||||
provide any direct interface for the user space. Such interfaces should be
|
||||
implemented by each DAMON API user kernel components, instead. DAMON subsystem
|
||||
itself implements such DAMON API user modules, which are supposed to be used
|
||||
for general purpose DAMON control and special purpose data access-aware system
|
||||
operations, and provides stable application binary interfaces (ABI) for the
|
||||
user space. The user space can build their efficient data access-aware
|
||||
applications using the interfaces.
|
||||
|
||||
|
||||
General Purpose User Interface Modules
|
||||
--------------------------------------
|
||||
|
||||
DAMON modules that provide user space ABIs for general purpose DAMON usage in
|
||||
runtime.
|
||||
|
||||
DAMON user interface modules, namely 'DAMON sysfs interface' and 'DAMON debugfs
|
||||
interface' are DAMON API user kernel modules that provide ABIs to the
|
||||
user-space. Please note that DAMON debugfs interface is currently deprecated.
|
||||
|
||||
Like many other ABIs, the modules create files on sysfs and debugfs, allow
|
||||
users to specify their requests to and get the answers from DAMON by writing to
|
||||
and reading from the files. As a response to such I/O, DAMON user interface
|
||||
modules control DAMON and retrieve the results as user requested via the DAMON
|
||||
API, and return the results to the user-space.
|
||||
|
||||
The ABIs are designed to be used for user space applications development,
|
||||
rather than human beings' fingers. Human users are recommended to use such
|
||||
user space tools. One such Python-written user space tool is available at
|
||||
Github (https://github.com/awslabs/damo), Pypi
|
||||
(https://pypistats.org/packages/damo), and Fedora
|
||||
(https://packages.fedoraproject.org/pkgs/python-damo/damo/).
|
||||
|
||||
Please refer to the ABI :doc:`document </admin-guide/mm/damon/usage>` for
|
||||
details of the interfaces.
|
||||
|
||||
|
||||
Special-Purpose Access-aware Kernel Modules
|
||||
-------------------------------------------
|
||||
|
||||
DAMON modules that provide user space ABI for specific purpose DAMON usage.
|
||||
|
||||
DAMON sysfs/debugfs user interfaces are for full control of all DAMON features
|
||||
in runtime. For each special-purpose system-wide data access-aware system
|
||||
operations such as proactive reclamation or LRU lists balancing, the interfaces
|
||||
could be simplified by removing unnecessary knobs for the specific purpose, and
|
||||
extended for boot-time and even compile time control. Default values of DAMON
|
||||
control parameters for the usage would also need to be optimized for the
|
||||
purpose.
|
||||
|
||||
To support such cases, yet more DAMON API user kernel modules that provide more
|
||||
simple and optimized user space interfaces are available. Currently, two
|
||||
modules for proactive reclamation and LRU lists manipulation are provided. For
|
||||
more detail, please read the usage documents for those
|
||||
(:doc:`/admin-guide/mm/damon/reclaim` and
|
||||
:doc:`/admin-guide/mm/damon/lru_sort`).
|
||||
|
||||
@@ -4,29 +4,6 @@
|
||||
Frequently Asked Questions
|
||||
==========================
|
||||
|
||||
Why a new subsystem, instead of extending perf or other user space tools?
|
||||
=========================================================================
|
||||
|
||||
First, because it needs to be lightweight as much as possible so that it can be
|
||||
used online, any unnecessary overhead such as kernel - user space context
|
||||
switching cost should be avoided. Second, DAMON aims to be used by other
|
||||
programs including the kernel. Therefore, having a dependency on specific
|
||||
tools like perf is not desirable. These are the two biggest reasons why DAMON
|
||||
is implemented in the kernel space.
|
||||
|
||||
|
||||
Can 'idle pages tracking' or 'perf mem' substitute DAMON?
|
||||
=========================================================
|
||||
|
||||
Idle page tracking is a low level primitive for access check of the physical
|
||||
address space. 'perf mem' is similar, though it can use sampling to minimize
|
||||
the overhead. On the other hand, DAMON is a higher-level framework for the
|
||||
monitoring of various address spaces. It is focused on memory management
|
||||
optimization and provides sophisticated accuracy/overhead handling mechanisms.
|
||||
Therefore, 'idle pages tracking' and 'perf mem' could provide a subset of
|
||||
DAMON's output, but cannot substitute DAMON.
|
||||
|
||||
|
||||
Does DAMON support virtual memory only?
|
||||
=======================================
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
DAMON Maintainer Entry Profile
|
||||
==============================
|
||||
|
||||
The DAMON subsystem covers the files that listed in 'DATA ACCESS MONITOR'
|
||||
The DAMON subsystem covers the files that are listed in 'DATA ACCESS MONITOR'
|
||||
section of 'MAINTAINERS' file.
|
||||
|
||||
The mailing lists for the subsystem are damon@lists.linux.dev and
|
||||
@@ -15,7 +15,7 @@ SCM Trees
|
||||
|
||||
There are multiple Linux trees for DAMON development. Patches under
|
||||
development or testing are queued in damon/next [2]_ by the DAMON maintainer.
|
||||
Suffieicntly reviewed patches will be queued in mm-unstable [1]_ by the memory
|
||||
Sufficiently reviewed patches will be queued in mm-unstable [1]_ by the memory
|
||||
management subsystem maintainer. After more sufficient tests, the patches will
|
||||
be queued in mm-stable [3]_ , and finally pull-requested to the mainline by the
|
||||
memory management subsystem maintainer.
|
||||
|
||||
@@ -73,14 +73,13 @@ In kernel use of migrate_pages()
|
||||
It also prevents the swapper or other scans from encountering
|
||||
the page.
|
||||
|
||||
2. We need to have a function of type new_page_t that can be
|
||||
2. We need to have a function of type new_folio_t that can be
|
||||
passed to migrate_pages(). This function should figure out
|
||||
how to allocate the correct new page given the old page.
|
||||
how to allocate the correct new folio given the old folio.
|
||||
|
||||
3. The migrate_pages() function is called which attempts
|
||||
to do the migration. It will call the function to allocate
|
||||
the new page for each page that is considered for
|
||||
moving.
|
||||
the new folio for each folio that is considered for moving.
|
||||
|
||||
How migrate_pages() works
|
||||
=========================
|
||||
|
||||
@@ -14,15 +14,20 @@ tables. Access to higher level tables protected by mm->page_table_lock.
|
||||
There are helpers to lock/unlock a table and other accessor functions:
|
||||
|
||||
- pte_offset_map_lock()
|
||||
maps pte and takes PTE table lock, returns pointer to the taken
|
||||
lock;
|
||||
maps PTE and takes PTE table lock, returns pointer to PTE with
|
||||
pointer to its PTE table lock, or returns NULL if no PTE table;
|
||||
- pte_offset_map_nolock()
|
||||
maps PTE, returns pointer to PTE with pointer to its PTE table
|
||||
lock (not taken), or returns NULL if no PTE table;
|
||||
- pte_offset_map()
|
||||
maps PTE, returns pointer to PTE, or returns NULL if no PTE table;
|
||||
- pte_unmap()
|
||||
unmaps PTE table;
|
||||
- pte_unmap_unlock()
|
||||
unlocks and unmaps PTE table;
|
||||
- pte_alloc_map_lock()
|
||||
allocates PTE table if needed and take the lock, returns pointer
|
||||
to taken lock or NULL if allocation failed;
|
||||
- pte_lockptr()
|
||||
returns pointer to PTE table lock;
|
||||
allocates PTE table if needed and takes its lock, returns pointer to
|
||||
PTE with pointer to its lock, or returns NULL if allocation failed;
|
||||
- pmd_lock()
|
||||
takes PMD table lock, returns pointer to taken lock;
|
||||
- pmd_lockptr()
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
.. include:: ../../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/amu.rst <amu_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/amu.rst <amu_index>`
|
||||
|
||||
Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
Chinese translated version of Documentation/arm64/booting.rst
|
||||
Chinese translated version of Documentation/arch/arm64/booting.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -10,7 +10,7 @@ M: Will Deacon <will.deacon@arm.com>
|
||||
zh_CN: Fu Wei <wefu@redhat.com>
|
||||
C: 55f058e7574c3615dea4615573a19bdb258696c6
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/booting.rst 的中文翻译
|
||||
Documentation/arch/arm64/booting.rst 的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
|
||||
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
.. include:: ../../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/elf_hwcaps.rst <elf_hwcaps_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/elf_hwcaps.rst <elf_hwcaps_index>`
|
||||
|
||||
Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
|
||||
@@ -92,7 +92,7 @@ HWCAP_ASIMDHP
|
||||
ID_AA64PFR0_EL1.AdvSIMD == 0b0001 表示有此功能。
|
||||
|
||||
HWCAP_CPUID
|
||||
根据 Documentation/arm64/cpu-feature-registers.rst 描述,EL0 可以访问
|
||||
根据 Documentation/arch/arm64/cpu-feature-registers.rst 描述,EL0 可以访问
|
||||
某些 ID 寄存器。
|
||||
|
||||
这些 ID 寄存器可能表示功能的可用性。
|
||||
@@ -152,12 +152,12 @@ HWCAP_SB
|
||||
ID_AA64ISAR1_EL1.SB == 0b0001 表示有此功能。
|
||||
|
||||
HWCAP_PACA
|
||||
如 Documentation/arm64/pointer-authentication.rst 所描述,
|
||||
如 Documentation/arch/arm64/pointer-authentication.rst 所描述,
|
||||
ID_AA64ISAR1_EL1.APA == 0b0001 或 ID_AA64ISAR1_EL1.API == 0b0001
|
||||
表示有此功能。
|
||||
|
||||
HWCAP_PACG
|
||||
如 Documentation/arm64/pointer-authentication.rst 所描述,
|
||||
如 Documentation/arch/arm64/pointer-authentication.rst 所描述,
|
||||
ID_AA64ISAR1_EL1.GPA == 0b0001 或 ID_AA64ISAR1_EL1.GPI == 0b0001
|
||||
表示有此功能。
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
.. include:: ../../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/hugetlbpage.rst <hugetlbpage_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/hugetlbpage.rst <hugetlbpage_index>`
|
||||
|
||||
Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
.. include:: ../../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/index.rst <arm64_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/index.rst <arm64_index>`
|
||||
:Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
|
||||
.. _cn_arm64_index:
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
Chinese translated version of Documentation/arm64/legacy_instructions.rst
|
||||
Chinese translated version of Documentation/arch/arm64/legacy_instructions.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -10,7 +10,7 @@ Maintainer: Punit Agrawal <punit.agrawal@arm.com>
|
||||
Suzuki K. Poulose <suzuki.poulose@arm.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/legacy_instructions.rst 的中文翻译
|
||||
Documentation/arch/arm64/legacy_instructions.rst 的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
|
||||
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
Chinese translated version of Documentation/arm64/memory.rst
|
||||
Chinese translated version of Documentation/arch/arm64/memory.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -9,7 +9,7 @@ or if there is a problem with the translation.
|
||||
Maintainer: Catalin Marinas <catalin.marinas@arm.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/memory.rst 的中文翻译
|
||||
Documentation/arch/arm64/memory.rst 的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
|
||||
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
.. include:: ../disclaimer-zh_CN.rst
|
||||
.. include:: ../../disclaimer-zh_CN.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/perf.rst <perf_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/perf.rst <perf_index>`
|
||||
|
||||
Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
Chinese translated version of Documentation/arm64/silicon-errata.rst
|
||||
Chinese translated version of Documentation/arch/arm64/silicon-errata.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -10,7 +10,7 @@ M: Will Deacon <will.deacon@arm.com>
|
||||
zh_CN: Fu Wei <wefu@redhat.com>
|
||||
C: 1926e54f115725a9248d0c4c65c22acaf94de4c4
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/silicon-errata.rst 的中文翻译
|
||||
Documentation/arch/arm64/silicon-errata.rst 的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
|
||||
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
Chinese translated version of Documentation/arm64/tagged-pointers.rst
|
||||
Chinese translated version of Documentation/arch/arm64/tagged-pointers.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -9,7 +9,7 @@ or if there is a problem with the translation.
|
||||
Maintainer: Will Deacon <will.deacon@arm.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/tagged-pointers.rst 的中文翻译
|
||||
Documentation/arch/arm64/tagged-pointers.rst 的中文翻译
|
||||
|
||||
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
|
||||
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
|
||||
@@ -9,7 +9,7 @@
|
||||
:maxdepth: 2
|
||||
|
||||
../mips/index
|
||||
../arm64/index
|
||||
arm64/index
|
||||
../riscv/index
|
||||
openrisc/index
|
||||
parisc/index
|
||||
|
||||
@@ -55,7 +55,7 @@ mbind()设置一个新的内存策略。一个进程的页面也可以通过sys_
|
||||
消失。它还可以防止交换器或其他扫描器遇到该页。
|
||||
|
||||
|
||||
2. 我们需要有一个new_page_t类型的函数,可以传递给migrate_pages()。这个函数应该计算
|
||||
2. 我们需要有一个new_folio_t类型的函数,可以传递给migrate_pages()。这个函数应该计算
|
||||
出如何在给定的旧页面中分配正确的新页面。
|
||||
|
||||
3. migrate_pages()函数被调用,它试图进行迁移。它将调用该函数为每个被考虑迁移的页面分
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
.. include:: ../disclaimer-zh_TW.rst
|
||||
.. include:: ../../disclaimer-zh_TW.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/amu.rst <amu_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/amu.rst <amu_index>`
|
||||
|
||||
Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
Hu Haowen <src.res@email.cn>
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
Chinese translated version of Documentation/arm64/booting.rst
|
||||
Chinese translated version of Documentation/arch/arm64/booting.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -13,7 +13,7 @@ zh_CN: Fu Wei <wefu@redhat.com>
|
||||
zh_TW: Hu Haowen <src.res@email.cn>
|
||||
C: 55f058e7574c3615dea4615573a19bdb258696c6
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/booting.rst 的中文翻譯
|
||||
Documentation/arch/arm64/booting.rst 的中文翻譯
|
||||
|
||||
如果想評論或更新本文的內容,請直接聯繫原文檔的維護者。如果你使用英文
|
||||
交流有困難的話,也可以向中文版維護者求助。如果本翻譯更新不及時或者翻
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
.. include:: ../disclaimer-zh_TW.rst
|
||||
.. include:: ../../disclaimer-zh_TW.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/elf_hwcaps.rst <elf_hwcaps_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/elf_hwcaps.rst <elf_hwcaps_index>`
|
||||
|
||||
Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
Hu Haowen <src.res@email.cn>
|
||||
@@ -95,7 +95,7 @@ HWCAP_ASIMDHP
|
||||
ID_AA64PFR0_EL1.AdvSIMD == 0b0001 表示有此功能。
|
||||
|
||||
HWCAP_CPUID
|
||||
根據 Documentation/arm64/cpu-feature-registers.rst 描述,EL0 可以訪問
|
||||
根據 Documentation/arch/arm64/cpu-feature-registers.rst 描述,EL0 可以訪問
|
||||
某些 ID 寄存器。
|
||||
|
||||
這些 ID 寄存器可能表示功能的可用性。
|
||||
@@ -155,12 +155,12 @@ HWCAP_SB
|
||||
ID_AA64ISAR1_EL1.SB == 0b0001 表示有此功能。
|
||||
|
||||
HWCAP_PACA
|
||||
如 Documentation/arm64/pointer-authentication.rst 所描述,
|
||||
如 Documentation/arch/arm64/pointer-authentication.rst 所描述,
|
||||
ID_AA64ISAR1_EL1.APA == 0b0001 或 ID_AA64ISAR1_EL1.API == 0b0001
|
||||
表示有此功能。
|
||||
|
||||
HWCAP_PACG
|
||||
如 Documentation/arm64/pointer-authentication.rst 所描述,
|
||||
如 Documentation/arch/arm64/pointer-authentication.rst 所描述,
|
||||
ID_AA64ISAR1_EL1.GPA == 0b0001 或 ID_AA64ISAR1_EL1.GPI == 0b0001
|
||||
表示有此功能。
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
.. include:: ../disclaimer-zh_TW.rst
|
||||
.. include:: ../../disclaimer-zh_TW.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/hugetlbpage.rst <hugetlbpage_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/hugetlbpage.rst <hugetlbpage_index>`
|
||||
|
||||
Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
Hu Haowen <src.res@email.cn>
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
.. include:: ../disclaimer-zh_TW.rst
|
||||
.. include:: ../../disclaimer-zh_TW.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/index.rst <arm64_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/index.rst <arm64_index>`
|
||||
:Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
Hu Haowen <src.res@email.cn>
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
Chinese translated version of Documentation/arm64/legacy_instructions.rst
|
||||
Chinese translated version of Documentation/arch/arm64/legacy_instructions.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -13,7 +13,7 @@ Maintainer: Punit Agrawal <punit.agrawal@arm.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
Traditional Chinese maintainer: Hu Haowen <src.res@email.cn>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/legacy_instructions.rst 的中文翻譯
|
||||
Documentation/arch/arm64/legacy_instructions.rst 的中文翻譯
|
||||
|
||||
如果想評論或更新本文的內容,請直接聯繫原文檔的維護者。如果你使用英文
|
||||
交流有困難的話,也可以向中文版維護者求助。如果本翻譯更新不及時或者翻
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
Chinese translated version of Documentation/arm64/memory.rst
|
||||
Chinese translated version of Documentation/arch/arm64/memory.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -12,7 +12,7 @@ Maintainer: Catalin Marinas <catalin.marinas@arm.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
Traditional Chinese maintainer: Hu Haowen <src.res@email.cn>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/memory.rst 的中文翻譯
|
||||
Documentation/arch/arm64/memory.rst 的中文翻譯
|
||||
|
||||
如果想評論或更新本文的內容,請直接聯繫原文檔的維護者。如果你使用英文
|
||||
交流有困難的話,也可以向中文版維護者求助。如果本翻譯更新不及時或者翻
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
.. include:: ../disclaimer-zh_TW.rst
|
||||
.. include:: ../../disclaimer-zh_TW.rst
|
||||
|
||||
:Original: :ref:`Documentation/arm64/perf.rst <perf_index>`
|
||||
:Original: :ref:`Documentation/arch/arm64/perf.rst <perf_index>`
|
||||
|
||||
Translator: Bailu Lin <bailu.lin@vivo.com>
|
||||
Hu Haowen <src.res@email.cn>
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
Chinese translated version of Documentation/arm64/silicon-errata.rst
|
||||
Chinese translated version of Documentation/arch/arm64/silicon-errata.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -13,7 +13,7 @@ zh_CN: Fu Wei <wefu@redhat.com>
|
||||
zh_TW: Hu Haowen <src.res@email.cn>
|
||||
C: 1926e54f115725a9248d0c4c65c22acaf94de4c4
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/silicon-errata.rst 的中文翻譯
|
||||
Documentation/arch/arm64/silicon-errata.rst 的中文翻譯
|
||||
|
||||
如果想評論或更新本文的內容,請直接聯繫原文檔的維護者。如果你使用英文
|
||||
交流有困難的話,也可以向中文版維護者求助。如果本翻譯更新不及時或者翻
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
Chinese translated version of Documentation/arm64/tagged-pointers.rst
|
||||
Chinese translated version of Documentation/arch/arm64/tagged-pointers.rst
|
||||
|
||||
If you have any comment or update to the content, please contact the
|
||||
original document maintainer directly. However, if you have a problem
|
||||
@@ -12,7 +12,7 @@ Maintainer: Will Deacon <will.deacon@arm.com>
|
||||
Chinese maintainer: Fu Wei <wefu@redhat.com>
|
||||
Traditional Chinese maintainer: Hu Haowen <src.res@email.cn>
|
||||
---------------------------------------------------------------------
|
||||
Documentation/arm64/tagged-pointers.rst 的中文翻譯
|
||||
Documentation/arch/arm64/tagged-pointers.rst 的中文翻譯
|
||||
|
||||
如果想評論或更新本文的內容,請直接聯繫原文檔的維護者。如果你使用英文
|
||||
交流有困難的話,也可以向中文版維護者求助。如果本翻譯更新不及時或者翻
|
||||
@@ -150,7 +150,7 @@ TODOList:
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
arm64/index
|
||||
arch/arm64/index
|
||||
|
||||
TODOList:
|
||||
|
||||
|
||||
@@ -2613,7 +2613,7 @@ follows::
|
||||
this vcpu, and determines which register slices are visible through
|
||||
this ioctl interface.
|
||||
|
||||
(See Documentation/arm64/sve.rst for an explanation of the "vq"
|
||||
(See Documentation/arch/arm64/sve.rst for an explanation of the "vq"
|
||||
nomenclature.)
|
||||
|
||||
KVM_REG_ARM64_SVE_VLS is only accessible after KVM_ARM_VCPU_INIT.
|
||||
|
||||
+8
-1
@@ -3062,7 +3062,7 @@ M: Will Deacon <will@kernel.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
|
||||
F: Documentation/arm64/
|
||||
F: Documentation/arch/arm64/
|
||||
F: arch/arm64/
|
||||
F: tools/testing/selftests/arm64/
|
||||
X: arch/arm64/boot/dts/
|
||||
@@ -4487,6 +4487,13 @@ S: Supported
|
||||
F: Documentation/filesystems/caching/cachefiles.rst
|
||||
F: fs/cachefiles/
|
||||
|
||||
CACHESTAT: PAGE CACHE STATS FOR A FILE
|
||||
M: Nhat Pham <nphamcs@gmail.com>
|
||||
M: Johannes Weiner <hannes@cmpxchg.org>
|
||||
L: linux-mm@kvack.org
|
||||
S: Maintained
|
||||
F: tools/testing/selftests/cachestat/test_cachestat.c
|
||||
|
||||
CADENCE MIPI-CSI2 BRIDGES
|
||||
M: Maxime Ripard <mripard@kernel.org>
|
||||
L: linux-media@vger.kernel.org
|
||||
|
||||
@@ -490,3 +490,4 @@
|
||||
558 common process_mrelease sys_process_mrelease
|
||||
559 common futex_waitv sys_futex_waitv
|
||||
560 common set_mempolicy_home_node sys_ni_syscall
|
||||
561 common cachestat sys_cachestat
|
||||
|
||||
@@ -74,6 +74,9 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
|
||||
return 0;
|
||||
|
||||
pte = pte_offset_map_lock(current->mm, pmd, addr, &ptl);
|
||||
if (unlikely(!pte))
|
||||
return 0;
|
||||
|
||||
if (unlikely(!pte_present(*pte) || !pte_young(*pte) ||
|
||||
!pte_write(*pte) || !pte_dirty(*pte))) {
|
||||
pte_unmap_unlock(pte, ptl);
|
||||
|
||||
@@ -117,8 +117,11 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
|
||||
* must use the nested version. This also means we need to
|
||||
* open-code the spin-locking.
|
||||
*/
|
||||
ptl = pte_lockptr(vma->vm_mm, pmd);
|
||||
pte = pte_offset_map(pmd, address);
|
||||
if (!pte)
|
||||
return 0;
|
||||
|
||||
ptl = pte_lockptr(vma->vm_mm, pmd);
|
||||
do_pte_lock(ptl);
|
||||
|
||||
ret = do_adjust_pte(vma, address, pfn, pte);
|
||||
|
||||
@@ -85,6 +85,9 @@ void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr)
|
||||
break;
|
||||
|
||||
pte = pte_offset_map(pmd, addr);
|
||||
if (!pte)
|
||||
break;
|
||||
|
||||
pr_cont(", *pte=%08llx", (long long)pte_val(*pte));
|
||||
#ifndef CONFIG_ARM_LPAE
|
||||
pr_cont(", *ppte=%08llx",
|
||||
|
||||
@@ -464,3 +464,4 @@
|
||||
448 common process_mrelease sys_process_mrelease
|
||||
449 common futex_waitv sys_futex_waitv
|
||||
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
|
||||
451 common cachestat sys_cachestat
|
||||
|
||||
+3
-2
@@ -120,6 +120,7 @@ config ARM64
|
||||
select CRC32
|
||||
select DCACHE_WORD_ACCESS
|
||||
select DYNAMIC_FTRACE if FUNCTION_TRACER
|
||||
select DMA_BOUNCE_UNALIGNED_KMALLOC
|
||||
select DMA_DIRECT_REMAP
|
||||
select EDAC_SUPPORT
|
||||
select FRAME_POINTER
|
||||
@@ -1586,7 +1587,7 @@ config ARM64_TAGGED_ADDR_ABI
|
||||
When this option is enabled, user applications can opt in to a
|
||||
relaxed ABI via prctl() allowing tagged addresses to be passed
|
||||
to system calls as pointer arguments. For details, see
|
||||
Documentation/arm64/tagged-address-abi.rst.
|
||||
Documentation/arch/arm64/tagged-address-abi.rst.
|
||||
|
||||
menuconfig COMPAT
|
||||
bool "Kernel support for 32-bit EL0"
|
||||
@@ -2048,7 +2049,7 @@ config ARM64_MTE
|
||||
explicitly opt in. The mechanism for the userspace is
|
||||
described in:
|
||||
|
||||
Documentation/arm64/memory-tagging-extension.rst.
|
||||
Documentation/arch/arm64/memory-tagging-extension.rst.
|
||||
|
||||
endmenu # "ARMv8.5 architectural features"
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* the CPU.
|
||||
*/
|
||||
#define ARCH_DMA_MINALIGN (128)
|
||||
#define ARCH_KMALLOC_MINALIGN (8)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
@@ -90,6 +91,8 @@ static inline int cache_line_size_of_cpu(void)
|
||||
|
||||
int cache_line_size(void);
|
||||
|
||||
#define dma_get_cache_alignment cache_line_size
|
||||
|
||||
/*
|
||||
* Read the effective value of CTR_EL0.
|
||||
*
|
||||
|
||||
@@ -88,7 +88,7 @@ efi_status_t __efi_rt_asm_wrapper(void *, const char *, ...);
|
||||
* guaranteed to cover the kernel Image.
|
||||
*
|
||||
* Since the EFI stub is part of the kernel Image, we can relax the
|
||||
* usual requirements in Documentation/arm64/booting.rst, which still
|
||||
* usual requirements in Documentation/arch/arm64/booting.rst, which still
|
||||
* apply to other bootloaders, and are required for some kernel
|
||||
* configurations.
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
/*
|
||||
* struct arm64_image_header - arm64 kernel image header
|
||||
* See Documentation/arm64/booting.rst for details
|
||||
* See Documentation/arch/arm64/booting.rst for details
|
||||
*
|
||||
* @code0: Executable code, or
|
||||
* @mz_header alternatively used for part of MZ header
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
|
||||
#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
|
||||
|
||||
#define __NR_compat_syscalls 451
|
||||
#define __NR_compat_syscalls 452
|
||||
#endif
|
||||
|
||||
#define __ARCH_WANT_SYS_CLONE
|
||||
|
||||
@@ -907,6 +907,8 @@ __SYSCALL(__NR_process_mrelease, sys_process_mrelease)
|
||||
__SYSCALL(__NR_futex_waitv, sys_futex_waitv)
|
||||
#define __NR_set_mempolicy_home_node 450
|
||||
__SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node)
|
||||
#define __NR_cachestat 451
|
||||
__SYSCALL(__NR_cachestat, sys_cachestat)
|
||||
|
||||
/*
|
||||
* Please add new compat syscalls above this comment and update
|
||||
|
||||
@@ -177,7 +177,7 @@ struct zt_context {
|
||||
* vector length beyond its initial architectural limit of 2048 bits
|
||||
* (16 quadwords).
|
||||
*
|
||||
* See linux/Documentation/arm64/sve.rst for a description of the VL/VQ
|
||||
* See linux/Documentation/arch/arm64/sve.rst for a description of the VL/VQ
|
||||
* terminology.
|
||||
*/
|
||||
#define SVE_VQ_BYTES __SVE_VQ_BYTES /* bytes per quadword */
|
||||
|
||||
@@ -48,7 +48,7 @@ static void *image_load(struct kimage *image,
|
||||
|
||||
/*
|
||||
* We require a kernel with an unambiguous Image header. Per
|
||||
* Documentation/arm64/booting.rst, this is the case when image_size
|
||||
* Documentation/arch/arm64/booting.rst, this is the case when image_size
|
||||
* is non-zero (practically speaking, since v3.17).
|
||||
*/
|
||||
h = (struct arm64_image_header *)kernel;
|
||||
|
||||
@@ -416,10 +416,9 @@ long get_mte_ctrl(struct task_struct *task)
|
||||
static int __access_remote_tags(struct mm_struct *mm, unsigned long addr,
|
||||
struct iovec *kiov, unsigned int gup_flags)
|
||||
{
|
||||
struct vm_area_struct *vma;
|
||||
void __user *buf = kiov->iov_base;
|
||||
size_t len = kiov->iov_len;
|
||||
int ret;
|
||||
int err = 0;
|
||||
int write = gup_flags & FOLL_WRITE;
|
||||
|
||||
if (!access_ok(buf, len))
|
||||
@@ -429,14 +428,16 @@ static int __access_remote_tags(struct mm_struct *mm, unsigned long addr,
|
||||
return -EIO;
|
||||
|
||||
while (len) {
|
||||
struct vm_area_struct *vma;
|
||||
unsigned long tags, offset;
|
||||
void *maddr;
|
||||
struct page *page = NULL;
|
||||
struct page *page = get_user_page_vma_remote(mm, addr,
|
||||
gup_flags, &vma);
|
||||
|
||||
ret = get_user_pages_remote(mm, addr, 1, gup_flags, &page,
|
||||
&vma, NULL);
|
||||
if (ret <= 0)
|
||||
if (IS_ERR_OR_NULL(page)) {
|
||||
err = page == NULL ? -EIO : PTR_ERR(page);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Only copy tags if the page has been mapped as PROT_MTE
|
||||
@@ -446,7 +447,7 @@ static int __access_remote_tags(struct mm_struct *mm, unsigned long addr,
|
||||
* was never mapped with PROT_MTE.
|
||||
*/
|
||||
if (!(vma->vm_flags & VM_MTE)) {
|
||||
ret = -EOPNOTSUPP;
|
||||
err = -EOPNOTSUPP;
|
||||
put_page(page);
|
||||
break;
|
||||
}
|
||||
@@ -479,7 +480,7 @@ static int __access_remote_tags(struct mm_struct *mm, unsigned long addr,
|
||||
kiov->iov_len = buf - kiov->iov_base;
|
||||
if (!kiov->iov_len) {
|
||||
/* check for error accessing the tracee's address space */
|
||||
if (ret <= 0)
|
||||
if (err)
|
||||
return -EIO;
|
||||
else
|
||||
return -EFAULT;
|
||||
|
||||
@@ -1103,7 +1103,7 @@ static int kasan_handler(struct pt_regs *regs, unsigned long esr)
|
||||
bool recover = esr & KASAN_ESR_RECOVER;
|
||||
bool write = esr & KASAN_ESR_WRITE;
|
||||
size_t size = KASAN_ESR_SIZE(esr);
|
||||
u64 addr = regs->regs[0];
|
||||
void *addr = (void *)regs->regs[0];
|
||||
u64 pc = regs->pc;
|
||||
|
||||
kasan_report(addr, size, write, pc);
|
||||
|
||||
@@ -188,6 +188,9 @@ static void show_pte(unsigned long addr)
|
||||
break;
|
||||
|
||||
ptep = pte_offset_map(pmdp, addr);
|
||||
if (!ptep)
|
||||
break;
|
||||
|
||||
pte = READ_ONCE(*ptep);
|
||||
pr_cont(", pte=%016llx", pte_val(pte));
|
||||
pte_unmap(ptep);
|
||||
@@ -328,7 +331,7 @@ static void report_tag_fault(unsigned long addr, unsigned long esr,
|
||||
* find out access size.
|
||||
*/
|
||||
bool is_write = !!(esr & ESR_ELx_WNR);
|
||||
kasan_report(addr, 0, is_write, regs->pc);
|
||||
kasan_report((void *)addr, 0, is_write, regs->pc);
|
||||
}
|
||||
#else
|
||||
/* Tag faults aren't enabled without CONFIG_KASAN_HW_TAGS. */
|
||||
|
||||
@@ -307,14 +307,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
return NULL;
|
||||
|
||||
WARN_ON(addr & (sz - 1));
|
||||
/*
|
||||
* Note that if this code were ever ported to the
|
||||
* 32-bit arm platform then it will cause trouble in
|
||||
* the case where CONFIG_HIGHPTE is set, since there
|
||||
* will be no pte_unmap() to correspond with this
|
||||
* pte_alloc_map().
|
||||
*/
|
||||
ptep = pte_alloc_map(mm, pmdp, addr);
|
||||
ptep = pte_alloc_huge(mm, pmdp, addr);
|
||||
} else if (sz == PMD_SIZE) {
|
||||
if (want_pmd_share(vma, addr) && pud_none(READ_ONCE(*pudp)))
|
||||
ptep = huge_pmd_share(mm, vma, addr, pudp);
|
||||
@@ -366,7 +359,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm,
|
||||
return (pte_t *)pmdp;
|
||||
|
||||
if (sz == CONT_PTE_SIZE)
|
||||
return pte_offset_kernel(pmdp, (addr & CONT_PTE_MASK));
|
||||
return pte_offset_huge(pmdp, (addr & CONT_PTE_MASK));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -466,7 +466,12 @@ void __init bootmem_init(void)
|
||||
*/
|
||||
void __init mem_init(void)
|
||||
{
|
||||
swiotlb_init(max_pfn > PFN_DOWN(arm64_dma_phys_limit), SWIOTLB_VERBOSE);
|
||||
bool swiotlb = max_pfn > PFN_DOWN(arm64_dma_phys_limit);
|
||||
|
||||
if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC))
|
||||
swiotlb = true;
|
||||
|
||||
swiotlb_init(swiotlb, SWIOTLB_VERBOSE);
|
||||
|
||||
/* this will put all unused low memory onto the freelists */
|
||||
memblock_free_all();
|
||||
|
||||
@@ -371,3 +371,4 @@
|
||||
448 common process_mrelease sys_process_mrelease
|
||||
449 common futex_waitv sys_futex_waitv
|
||||
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
|
||||
451 common cachestat sys_cachestat
|
||||
|
||||
@@ -41,7 +41,7 @@ huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
if (pud) {
|
||||
pmd = pmd_alloc(mm, pud, taddr);
|
||||
if (pmd)
|
||||
pte = pte_alloc_map(mm, pmd, taddr);
|
||||
pte = pte_alloc_huge(mm, pmd, taddr);
|
||||
}
|
||||
return pte;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr, unsigned long sz)
|
||||
if (pud_present(*pud)) {
|
||||
pmd = pmd_offset(pud, taddr);
|
||||
if (pmd_present(*pmd))
|
||||
pte = pte_offset_map(pmd, taddr);
|
||||
pte = pte_offset_huge(pmd, taddr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ static inline void load_ksp_mmu(struct task_struct *task)
|
||||
p4d_t *p4d;
|
||||
pud_t *pud;
|
||||
pmd_t *pmd;
|
||||
pte_t *pte;
|
||||
pte_t *pte = NULL;
|
||||
unsigned long mmuar;
|
||||
|
||||
local_irq_save(flags);
|
||||
@@ -139,7 +139,7 @@ static inline void load_ksp_mmu(struct task_struct *task)
|
||||
|
||||
pte = (mmuar >= PAGE_OFFSET) ? pte_offset_kernel(pmd, mmuar)
|
||||
: pte_offset_map(pmd, mmuar);
|
||||
if (pte_none(*pte) || !pte_present(*pte))
|
||||
if (!pte || pte_none(*pte) || !pte_present(*pte))
|
||||
goto bug;
|
||||
|
||||
set_pte(pte, pte_mkyoung(*pte));
|
||||
@@ -161,6 +161,8 @@ static inline void load_ksp_mmu(struct task_struct *task)
|
||||
bug:
|
||||
pr_info("ksp load failed: mm=0x%p ksp=0x08%lx\n", mm, mmuar);
|
||||
end:
|
||||
if (pte && mmuar < PAGE_OFFSET)
|
||||
pte_unmap(pte);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -488,6 +488,8 @@ sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
|
||||
if (!pmd_present(*pmd))
|
||||
goto bad_access;
|
||||
pte = pte_offset_map_lock(mm, pmd, (unsigned long)mem, &ptl);
|
||||
if (!pte)
|
||||
goto bad_access;
|
||||
if (!pte_present(*pte) || !pte_dirty(*pte)
|
||||
|| !pte_write(*pte)) {
|
||||
pte_unmap_unlock(pte, ptl);
|
||||
|
||||
@@ -450,3 +450,4 @@
|
||||
448 common process_mrelease sys_process_mrelease
|
||||
449 common futex_waitv sys_futex_waitv
|
||||
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
|
||||
451 common cachestat sys_cachestat
|
||||
|
||||
+21
-31
@@ -91,7 +91,8 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
|
||||
p4d_t *p4d;
|
||||
pud_t *pud;
|
||||
pmd_t *pmd;
|
||||
pte_t *pte;
|
||||
pte_t *pte = NULL;
|
||||
int ret = -1;
|
||||
int asid;
|
||||
|
||||
local_irq_save(flags);
|
||||
@@ -100,47 +101,33 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
|
||||
regs->pc + (extension_word * sizeof(long));
|
||||
|
||||
mm = (!user_mode(regs) && KMAPAREA(mmuar)) ? &init_mm : current->mm;
|
||||
if (!mm) {
|
||||
local_irq_restore(flags);
|
||||
return -1;
|
||||
}
|
||||
if (!mm)
|
||||
goto out;
|
||||
|
||||
pgd = pgd_offset(mm, mmuar);
|
||||
if (pgd_none(*pgd)) {
|
||||
local_irq_restore(flags);
|
||||
return -1;
|
||||
}
|
||||
if (pgd_none(*pgd))
|
||||
goto out;
|
||||
|
||||
p4d = p4d_offset(pgd, mmuar);
|
||||
if (p4d_none(*p4d)) {
|
||||
local_irq_restore(flags);
|
||||
return -1;
|
||||
}
|
||||
if (p4d_none(*p4d))
|
||||
goto out;
|
||||
|
||||
pud = pud_offset(p4d, mmuar);
|
||||
if (pud_none(*pud)) {
|
||||
local_irq_restore(flags);
|
||||
return -1;
|
||||
}
|
||||
if (pud_none(*pud))
|
||||
goto out;
|
||||
|
||||
pmd = pmd_offset(pud, mmuar);
|
||||
if (pmd_none(*pmd)) {
|
||||
local_irq_restore(flags);
|
||||
return -1;
|
||||
}
|
||||
if (pmd_none(*pmd))
|
||||
goto out;
|
||||
|
||||
pte = (KMAPAREA(mmuar)) ? pte_offset_kernel(pmd, mmuar)
|
||||
: pte_offset_map(pmd, mmuar);
|
||||
if (pte_none(*pte) || !pte_present(*pte)) {
|
||||
local_irq_restore(flags);
|
||||
return -1;
|
||||
}
|
||||
if (!pte || pte_none(*pte) || !pte_present(*pte))
|
||||
goto out;
|
||||
|
||||
if (write) {
|
||||
if (!pte_write(*pte)) {
|
||||
local_irq_restore(flags);
|
||||
return -1;
|
||||
}
|
||||
if (!pte_write(*pte))
|
||||
goto out;
|
||||
set_pte(pte, pte_mkdirty(*pte));
|
||||
}
|
||||
|
||||
@@ -161,9 +148,12 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
|
||||
mmu_write(MMUOR, MMUOR_ACC | MMUOR_UAA);
|
||||
else
|
||||
mmu_write(MMUOR, MMUOR_ITLB | MMUOR_ACC | MMUOR_UAA);
|
||||
|
||||
ret = 0;
|
||||
out:
|
||||
if (pte && !KMAPAREA(mmuar))
|
||||
pte_unmap(pte);
|
||||
local_irq_restore(flags);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __init cf_bootmem_alloc(void)
|
||||
|
||||
@@ -18,4 +18,9 @@
|
||||
|
||||
#define SMP_CACHE_BYTES L1_CACHE_BYTES
|
||||
|
||||
/* MS be sure that SLAB allocates aligned objects */
|
||||
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
|
||||
|
||||
#define ARCH_SLAB_MINALIGN L1_CACHE_BYTES
|
||||
|
||||
#endif /* _ASM_MICROBLAZE_CACHE_H */
|
||||
|
||||
@@ -30,11 +30,6 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* MS be sure that SLAB allocates aligned objects */
|
||||
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
|
||||
|
||||
#define ARCH_SLAB_MINALIGN L1_CACHE_BYTES
|
||||
|
||||
/*
|
||||
* PAGE_OFFSET -- the first address of the first page of memory. With MMU
|
||||
* it is set to the kernel start address (aligned on a page boundary).
|
||||
|
||||
@@ -194,7 +194,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
|
||||
preempt_disable();
|
||||
ptep = pte_offset_map(pmdp, address);
|
||||
if (pte_present(*ptep)) {
|
||||
if (ptep && pte_present(*ptep)) {
|
||||
address = (unsigned long) page_address(pte_page(*ptep));
|
||||
/* MS: I need add offset in page */
|
||||
address += ((unsigned long)frame->tramp) & ~PAGE_MASK;
|
||||
@@ -203,7 +203,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
invalidate_icache_range(address, address + 8);
|
||||
flush_dcache_range(address, address + 8);
|
||||
}
|
||||
pte_unmap(ptep);
|
||||
if (ptep)
|
||||
pte_unmap(ptep);
|
||||
preempt_enable();
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
|
||||
@@ -456,3 +456,4 @@
|
||||
448 common process_mrelease sys_process_mrelease
|
||||
449 common futex_waitv sys_futex_waitv
|
||||
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
|
||||
451 common cachestat sys_cachestat
|
||||
|
||||
@@ -389,3 +389,4 @@
|
||||
448 n32 process_mrelease sys_process_mrelease
|
||||
449 n32 futex_waitv sys_futex_waitv
|
||||
450 n32 set_mempolicy_home_node sys_set_mempolicy_home_node
|
||||
451 n32 cachestat sys_cachestat
|
||||
|
||||
@@ -365,3 +365,4 @@
|
||||
448 n64 process_mrelease sys_process_mrelease
|
||||
449 n64 futex_waitv sys_futex_waitv
|
||||
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
|
||||
451 n64 cachestat sys_cachestat
|
||||
|
||||
@@ -438,3 +438,4 @@
|
||||
448 o32 process_mrelease sys_process_mrelease
|
||||
449 o32 futex_waitv sys_futex_waitv
|
||||
450 o32 set_mempolicy_home_node sys_set_mempolicy_home_node
|
||||
451 o32 cachestat sys_cachestat
|
||||
|
||||
+10
-2
@@ -297,7 +297,7 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
|
||||
p4d_t *p4dp;
|
||||
pud_t *pudp;
|
||||
pmd_t *pmdp;
|
||||
pte_t *ptep;
|
||||
pte_t *ptep, *ptemap = NULL;
|
||||
int idx, pid;
|
||||
|
||||
/*
|
||||
@@ -344,7 +344,12 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
ptep = pte_offset_map(pmdp, address);
|
||||
ptemap = ptep = pte_offset_map(pmdp, address);
|
||||
/*
|
||||
* update_mmu_cache() is called between pte_offset_map_lock()
|
||||
* and pte_unmap_unlock(), so we can assume that ptep is not
|
||||
* NULL here: and what should be done below if it were NULL?
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
|
||||
#ifdef CONFIG_XPA
|
||||
@@ -373,6 +378,9 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
|
||||
tlbw_use_hazard();
|
||||
htw_start();
|
||||
flush_micro_tlb_vm(vma);
|
||||
|
||||
if (ptemap)
|
||||
pte_unmap(ptemap);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -426,10 +426,15 @@ void flush_dcache_page(struct page *page)
|
||||
offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT;
|
||||
addr = mpnt->vm_start + offset;
|
||||
if (parisc_requires_coherency()) {
|
||||
bool needs_flush = false;
|
||||
pte_t *ptep;
|
||||
|
||||
ptep = get_ptep(mpnt->vm_mm, addr);
|
||||
if (ptep && pte_needs_flush(*ptep))
|
||||
if (ptep) {
|
||||
needs_flush = pte_needs_flush(*ptep);
|
||||
pte_unmap(ptep);
|
||||
}
|
||||
if (needs_flush)
|
||||
flush_user_cache_page(mpnt, addr);
|
||||
} else {
|
||||
/*
|
||||
@@ -561,14 +566,20 @@ EXPORT_SYMBOL(flush_kernel_dcache_page_addr);
|
||||
static void flush_cache_page_if_present(struct vm_area_struct *vma,
|
||||
unsigned long vmaddr, unsigned long pfn)
|
||||
{
|
||||
pte_t *ptep = get_ptep(vma->vm_mm, vmaddr);
|
||||
bool needs_flush = false;
|
||||
pte_t *ptep;
|
||||
|
||||
/*
|
||||
* The pte check is racy and sometimes the flush will trigger
|
||||
* a non-access TLB miss. Hopefully, the page has already been
|
||||
* flushed.
|
||||
*/
|
||||
if (ptep && pte_needs_flush(*ptep))
|
||||
ptep = get_ptep(vma->vm_mm, vmaddr);
|
||||
if (ptep) {
|
||||
needs_flush = pte_needs_flush(*ptep);
|
||||
pte_unmap(ptep);
|
||||
}
|
||||
if (needs_flush)
|
||||
flush_cache_page(vma, vmaddr, pfn);
|
||||
}
|
||||
|
||||
@@ -635,17 +646,22 @@ static void flush_cache_pages(struct vm_area_struct *vma, unsigned long start, u
|
||||
pte_t *ptep;
|
||||
|
||||
for (addr = start; addr < end; addr += PAGE_SIZE) {
|
||||
bool needs_flush = false;
|
||||
/*
|
||||
* The vma can contain pages that aren't present. Although
|
||||
* the pte search is expensive, we need the pte to find the
|
||||
* page pfn and to check whether the page should be flushed.
|
||||
*/
|
||||
ptep = get_ptep(vma->vm_mm, addr);
|
||||
if (ptep && pte_needs_flush(*ptep)) {
|
||||
if (ptep) {
|
||||
needs_flush = pte_needs_flush(*ptep);
|
||||
pfn = pte_pfn(*ptep);
|
||||
pte_unmap(ptep);
|
||||
}
|
||||
if (needs_flush) {
|
||||
if (parisc_requires_coherency()) {
|
||||
flush_user_cache_page(vma, addr);
|
||||
} else {
|
||||
pfn = pte_pfn(*ptep);
|
||||
if (WARN_ON(!pfn_valid(pfn)))
|
||||
return;
|
||||
__flush_cache_page(vma, addr, PFN_PHYS(pfn));
|
||||
|
||||
@@ -164,7 +164,7 @@ static inline void unmap_uncached_pte(pmd_t * pmd, unsigned long vaddr,
|
||||
pmd_clear(pmd);
|
||||
return;
|
||||
}
|
||||
pte = pte_offset_map(pmd, vaddr);
|
||||
pte = pte_offset_kernel(pmd, vaddr);
|
||||
vaddr &= ~PMD_MASK;
|
||||
end = vaddr + size;
|
||||
if (end > PMD_SIZE)
|
||||
|
||||
@@ -448,3 +448,4 @@
|
||||
448 common process_mrelease sys_process_mrelease
|
||||
449 common futex_waitv sys_futex_waitv
|
||||
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
|
||||
451 common cachestat sys_cachestat
|
||||
|
||||
@@ -66,7 +66,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
if (pud) {
|
||||
pmd = pmd_alloc(mm, pud, addr);
|
||||
if (pmd)
|
||||
pte = pte_alloc_map(mm, pmd, addr);
|
||||
pte = pte_alloc_huge(mm, pmd, addr);
|
||||
}
|
||||
return pte;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm,
|
||||
if (!pud_none(*pud)) {
|
||||
pmd = pmd_offset(pud, addr);
|
||||
if (!pmd_none(*pmd))
|
||||
pte = pte_offset_map(pmd, addr);
|
||||
pte = pte_offset_huge(pmd, addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user