Linus Torvalds
c9d35ee049
Merge branch 'merge.nfs-fs_parse.1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
...
Pull vfs file system parameter updates from Al Viro:
"Saner fs_parser.c guts and data structures. The system-wide registry
of syntax types (string/enum/int32/oct32/.../etc.) is gone and so is
the horror switch() in fs_parse() that would have to grow another case
every time something got added to that system-wide registry.
New syntax types can be added by filesystems easily now, and their
namespace is that of functions - not of system-wide enum members. IOW,
they can be shared or kept private and if some turn out to be widely
useful, we can make them common library helpers, etc., without having
to do anything whatsoever to fs_parse() itself.
And we already get that kind of requests - the thing that finally
pushed me into doing that was "oh, and let's add one for timeouts -
things like 15s or 2h". If some filesystem really wants that, let them
do it. Without somebody having to play gatekeeper for the variants
blessed by direct support in fs_parse(), TYVM.
Quite a bit of boilerplate is gone. And IMO the data structures make a
lot more sense now. -200LoC, while we are at it"
* 'merge.nfs-fs_parse.1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (25 commits)
tmpfs: switch to use of invalfc()
cgroup1: switch to use of errorfc() et.al.
procfs: switch to use of invalfc()
hugetlbfs: switch to use of invalfc()
cramfs: switch to use of errofc() et.al.
gfs2: switch to use of errorfc() et.al.
fuse: switch to use errorfc() et.al.
ceph: use errorfc() and friends instead of spelling the prefix out
prefix-handling analogues of errorf() and friends
turn fs_param_is_... into functions
fs_parse: handle optional arguments sanely
fs_parse: fold fs_parameter_desc/fs_parameter_spec
fs_parser: remove fs_parameter_description name field
add prefix to fs_context->log
ceph_parse_param(), ceph_parse_mon_ips(): switch to passing fc_log
new primitive: __fs_parse()
switch rbd and libceph to p_log-based primitives
struct p_log, variants of warnf() et.al. taking that one instead
teach logfc() to handle prefices, give it saner calling conventions
get rid of cg_invalf()
...
2020-02-08 13:26:41 -08:00
Linus Torvalds
236f453294
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
...
Pull misc vfs updates from Al Viro:
- bmap series from cmaiolino
- getting rid of convolutions in copy_mount_options() (use a couple of
copy_from_user() instead of the __get_user() crap)
* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
saner copy_mount_options()
fibmap: Reject negative block numbers
fibmap: Use bmap instead of ->bmap method in ioctl_fibmap
ecryptfs: drop direct calls to ->bmap
cachefiles: drop direct usage of ->bmap method.
fs: Enable bmap() function to properly return errors
2020-02-08 13:04:49 -08:00
Al Viro
f35aa2bc80
tmpfs: switch to use of invalfc()
...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-02-07 14:48:44 -05:00
Al Viro
d7167b1499
fs_parse: fold fs_parameter_desc/fs_parameter_spec
...
The former contains nothing but a pointer to an array of the latter...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-02-07 14:48:37 -05:00
Eric Sandeen
96cafb9ccb
fs_parser: remove fs_parameter_description name field
...
Unused now.
Signed-off-by: Eric Sandeen <sandeen@redhat.com >
Acked-by: David Howells <dhowells@redhat.com >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-02-07 14:48:36 -05:00
Al Viro
5eede62529
fold struct fs_parameter_enum into struct constant_table
...
no real difference now
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-02-07 00:12:50 -05:00
Al Viro
2710c957a8
fs_parse: get rid of ->enums
...
Don't do a single array; attach them to fsparam_enum() entry
instead. And don't bother trying to embed the names into those -
it actually loses memory, with no real speedup worth mentioning.
Simplifies validation as well.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-02-07 00:12:50 -05:00
Linus Torvalds
cc12071ff3
Merge branch 'akpm' (patches from Andrew)
...
Merge more updates from Andrew Morton:
"The rest of MM and the rest of everything else: hotfixes, ipc, misc,
procfs, lib, cleanups, arm"
* emailed patches from Andrew Morton <akpm@linux-foundation.org >: (67 commits)
ARM: dma-api: fix max_pfn off-by-one error in __dma_supported()
treewide: remove redundant IS_ERR() before error code check
include/linux/cpumask.h: don't calculate length of the input string
lib: new testcases for bitmap_parse{_user}
lib: rework bitmap_parse()
lib: make bitmap_parse_user a wrapper on bitmap_parse
lib: add test for bitmap_parse()
bitops: more BITS_TO_* macros
lib/string: add strnchrnul()
proc: convert everything to "struct proc_ops"
proc: decouple proc from VFS with "struct proc_ops"
asm-generic/tlb: provide MMU_GATHER_TABLE_FREE
asm-generic/tlb: rename HAVE_MMU_GATHER_NO_GATHER
asm-generic/tlb: rename HAVE_MMU_GATHER_PAGE_SIZE
asm-generic/tlb: rename HAVE_RCU_TABLE_FREE
asm-generic/tlb: add missing CONFIG symbol
asm-gemeric/tlb: remove stray function declarations
asm-generic/tlb: avoid potential double flush
mm/mmu_gather: invalidate TLB correctly on batch allocation failure and flush
powerpc/mmu_gather: enable RCU_TABLE_FREE even for !SMP case
...
2020-02-04 07:24:48 +00:00
Linus Torvalds
9717c1cea1
Merge tag 'drm-next-2020-02-04' of git://anongit.freedesktop.org/drm/drm
...
Pull drm ttm/mm updates from Dave Airlie:
"Thomas Hellstrom has some more changes to the TTM layer that needed a
patch to the mm subsystem.
This adds a new mm API vmf_insert_mixed_prot to avoid an ugly hack
that has limitations in the TTM layer"
* tag 'drm-next-2020-02-04' of git://anongit.freedesktop.org/drm/drm:
mm, drm/ttm: Fix vm page protection handling
mm: Add a vmf_insert_mixed_prot() function
2020-02-04 07:21:04 +00:00
Alexey Dobriyan
97a32539b9
proc: convert everything to "struct proc_ops"
...
The most notable change is DEFINE_SHOW_ATTRIBUTE macro split in
seq_file.h.
Conversion rule is:
llseek => proc_lseek
unlocked_ioctl => proc_ioctl
xxx => proc_xxx
delete ".owner = THIS_MODULE" line
[akpm@linux-foundation.org: fix drivers/isdn/capi/kcapi_proc.c]
[sfr@canb.auug.org.au: fix kernel/sched/psi.c]
Link: http://lkml.kernel.org/r/20200122180545.36222f50@canb.auug.org.au
Link: http://lkml.kernel.org/r/20191225172546.GB13378@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com >
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:26 +00:00
Peter Zijlstra
0d6e24d430
asm-generic/tlb: provide MMU_GATHER_TABLE_FREE
...
As described in the comment, the correct order for freeing pages is:
1) unhook page
2) TLB invalidate page
3) free page
This order equally applies to page directories.
Currently there are two correct options:
- use tlb_remove_page(), when all page directores are full pages and
there are no futher contraints placed by things like software
walkers (HAVE_FAST_GUP).
- use MMU_GATHER_RCU_TABLE_FREE and tlb_remove_table() when the
architecture does not do IPI based TLB invalidate and has
HAVE_FAST_GUP (or software TLB fill).
This however leaves architectures that don't have page based directories
but don't need RCU in a bind. For those, provide MMU_GATHER_TABLE_FREE,
which provides the independent batching for directories without the
additional RCU freeing.
Link: http://lkml.kernel.org/r/20200116064531.483522-10-aneesh.kumar@linux.ibm.com
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org >
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:26 +00:00
Peter Zijlstra
580a586c40
asm-generic/tlb: rename HAVE_MMU_GATHER_NO_GATHER
...
Towards a more consistent naming scheme.
Link: http://lkml.kernel.org/r/20200116064531.483522-9-aneesh.kumar@linux.ibm.com
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org >
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:26 +00:00
Peter Zijlstra
3af4bd0337
asm-generic/tlb: rename HAVE_MMU_GATHER_PAGE_SIZE
...
Towards a more consistent naming scheme.
Link: http://lkml.kernel.org/r/20200116064531.483522-8-aneesh.kumar@linux.ibm.com
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org >
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:26 +00:00
Peter Zijlstra
ff2e6d7259
asm-generic/tlb: rename HAVE_RCU_TABLE_FREE
...
Towards a more consistent naming scheme.
[akpm@linux-foundation.org: fix sparc64 Kconfig]
Link: http://lkml.kernel.org/r/20200116064531.483522-7-aneesh.kumar@linux.ibm.com
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org >
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:26 +00:00
Peter Zijlstra
0ed1325967
mm/mmu_gather: invalidate TLB correctly on batch allocation failure and flush
...
Architectures for which we have hardware walkers of Linux page table
should flush TLB on mmu gather batch allocation failures and batch flush.
Some architectures like POWER supports multiple translation modes (hash
and radix) and in the case of POWER only radix translation mode needs the
above TLBI. This is because for hash translation mode kernel wants to
avoid this extra flush since there are no hardware walkers of linux page
table. With radix translation, the hardware also walks linux page table
and with that, kernel needs to make sure to TLB invalidate page walk cache
before page table pages are freed.
More details in commit d86564a2f0 ("mm/tlb, x86/mm: Support invalidating
TLB caches for RCU_TABLE_FREE")
The changes to sparc are to make sure we keep the old behavior since we
are now removing HAVE_RCU_TABLE_NO_INVALIDATE. The default value for
tlb_needs_table_invalidate is to always force an invalidate and sparc can
avoid the table invalidate. Hence we define tlb_needs_table_invalidate to
false for sparc architecture.
Link: http://lkml.kernel.org/r/20200116064531.483522-3-aneesh.kumar@linux.ibm.com
Fixes: a46cc7a90f ("powerpc/mm/radix: Improve TLB/PWC flushes")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com >
Acked-by: Michael Ellerman <mpe@ellerman.id.au > [powerpc]
Cc: <stable@vger.kernel.org > [4.14+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:26 +00:00
Steven Price
e47690d756
x86: mm: avoid allocating struct mm_struct on the stack
...
struct mm_struct is quite large (~1664 bytes) and so allocating on the
stack may cause problems as the kernel stack size is small.
Since ptdump_walk_pgd_level_core() was only allocating the structure so
that it could modify the pgd argument we can instead introduce a pgd
override in struct mm_walk and pass this down the call stack to where it
is needed.
Since the correct mm_struct is now being passed down, it is now also
unnecessary to take the mmap_sem semaphore because ptdump_walk_pgd() will
now take the semaphore on the real mm.
[steven.price@arm.com: restore missed arm64 changes]
Link: http://lkml.kernel.org/r/20200108145710.34314-1-steven.price@arm.com
Link: http://lkml.kernel.org/r/20200108145710.34314-1-steven.price@arm.com
Signed-off-by: Steven Price <steven.price@arm.com >
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David S. Miller <davem@davemloft.net >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Hogan <jhogan@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: "Liang, Kan" <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zong Li <zong.li@sifive.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:25 +00:00
Steven Price
f8f0d0b6fa
mm: ptdump: reduce level numbers by 1 in note_page()
...
Rather than having to increment the 'depth' number by 1 in ptdump_hole(),
let's change the meaning of 'level' in note_page() since that makes the
code simplier.
Note that for x86, the level numbers were previously increased by 1 in
commit 45dcd20913 ("x86/mm/dump_pagetables: Fix printout of p4d level")
and the comment "Bit 7 has a different meaning" was not updated, so this
change also makes the code match the comment again.
Link: http://lkml.kernel.org/r/20191218162402.45610-24-steven.price@arm.com
Signed-off-by: Steven Price <steven.price@arm.com >
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David S. Miller <davem@davemloft.net >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Hogan <jhogan@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: "Liang, Kan" <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zong Li <zong.li@sifive.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:25 +00:00
Steven Price
30d621f672
mm: add generic ptdump
...
Add a generic version of page table dumping that architectures can opt-in
to.
Link: http://lkml.kernel.org/r/20191218162402.45610-20-steven.price@arm.com
Signed-off-by: Steven Price <steven.price@arm.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David S. Miller <davem@davemloft.net >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Hogan <jhogan@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: "Liang, Kan" <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zong Li <zong.li@sifive.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:25 +00:00
Steven Price
b7a16c7ad7
mm: pagewalk: add 'depth' parameter to pte_hole
...
The pte_hole() callback is called at multiple levels of the page tables.
Code dumping the kernel page tables needs to know what at what depth the
missing entry is. Add this is an extra parameter to pte_hole(). When the
depth isn't know (e.g. processing a vma) then -1 is passed.
The depth that is reported is the actual level where the entry is missing
(ignoring any folding that is in place), i.e. any levels where
PTRS_PER_P?D is set to 1 are ignored.
Note that depth starts at 0 for a PGD so that PUD/PMD/PTE retain their
natural numbers as levels 2/3/4.
Link: http://lkml.kernel.org/r/20191218162402.45610-16-steven.price@arm.com
Signed-off-by: Steven Price <steven.price@arm.com >
Tested-by: Zong Li <zong.li@sifive.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David S. Miller <davem@davemloft.net >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Hogan <jhogan@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: "Liang, Kan" <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Will Deacon <will@kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:25 +00:00
Steven Price
c02a98753e
mm: pagewalk: fix termination condition in walk_pte_range()
...
If walk_pte_range() is called with a 'end' argument that is beyond the
last page of memory (e.g. ~0UL) then the comparison between 'addr' and
'end' will always fail and the loop will be infinite. Instead change the
comparison to >= while accounting for overflow.
Link: http://lkml.kernel.org/r/20191218162402.45610-15-steven.price@arm.com
Signed-off-by: Steven Price <steven.price@arm.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David S. Miller <davem@davemloft.net >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Hogan <jhogan@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: "Liang, Kan" <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zong Li <zong.li@sifive.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:25 +00:00
Steven Price
fbf56346b8
mm: pagewalk: don't lock PTEs for walk_page_range_novma()
...
walk_page_range_novma() can be used to walk page tables or the kernel or
for firmware. These page tables may contain entries that are not backed
by a struct page and so it isn't (in general) possible to take the PTE
lock for the pte_entry() callback. So update walk_pte_range() to only
take the lock when no_vma==false by splitting out the inner loop to a
separate function and add a comment explaining the difference to
walk_page_range_novma().
Link: http://lkml.kernel.org/r/20191218162402.45610-14-steven.price@arm.com
Signed-off-by: Steven Price <steven.price@arm.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David S. Miller <davem@davemloft.net >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Hogan <jhogan@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: "Liang, Kan" <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zong Li <zong.li@sifive.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:25 +00:00
Steven Price
488ae6a2b9
mm: pagewalk: allow walking without vma
...
Since 48684a65b4 : "mm: pagewalk: fix misbehavior of walk_page_range for
vma(VM_PFNMAP)", page_table_walk() will report any kernel area as a hole,
because it lacks a vma.
This means each arch has re-implemented page table walking when needed,
for example in the per-arch ptdump walker.
Remove the requirement to have a vma in the generic code and add a new
function walk_page_range_novma() which ignores the VMAs and simply walks
the page tables.
Link: http://lkml.kernel.org/r/20191218162402.45610-13-steven.price@arm.com
Signed-off-by: Steven Price <steven.price@arm.com >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David S. Miller <davem@davemloft.net >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Hogan <jhogan@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: "Liang, Kan" <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zong Li <zong.li@sifive.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:25 +00:00
Steven Price
3afc423632
mm: pagewalk: add p4d_entry() and pgd_entry()
...
pgd_entry() and pud_entry() were removed by commit 0b1fbfe500
("mm/pagewalk: remove pgd_entry() and pud_entry()") because there were no
users. We're about to add users so reintroduce them, along with
p4d_entry() as we now have 5 levels of tables.
Note that commit a00cc7d9dd ("mm, x86: add support for PUD-sized
transparent hugepages") already re-added pud_entry() but with different
semantics to the other callbacks. This commit reverts the semantics back
to match the other callbacks.
To support hmm.c which now uses the new semantics of pud_entry() a new
member ('action') of struct mm_walk is added which allows the callbacks to
either descend (ACTION_SUBTREE, the default), skip (ACTION_CONTINUE) or
repeat the callback (ACTION_AGAIN). hmm.c is then updated to call
pud_trans_huge_lock() itself and make use of the splitting/retry logic of
the core code.
After this change pud_entry() is called for all entries, not just
transparent huge pages.
[arnd@arndb.de: fix unused variable warning]
Link: http://lkml.kernel.org/r/20200107204607.1533842-1-arnd@arndb.de
Link: http://lkml.kernel.org/r/20191218162402.45610-12-steven.price@arm.com
Signed-off-by: Steven Price <steven.price@arm.com >
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Cc: Albert Ou <aou@eecs.berkeley.edu >
Cc: Alexandre Ghiti <alex@ghiti.fr >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David S. Miller <davem@davemloft.net >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Hogan <jhogan@kernel.org >
Cc: James Morse <james.morse@arm.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: "Liang, Kan" <kan.liang@linux.intel.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Paul Walmsley <paul.walmsley@sifive.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Will Deacon <will@kernel.org >
Cc: Zong Li <zong.li@sifive.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:25 +00:00
Florian Westphal
1c948715a1
mm: remove __krealloc
...
Since 5.5-rc1 the last user of this function is gone, so remove the
functionality.
See commit
2ad9d7747c ("netfilter: conntrack: free extension area immediately")
for details.
Link: http://lkml.kernel.org/r/20191212223442.22141-1-fw@strlen.de
Signed-off-by: Florian Westphal <fw@strlen.de >
Acked-by: Andrew Morton <akpm@linux-foundation.org >
Acked-by: David Rientjes <rientjes@google.com >
Reviewed-by: David Hildenbrand <david@redhat.com >
Cc: Christoph Lameter <cl@linux.com >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:24 +00:00
David Hildenbrand
9291799884
mm/memory_hotplug: drop valid_start/valid_end from test_pages_in_a_zone()
...
The callers are only interested in the actual zone, they don't care about
boundaries. Return the zone instead to simplify.
Link: http://lkml.kernel.org/r/20200110183308.11849-1-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Michal Hocko <mhocko@suse.com >
Cc: Oscar Salvador <osalvador@suse.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:23 +00:00