Re: [PATCH] mm/memcontrol:rewrite mem_cgroup_page_lruvec()

2020-11-06 Thread Andrew Morton
On Wed, 4 Nov 2020 22:25:16 +0800 Hui Su wrote: > mem_cgroup_page_lruvec() in memcontrol.c and > mem_cgroup_lruvec() in memcontrol.h is very similar > except for the param(page and memcg) which also can be > convert to each other. > > So rewrite mem_cgroup_page_lruvec() with mem_cgroup_lruvec().

Re: [PATCH 1/2] mm: mmap: fix fput in error path v2

2020-11-06 Thread Andrew Morton
On Fri, 6 Nov 2020 12:48:05 +0100 "Christian König" wrote: > Patch "495c10cc1c0c CHROMIUM: dma-buf: restore args..." > adds a workaround for a bug in mmap_region. > > As the comment states ->mmap() callback can change > vma->vm_file and so we might call fput() on the wrong file. > > Revert th

Re: [PATCH v2] reboot: allow to specify reboot mode via sysfs

2020-11-06 Thread Andrew Morton
On Fri, 6 Nov 2020 21:07:04 +0100 Matteo Croce wrote: > The kernel cmdline reboot= option offers some sort of control > on how the reboot is issued. > Add handles in sysfs to allow setting these reboot options, so they > can be changed when the system is booted, other than at boot time. Please

Re: [PATCH] compiler-clang: remove version check for BPF Tracing

2020-11-04 Thread Andrew Morton
On Wed, 4 Nov 2020 11:10:51 -0800 Nick Desaulniers wrote: > bpftrace parses the kernel headers and uses Clang under the hood. Remove > the version check when __BPF_TRACING__ is defined (as bpftrace does) so > that this tool can continue to parse kernel headers, even with older > clang sources.

Re: [PATCH v7 0/9] KFENCE: A low-overhead sampling-based memory safety error detector

2020-11-03 Thread Andrew Morton
On Tue, 3 Nov 2020 18:58:32 +0100 Marco Elver wrote: > This adds the Kernel Electric-Fence (KFENCE) infrastructure. KFENCE is a > low-overhead sampling-based memory safety error detector of heap > use-after-free, invalid-free, and out-of-bounds access errors. This > series enables KFENCE for th

Re: [PATCH] proc: Provide details on indirect branch speculation

2020-10-31 Thread Andrew Morton
On Fri, 30 Oct 2020 17:27:54 +1100 Anand K Mistry wrote: > Similar to speculation store bypass, show information about the indirect > branch speculation mode of a task in /proc/$pid/status. Why is this considered useful?

Re: [PATCH] mm/compaction: count pages and stop correctly during page isolation.

2020-10-29 Thread Andrew Morton
On Thu, 29 Oct 2020 17:31:28 -0400 Zi Yan wrote: > > > > Shall you add Fixes tag to commit > > 1da2f328fa643bd72197dfed0c655148af31e4eb? And may cc stable. > > Sure. > > Fixes: 1da2f328fa64 (“mm,thp,compaction,cma: allow THP migration for CMA > allocations”) > > stable cc'ed. A think a cc:st

Re: + mm-memcontrol-correct-the-nr_anon_thps-counter-of-hierarchical-memcg-fix.patch added to -mm tree

2020-10-28 Thread Andrew Morton
On Tue, 27 Oct 2020 08:21:57 +0100 Michal Hocko wrote: > > --- > > a/mm/memcontrol.c~mm-memcontrol-correct-the-nr_anon_thps-counter-of-hierarchical-memcg-fix > > +++ a/mm/memcontrol.c > > @@ -4107,7 +4107,7 @@ static int memcg_stat_show(struct seq_fi > > if (memcg1_stats[i] == NR_ANO

Re: [PATCH] mm: Fix a race during split THP

2020-10-28 Thread Andrew Morton
On Tue, 27 Oct 2020 11:25:19 +0100 Michal Hocko wrote: > I have noticed this fix and I do not see it in the mmotm tree. > Is there anything blocking this patch or it simply fall through cracks? It's merged into mainline. Perhaps the grammatical fixlet in the title tricked you... commit c4f9c70

Re: [PATCH v3] mm/oom_kill: remove comment and rename is_dump_unreclaim_slabs()

2020-10-28 Thread Andrew Morton
On Wed, 28 Oct 2020 23:31:41 +0800 Hui Su wrote: > Comment for is_dump_unreclaim_slabs is not really clear whether it is > meant to instruct how to use the function or whether it is an outdated > information of the past implementation of the function. it doesn't realy > help that is_dump_unreclai

Re: [PATCH] mm: swap: Use memset to fill the swap_map with SWAP_HAS_CACHE

2020-10-25 Thread Andrew Morton
On Mon, 21 Sep 2020 08:22:24 -0400 Miaohe Lin wrote: > We could use helper memset to fill the swap_map with SWAP_HAS_CACHE instead > of a direct loop here to simplify the code. Also we can remove the local > variable i and map this way. > > ... > > --- a/mm/swapfile.c > +++ b/mm/swapfile.c > @@

Re: [PATCH] mm/swap_state: Skip meaningless swap cache readahead when ra_info.win == 0

2020-10-25 Thread Andrew Morton
On Fri, 9 Oct 2020 09:30:59 -0400 Miaohe Lin wrote: > swap_ra_info() may leave ra_info untouched in non_swap_entry() case as page > table lock is not held. In this case, we have ra_info.nr_pte == 0 and it is > meaningless to continue with swap cache readahead. Skip such ops by init > ra_info.win

Re: drivers/video/backlight/ltv350qv.c:192:12: warning: stack frame size of 13472 bytes in function 'ltv350qv_power'

2020-10-25 Thread Andrew Morton
On Mon, 26 Oct 2020 02:15:37 +0800 kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: d76913908102044f14381df865bb74df17a538cb > commit: cae9dc35ed9ff82a99754e51d57ff6c332e1f7e4 kasan: allow enabling stack > tagging for tag-b

Re: [PATCH] mm: bio_alloc never fails when set GFP_NOIO, GFP_KERNEL

2020-10-25 Thread Andrew Morton
On Wed, 21 Oct 2020 11:11:28 +0800 Xianting Tian wrote: > bio_alloc with __GFP_DIRECT_RECLAIM(which is included in GFP_NOIO, > GFP_KERNEL) never fails, as stated in the comments of bio_alloc_bioset. > > So we can remove multiple unneeded null checks of bio_alloc and simplify > the code. > > We

Re: [PATCH] mm: memcontrol: add file_thp, shmem_thp to memory.stat

2020-10-25 Thread Andrew Morton
On Thu, 22 Oct 2020 11:18:44 -0400 Johannes Weiner wrote: > As huge page usage in the page cache and for shmem files proliferates > in our production environment, the performance monitoring team has > asked for per-cgroup stats on those pages. > > We already track and export anon_thp per cgroup.

Re: [PATCH] mm/memcg: fix device private memcg accounting

2020-10-09 Thread Andrew Morton
On Fri, 9 Oct 2020 14:59:52 -0700 Ralph Campbell wrote: > The code in mc_handle_swap_pte() checks for non_swap_entry() and returns > NULL before checking is_device_private_entry() so device private pages > are never handled. > Fix this by checking for non_swap_entry() after handling device privat

Re: [PATCH 1/6] mm: mmap: fix fput in error path

2020-10-09 Thread Andrew Morton
On Fri, 9 Oct 2020 17:03:37 +0200 "Christian König" wrote: > Patch "495c10cc1c0c CHROMIUM: dma-buf: restore args..." > adds a workaround for a bug in mmap_region. > > As the comment states ->mmap() callback can change > vma->vm_file and so we might call fput() on the wrong file. > > Revert th

Re: [PATCH] mm: mmap: Fix general protection fault in unlink_file_vma()

2020-10-08 Thread Andrew Morton
On Thu, 8 Oct 2020 07:17:18 + linmiaohe wrote: > Andrew Morton wrote: > > On Wed, 16 Sep 2020 05:07:33 -0400 Miaohe Lin wrote: > > > >> The syzbot reported the below general protection fault: > >> > >> general protection fault, probably for non

Re: [PATCH] mm: mmap: Fix general protection fault in unlink_file_vma()

2020-10-07 Thread Andrew Morton
On Wed, 16 Sep 2020 05:07:33 -0400 Miaohe Lin wrote: > The syzbot reported the below general protection fault: > > general protection fault, probably for non-canonical address > 0xe00eeaee003b: [#1] PREEMPT SMP KASAN > KASAN: maybe wild-memory-access in range > [0x007001d8-0x007

Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM

2020-10-05 Thread Andrew Morton
On Mon, 5 Oct 2020 14:47:47 -0300 Jason Gunthorpe wrote: > Andrew please let me know if you need a resend Andrew is rather confused. Can we please identify the minimal patch(es) which are needed for 5.9 and -stable?

Re: [PATCH] checkpatch: Emit a warning on embedded filenames

2020-10-02 Thread Andrew Morton
On Thu, 01 Oct 2020 11:28:10 -0700 Joe Perches wrote: > Embedding the complete filename path inside the file > isn't particularly useful as often the path is moved > around and becomes incorrect. > > Emit a warning when the source contains the filename. > > ... > > --- a/scripts/checkpatch.pl >

Re: [PATCH 1/1] selftests/vm: 8x compaction_test speedup

2020-10-02 Thread Andrew Morton
On Fri, 2 Oct 2020 01:06:21 -0700 John Hubbard wrote: > This patch reduces the running time for compaction_test from about 27 > sec, to 3.3 sec, which is about an 8x speedup. > > These numbers are for an Intel x86_64 system with 32 GB of DRAM. > > The compaction_test.c program was spending most

Re: [PATCH v2 2/2] selftests/vm: fix run_vmtest.sh: restore executable bits, and "s" in name

2020-10-02 Thread Andrew Morton
On Fri, 2 Oct 2020 01:40:49 -0700 John Hubbard wrote: > commit cb2ab76685d7 ("selftests/vm: rename run_vmtests --> > run_vmtests.sh") changed the name of run_vmtests to run_vmtest.sh, but > inadvertently dropped the executable bits. We cannot depend on the x bit. Because downloading linux-foo.p

Re: [PATCH v2 for v5.9] mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs

2020-09-28 Thread Andrew Morton
On Tue, 29 Sep 2020 10:28:05 +0900 Joonsoo Kim wrote: > > What about manually emptying the pcplists beforehand? > > It also increases the probability. schedule() or interrupt after emptying but > before the allocation could invalidate the effect. Keep local interrupts disabled across the pcp dr

Re: [PATCH v2] page_alloc: Fix freeing non-compound pages

2020-09-28 Thread Andrew Morton
On Tue, 29 Sep 2020 02:17:19 +0100 Matthew Wilcox wrote: > On Mon, Sep 28, 2020 at 06:03:07PM -0700, Andrew Morton wrote: > > On Sat, 26 Sep 2020 22:39:19 +0100 "Matthew Wilcox (Oracle)" > > wrote: > > > > > Here is a very rare race which leaks memory:

Re: [PATCH v2] page_alloc: Fix freeing non-compound pages

2020-09-28 Thread Andrew Morton
On Sat, 26 Sep 2020 22:39:19 +0100 "Matthew Wilcox (Oracle)" wrote: > Here is a very rare race which leaks memory: Not worth a cc:stable? > Page P0 is allocated to the page cache. Page P1 is free. > > Thread AThread BThread C > find_get_entry(): > xas_load() r

Re: [PATCH v3] mm/hmm/test: use after free in dmirror_allocate_chunk()

2020-09-28 Thread Andrew Morton
On Sat, 26 Sep 2020 19:17:20 -0300 Jason Gunthorpe wrote: > On Sat, Sep 26, 2020 at 03:14:02PM +0300, Dan Carpenter wrote: > > The error handling code does this: > > > > err_free: > > kfree(devmem); > > ^ > > err_release: > > release_mem_region(devmem->pagemap.range.s

Re: [PATCH v2 for v5.9] mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs

2020-09-28 Thread Andrew Morton
On Mon, 28 Sep 2020 17:50:46 +0900 js1...@gmail.com wrote: > From: Joonsoo Kim > > memalloc_nocma_{save/restore} APIs can be used to skip page allocation > on CMA area, but, there is a missing case and the page on CMA area could > be allocated even if APIs are used. This patch handles this case

Re: [PATCH] mm: __do_fault: fix pte_alloc_one spelling

2020-09-28 Thread Andrew Morton
On Mon, 28 Sep 2020 17:48:36 +0300 Mike Rapoport wrote: > ping? August 18, from Yanfei Xu: https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-memory-fix-typo-in-__do_fault-comment.patch

Re: [PATCH] mm: remove unused early_pfn_valid()

2020-09-28 Thread Andrew Morton
On Mon, 28 Sep 2020 17:49:00 +0300 Mike Rapoport wrote: > ping? > Merged Sep 24. https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-remove-unused-early_pfn_valid.patch

Re: remove alloc_vm_area v2

2020-09-25 Thread Andrew Morton
On Thu, 24 Sep 2020 15:58:42 +0200 Christoph Hellwig wrote: > this series removes alloc_vm_area, which was left over from the big > vmalloc interface rework. It is a rather arkane interface, basicaly > the equivalent of get_vm_area + actually faulting in all PTEs in > the allocated area. It was

Re: [PATCH v5 15/17] device-dax: add an 'align' attribute

2020-09-25 Thread Andrew Morton
On Fri, 25 Sep 2020 12:13:04 -0700 Dan Williams wrote: > Introduce a device align attribute. While doing so, rename the region > align attribute to be more explicitly named as so, but keep it named as > @align to retain the API for tools like daxctl. > > Changes on align may not always be vali

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-24 Thread Andrew Morton
On Fri, 25 Sep 2020 11:06:53 +0800 "Huang\, Ying" wrote: > >> UGH! I missed adding it to my cc list. Shall I just forward it, now, or > >> do you prefer a fresh repost? > > > > I added the cc:stable to my copy. > > Please don't merge this patch. This patch doesn't fix the bug, but hide > the re

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-24 Thread Andrew Morton
On Wed, 23 Sep 2020 09:42:51 -0400 Rafael Aquini wrote: > On Tue, Sep 22, 2020 at 12:47:50PM -0700, Andrew Morton wrote: > > On Tue, 22 Sep 2020 14:48:38 -0400 Rafael Aquini wrote: > > > > > The swap area descriptor only gets struct swap_cluster_info *cluster_inf

Re: [v3 1/2] mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged

2020-09-24 Thread Andrew Morton
On Wed, 23 Sep 2020 14:27:30 -0700 Vijay Balakrishna wrote: > Can this patch be included? As Kirill is ok with patch now. He is? I can't immediately find that email. Do we have an acked-by?

Re: [PATCH v2] mm/mempool: Add 'else' to split mutually exclusive case

2020-09-24 Thread Andrew Morton
On Thu, 24 Sep 2020 07:16:41 -0400 Miaohe Lin wrote: > Add else to split mutually exclusive case and avoid some unnecessary check. > It doesn't seem to change code generation (compiler is smart), but I think > it helps readability. > > ... > > --- a/mm/mempool.c > +++ b/mm/mempool.c > @@ -58,11

Re: [PATCH v6 0/6] mm: introduce memfd_secret system call to create "secret" memory areas

2020-09-24 Thread Andrew Morton
On Thu, 24 Sep 2020 16:28:58 +0300 Mike Rapoport wrote: > From: Mike Rapoport > > Hi, > > This is an implementation of "secret" mappings backed by a file descriptor. > I've dropped the boot time reservation patch for now as it is not strictly > required for the basic usage and can be easily a

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-22 Thread Andrew Morton
On Tue, 22 Sep 2020 14:48:38 -0400 Rafael Aquini wrote: > The swap area descriptor only gets struct swap_cluster_info *cluster_info > allocated if the swapfile is backed by non-rotational storage. > When the swap area is laid on top of ordinary disk spindles, lock_cluster() > will naturally retur

Re: [PATCH 0/2] mm,swap: skip swap readahead for instant IO (like zswap)

2020-09-22 Thread Andrew Morton
On Mon, 21 Sep 2020 22:01:46 -0400 Rik van Riel wrote: > Both with frontswap/zswap, and with some extremely fast IO devices, > swap IO will be done before the "asynchronous" swap_readpage() call > has returned. > > In that case, doing swap readahead only wastes memory, increases > latency, and i

Re: [PATCH v7 00/14] HWPOISON: soft offline rework

2020-09-22 Thread Andrew Morton
On Tue, 22 Sep 2020 15:56:36 +0200 Oscar Salvador wrote: > This patchset is the latest version of soft offline rework patchset > targetted for v5.9. Thanks. Where do we now stand with the followon patches: mmhwpoison-take-free-pages-off-the-buddy-freelists.patch mmhwpoison-drain-pcplists-befor

Re: [PATCH] Only allow to set crash_kexec_post_notifiers on boot time

2020-09-18 Thread Andrew Morton
On Fri, 18 Sep 2020 11:25:46 +0800 Dave Young wrote: > crash_kexec_post_notifiers enables running various panic notifier > before kdump kernel booting. This increases risks of kdump failure. > It is well documented in kernel-parameters.txt. We do not suggest > people to enable it together with kd

Re: [PATCH v6 08/12] mm,hwpoison: Rework soft offline for in-use pages

2020-09-18 Thread Andrew Morton
On Fri, 18 Sep 2020 09:58:22 +0200 osalva...@suse.de wrote: > I just found out yesterday that the patchset Naoya sent has diverged > from mine in some aspects that lead to some bugs [1]. > This was due to a misunderstanding so no blame here. > So, patch#8 and patch#9 need a little tweak [2]. > >

Re: [PATCH v3 1/3] mm: replace memmap_context by meminit_context

2020-09-16 Thread Andrew Morton
On Wed, 16 Sep 2020 18:09:55 +0200 Laurent Dufour wrote: > >>> It's up to the maintainer what they want, but as it is, this patch is > >>> not going to end up in stable kernel release (which it looks like is the > >>> right thing to do...) > >> > >> Thanks a lot Greg. > >> > >> I'll send that sin

Re: [PATCH v5 0/5] mm: introduce memfd_secret system call to create "secret" memory areas

2020-09-16 Thread Andrew Morton
On Wed, 16 Sep 2020 10:35:34 +0300 Mike Rapoport wrote: > This is an implementation of "secret" mappings backed by a file descriptor. > I've dropped the boot time reservation patch for now as it is not strictly > required for the basic usage and can be easily added later either with or > without

Re: [PATCH] mm/page_alloc.c: avoid inheritting current's flags when invoked in interrupt

2020-09-15 Thread Andrew Morton
On Tue, 15 Sep 2020 15:56:35 +0800 wrote: > From: Yanfei Xu > > alloc_mask shouldn't inherit the current task's flags when > __alloc_pages_nodemask is invoked in interrupt. > > ... > > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4889,7 +4889,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask,

Re: [PATCH] mm/page_alloc.c: variable type of 'progress' should be 'unsigned long'

2020-09-15 Thread Andrew Morton
On Tue, 15 Sep 2020 18:46:20 +0800 wrote: > From: Yanfei Xu > > try_to_free_pages returns the number of pages reclaimed, and the type of > returns is 'unsigned long'. So we should use a matched type for storing > it. > __perform_reclaim() returns an int, so this change is fairly pointless. H

Re: [RFC PATCH] fork: Free per-cpu cached vmalloc'ed thread stacks with

2020-09-13 Thread Andrew Morton
On Sat, 5 Sep 2020 00:12:29 + "Isaac J. Manjarres" wrote: > The per-cpu cached vmalloc'ed stacks are currently freed in the > CPU hotplug teardown path by the free_vm_stack_cache() callback, > which invokes vfree(), which may result in purging the list of > lazily freed vmap areas. > > Purg

Re: [PATCH] lib/string.c: Clarify kerndoc for stpcpy()

2020-09-13 Thread Andrew Morton
On Sun, 6 Sep 2020 13:26:32 -0700 Kees Cook wrote: > On Sun, Sep 06, 2020 at 12:08:09PM -0400, Arvind Sankar wrote: > > On Sun, Sep 06, 2020 at 03:06:29AM -0700, Kees Cook wrote: > > > Fix the language around return values to indicate destination instead of > > > source. > > > > > > Reported-by:

Re: [PATCH] mm: memcontrol: Fix out-of-bounds on the buf returned by memory_stat_format

2020-09-12 Thread Andrew Morton
On Sat, 12 Sep 2020 23:51:00 +0800 Muchun Song wrote: > The memory_stat_format() returns a format string, but the return buf > may not including the trailing '\0'. So the users may read the buf > out of bounds. That sounds serious. Is a cc:stable appropriate?

Re: [PATCH v2 03/10] mm/memory_hotplug: simplify page offlining

2020-09-04 Thread Andrew Morton
On Fri, 4 Sep 2020 07:47:45 +0200 David Hildenbrand wrote: > > > > + * PageBuddy on freed pages on other zones. > > + */ > > +if (ret) > > +drain_all_pages(zone); > > +} while (test_pages_isolated(start_pfn, end_pfn, MEMORY_OFFLINE)); > > I think we have

Re: [PATCH] mm/page_alloc.c: Clean code by removing unnecessary initialization

2020-09-04 Thread Andrew Morton
On Fri, 4 Sep 2020 15:24:22 +0200 mateusznos...@gmail.com wrote: > From: Mateusz Nosek > > Previously variable 'tmp' was initialized, but was not read later > before reassigning. So the initialization can be removed. > > ... > > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5637,7 +5637,

Re: [PATCH RFC] mm: Let readahead submit larger batches of pages in case of ra->ra_pages == 0

2020-09-04 Thread Andrew Morton
On Fri, 4 Sep 2020 16:48:07 +0200 Bean Huo wrote: > From: Bean Huo > > Current generic_file_buffered_read() will break up the larger batches of pages > and read data in single page length in case of ra->ra_pages == 0. This patch > is > to allow it to pass the batches of pages down to the devi

Re: [PATCH] mm: workingset: ignore slab memory size when calculating shadows pressure

2020-09-03 Thread Andrew Morton
On Thu, 3 Sep 2020 16:00:55 -0700 Roman Gushchin wrote: > In the memcg case count_shadow_nodes() sums the number of pages in lru > lists and the amount of slab memory (reclaimable and non-reclaimable) > as a baseline for the allowed number of shadow entries. > > It seems to be a good analogy for

Re: [PATCH v2 03/10] mm/memory_hotplug: simplify page offlining

2020-09-03 Thread Andrew Morton
ewed-by: Oscar Salvador Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Charan Teja Reddy Cc: Dan Williams Cc: Fenghua Yu Cc: Logan Gunthorpe Cc: "Matthew Wilcox (Oracle)" Cc: Mel Gorman Cc: Mel Gorman Cc: Michel Lespinasse Cc: Mike Rapoport Cc: Tony Luck Signed-off-by

Re: [PATCH] mm: check for memory's node later during boot

2020-09-03 Thread Andrew Morton
On Wed, 2 Sep 2020 11:09:11 +0200 Laurent Dufour wrote: > register_mem_sect_under_nodem() is checking the memory block's node id only > if the system state is "SYSTEM_BOOTING". On PowerPC, the memory blocks are > registered while the system state is "SYSTEM_SCHEDULING", the one before > SYSTEM_R

Re: [PATCH v2] mm/memory_hotplug: drain per-cpu pages again during memory offline

2020-09-03 Thread Andrew Morton
On Thu, 3 Sep 2020 19:36:26 +0200 David Hildenbrand wrote: > (still on vacation, back next week on Tuesday) > > I didn't look into discussions in v1, but to me this looks like we are > trying to hide an actual bug by implementing hacks in the caller > (repeated calls to drain_all_pages()). What

Re: [PATCH v4 1/2] memremap: rename MEMORY_DEVICE_DEVDAX to MEMORY_DEVICE_GENERIC

2020-08-31 Thread Andrew Morton
On Tue, 11 Aug 2020 11:44:46 +0200 Roger Pau Monne wrote: > This is in preparation for the logic behind MEMORY_DEVICE_DEVDAX also > being used by non DAX devices. Acked-by: Andrew Morton . Please add it to the Xen tree when appropriate. (I'm not sure what David means by "sep

Re: [RFC PATCH 0/2] mm/gup: fix gup_fast with dynamic page table folding

2020-08-31 Thread Andrew Morton
On Mon, 31 Aug 2020 13:53:36 +0200 Christian Borntraeger wrote: > > > On 28.08.20 16:03, Gerald Schaefer wrote: > have some feedback soon if option 1 or option 2 would be acceptable > from a common code perspective. Andrew, who of the mm people would > be the right one to decide? Jason and

Re: [PATCH v3 0/3] add fault injection to user memory access

2020-08-31 Thread Andrew Morton
On Mon, 31 Aug 2020 17:17:30 + albert.li...@gmail.com wrote: > The goal of this series is to improve testing of fault-tolerance in > usages of user memory access functions, by adding support for fault > injection. Does anyone actually plan to use this feature, on an ongoing basis? It's the s

Re: [PATCH] scripts: Add intended executable mode and SPDX license

2020-08-30 Thread Andrew Morton
On Thu, 27 Aug 2020 14:54:05 +0530 Mrinal Pandey wrote: > commit b72231eb7084 ("scripts: add spdxcheck.py self test") added the file > spdxcheck-test.sh to the repository without the executable flag and license > information. The x bit shouldn't matter. If someone downloads and applies patch-5.

Re: [PATCH for v5.9] mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs

2020-08-25 Thread Andrew Morton
On Tue, 25 Aug 2020 14:34:32 +0900 Joonsoo Kim wrote: > > > > That's a bunch more code on a very hot path to serve an obscure feature > > which has a single obscure callsite. > > > > Can we instead put the burden on that callsite rather than upon > > everyone? For (dumb) example, teach __gup_lon

Re: mmotm 2020-08-24-16-06 uploaded

2020-08-25 Thread Andrew Morton
On Tue, 25 Aug 2020 10:45:48 +0200 Oscar Salvador wrote: > On Mon, Aug 24, 2020 at 04:07:25PM -0700, a...@linux-foundation.org wrote: > > A full copy of the full kernel tree with the linux-next and mmotm patches > > already applied is available through git within an hour of the mmotm > > release.

Re: [PATCH 0/2][next] update gdb scripts for lockless printk ringbuffer

2020-08-25 Thread Andrew Morton
On Tue, 25 Aug 2020 14:35:42 +0200 Petr Mladek wrote: > Andrew, would you mind when I take the three gdb/lockless-printk > related changes via printk tree to avoid synchronization problems? No probs. If such patches turn up in linux-next I just drop my copy. After checking that the patches full

Re: [PATCH mmotm] x86/numa: fix build when CONFIG_ACPI is not set

2020-08-25 Thread Andrew Morton
On Tue, 25 Aug 2020 08:20:27 -0700 Randy Dunlap wrote: > From: Randy Dunlap > > Fix build errors when CONFIG_ACPI is not set/enabled by adding > in the #else (!CONFIG_ACPI) block. > > ../arch/x86/mm/numa.c: In function ‘numa_setup’: > ../arch/x86/mm/numa.c:43:3: error: implicit declaration of

Re: [PATCH for v5.9] mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs

2020-08-24 Thread Andrew Morton
On Tue, 25 Aug 2020 13:59:42 +0900 js1...@gmail.com wrote: > From: Joonsoo Kim > > memalloc_nocma_{save/restore} APIs can be used to skip page allocation > on CMA area, but, there is a missing case and the page on CMA area could > be allocated even if APIs are used. This patch handles this case

Re: [PATCH] mm/hugetlb: Fix a race between hugetlb sysctl handlers

2020-08-24 Thread Andrew Morton
On Sat, 22 Aug 2020 17:53:28 +0800 Muchun Song wrote: > There is a race between the assignment of `table->data` and write value > to the pointer of `table->data` in the __do_proc_doulongvec_minmax(). Where does __do_proc_doulongvec_minmax() write to table->data? I think you're saying that there

Re: [PATCH] mm/mempool: Add 'else' to split mutually exclusive case

2020-08-24 Thread Andrew Morton
On Mon, 24 Aug 2020 07:53:54 -0400 Miaohe Lin wrote: > Add else to split mutually exclusive case and avoid some unnecessary check. > > --- a/mm/mempool.c > +++ b/mm/mempool.c > @@ -60,9 +60,8 @@ static void check_element(mempool_t *pool, void *element) > /* Mempools backed by slab allocato

Re: [PATCH v18 00/32] per memcg lru_lock

2020-08-24 Thread Andrew Morton
On Mon, 24 Aug 2020 20:54:33 +0800 Alex Shi wrote: > The new version which bases on v5.9-rc2. The first 6 patches was picked into > linux-mm, and add patch 25-32 that do some further post optimization. 32 patches, version 18. That's quite heroic. I'm unsure whether I should merge it up at this

Re: [PATCH v2 1/2] mm: add GFP mask param to strndup_user

2020-08-21 Thread Andrew Morton
On Fri, 21 Aug 2020 20:28:26 -0700 Pascal Bouchareine wrote: > Let caller specify allocation. > Preserve existing calls with GFP_USER. > > 21 files changed, 65 insertions(+), 43 deletions(-) Why change all existing callsites so that one callsite can pass in a different gfp_t? > diff --git a/d

Re: [PATCH v4 00/23] device-dax: Support sub-dividing soft-reserved ranges

2020-08-21 Thread Andrew Morton
On Wed, 19 Aug 2020 18:53:57 -0700 Dan Williams wrote: > > I think I am missing some important pieces. Bear with me. > > No worries, also bear with me, I'm going to be offline intermittently > until at least mid-September. Hopefully Joao and/or Vishal can jump in > on this discussion. Ordinari

Re: [PATCH v4 15/23] device-dax: Add resize support

2020-08-21 Thread Andrew Morton
On Sun, 02 Aug 2020 22:03:46 -0700 Dan Williams wrote: > Make the device-dax 'size' attribute writable to allow capacity to be > split between multiple instances in a region. The intended consumers of > this capability are users that want to split a scarce memory resource > between device-dax an

Re: [PATCH v2] mm: Track page table modifications in __apply_to_page_range()

2020-08-21 Thread Andrew Morton
On Fri, 21 Aug 2020 14:37:46 +0200 Joerg Roedel wrote: > The __apply_to_page_range() function is also used to change and/or > allocate page-table pages in the vmalloc area of the address space. > Make sure these changes get synchronized to other page-tables in the > system by calling arch_sync_ke

Re: cma_alloc(), add sleep-and-retry for temporary page pinning

2020-08-21 Thread Andrew Morton
On Tue, 11 Aug 2020 15:20:47 -0700 cgold...@codeaurora.org wrote: > On 2020-08-06 18:31, Andrew Morton wrote: > > On Wed, 5 Aug 2020 19:56:21 -0700 Chris Goldsworthy > > wrote: > > > >> On mobile devices, failure to allocate from a CMA area constitutes a >

Re: [PATCH v5 0/6] mm / virtio-mem: support ZONE_MOVABLE

2020-08-21 Thread Andrew Morton
On Fri, 21 Aug 2020 10:45:33 +0200 David Hildenbrand wrote: > On 21.08.20 10:31, David Hildenbrand wrote: > > On 16.08.20 14:53, David Hildenbrand wrote: > >> For 5.10. Patch #1-#4,#6 have RBs or ACKs, patch #5 is virtio-mem stuff > >> maintained by me. This should go via the -mm tree. > >> > >

Re: [BUG RT] dump-capture kernel not executed for panic in interrupt context

2020-08-21 Thread Andrew Morton
On Fri, 21 Aug 2020 11:08:48 -0400 Steven Rostedt wrote: > On Fri, 21 Aug 2020 12:25:33 +0200 > Joerg Vehlow wrote: > > > Hi Andrew and Others (please read at least the part with @RT developers), > > > > > Yup, mutex_trylock() from interrupt is improper. Well dang, that's a > > > bit silly.

Re: [PATCH v2] mm: Track page table modifications in __apply_to_page_range()

2020-08-21 Thread Andrew Morton
On Fri, 21 Aug 2020 14:37:46 +0200 Joerg Roedel wrote: > The __apply_to_page_range() function is also used to change and/or > allocate page-table pages in the vmalloc area of the address space. > Make sure these changes get synchronized to other page-tables in the > system by calling arch_sync_ke

Re: [PATCH v6 06/12] powerpc: inline huge vmap supported functions

2020-08-21 Thread Andrew Morton
On Sat, 22 Aug 2020 01:12:10 +1000 Nicholas Piggin wrote: > #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP > -bool arch_vmap_p4d_supported(pgprot_t prot); > -bool arch_vmap_pud_supported(pgprot_t prot); > -bool arch_vmap_pmd_supported(pgprot_t prot); > +static inline bool arch_vmap_p4d_supported(pgprot_t pro

Re: [PATCH v6 05/12] mm: HUGE_VMAP arch support cleanup

2020-08-21 Thread Andrew Morton
On Sat, 22 Aug 2020 01:12:09 +1000 Nicholas Piggin wrote: > This changes the awkward approach where architectures provide init > functions to determine which levels they can provide large mappings for, > to one where the arch is queried for each call. > > This removes code and indirection, and a

Re: [PATCH v6 01/12] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2020-08-21 Thread Andrew Morton
On Sat, 22 Aug 2020 01:12:05 +1000 Nicholas Piggin wrote: > vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. > Whether or not a vmap is huge depends on the architecture details, > alignments, boot options, etc., which the caller can not be expected > to know. Therefore HUGE_V

Re: KASAN: use-after-free Read in do_madvise

2020-08-21 Thread Andrew Morton
On Fri, 21 Aug 2020 10:15:45 -0700 Yang Shi wrote: > It looks the vma is gone. The below patch should be able to fix it: > > diff --git a/mm/madvise.c b/mm/madvise.c > index dd1d43cf026d..d4aa5f776543 100644 > --- a/mm/madvise.c > +++ b/mm/madvise.c > @@ -289,9 +289,9 @@ static long madvise_will

Re: [PATCH v3 1/2] fs/binfmt_elf: Use PT_LOAD p_align values for suitable start address.

2020-08-20 Thread Andrew Morton
On Thu, 20 Aug 2020 13:05:40 -0400 Chris Kennelly wrote: > The current ELF loading mechancism provides page-aligned mappings. This > can lead to the program being loaded in a way unsuitable for > file-backed, transparent huge pages when handling PIE executables. > > For binaries built with incr

Re: mm/gup.c:1922:7: error: implicit declaration of function ‘is_valid_gup_flags’

2020-08-20 Thread Andrew Morton
~ > 353cc1: some warnings being treated as errors > Yes, thanks. From: Andrew Morton Subject: mm-gup-dont-permit-users-to-call-get_user_pages-with-foll_longterm-fix fix CONFIG_MMU=n build Link: https://lkml.kernel.org/r/ca+g9fyuns3k0dvt62twfv746pfnhcsrk5svmcocq1pggnes...@mail.gmail

mmotm 2020-08-19-16-09 uploaded

2020-08-19 Thread Andrew Morton
The mm-of-the-moment snapshot 2020-08-19-16-09 has been uploaded to https://www.ozlabs.org/~akpm/mmotm/ mmotm-readme.txt says README for mm-of-the-moment: https://www.ozlabs.org/~akpm/mmotm/ This is a snapshot of my -mm patch queue. Uploaded at random hopefully more than once a week. You

Re: [PATCH] mm: slub: re-initialize randomized freelist sequence in calculate_sizes

2020-08-19 Thread Andrew Morton
(cc Thomas and linux-mm) On Sat, 8 Aug 2020 13:50:30 +0400 kpark3...@gmail.com wrote: > From: Sahara > > Slab cache flags are exported to sysfs and are allowed to get modified > from userspace. Some of those may call calculate_sizes function because > the changed flag can take an effect on s

Re: [PATCH 1/2] mm/mmap: rename __vma_unlink_common() to __vma_unlink()

2020-08-19 Thread Andrew Morton
On Mon, 10 Aug 2020 07:20:56 +0800 Wei Yang wrote: > __vma_unlink_common() and __vma_unlink() are counterparts. Since there is I assume you meant "__vma_link()" here? > not function named __vma_unlink(), let's rename it to __vma_unlink() to > make the code more self-explain and easy for audien

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Andrew Morton
On Thu, 20 Aug 2020 03:56:13 +0800 Gao Xiang wrote: > SWP_FS doesn't mean the device is file-backed swap device, > which just means each writeback request should go through fs > by DIO. Or it'll just use extents added by .swap_activate(), > but it also works as file-backed swap device. This is v

Re: [PATCH] mm/slub: make add_full() condition more explicit

2020-08-19 Thread Andrew Morton
On Tue, 11 Aug 2020 10:02:36 +0800 wrote: > From: Abel Wu > > The commit below is incomplete, as it didn't handle the add_full() part. > commit a4d3f8916c65 ("slub: remove useless kmem_cache_debug() before > remove_full()") > > This patch checks for SLAB_STORE_USER instead of kmem_cache_debug

Re: [PATCH v3 09/17] memblock: make memblock_debug and related functionality private

2020-08-19 Thread Andrew Morton
On Tue, 18 Aug 2020 18:16:26 +0300 Mike Rapoport wrote: > From: Mike Rapoport > > The only user of memblock_dbg() outside memblock was s390 setup code and it > is converted to use pr_debug() instead. > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > of the kernel. >

Re: [PATCH v2] mm: include CMA pages in lowmem_reserve at boot

2020-08-19 Thread Andrew Morton
On Wed, 19 Aug 2020 10:30:25 -0700 Florian Fainelli wrote: > On 8/19/20 10:22 AM, Andrew Morton wrote: > > On Wed, 19 Aug 2020 10:15:53 -0700 Florian Fainelli > > wrote: > > > >>>> In many cases the difference is not significant, but for example > >

Re: [PATCH v2] mm: include CMA pages in lowmem_reserve at boot

2020-08-19 Thread Andrew Morton
On Wed, 19 Aug 2020 10:15:53 -0700 Florian Fainelli wrote: > >> In many cases the difference is not significant, but for example > >> an ARM platform with 1GB of memory and the following memory layout > >> [0.00] cma: Reserved 256 MiB at 0x3000 > >> [0.00] Zone ranges

Re: [PATCH] mm/slub: sysfs cleanup on cpu partial when !SLUB_CPU_PARTIAL

2020-08-18 Thread Andrew Morton
On Thu, 13 Aug 2020 16:48:54 +0800 wrote: > Hide cpu partial related sysfs entries when !CONFIG_SLUB_CPU_PARTIAL to > avoid confusion. > But it changes the userspace interface in ways which might cause existing code to misbehave? We just had to revert a different commit for this reason :( htt

Re: [PATCH v2] mm: include CMA pages in lowmem_reserve at boot

2020-08-18 Thread Andrew Morton
On Fri, 14 Aug 2020 09:49:26 -0700 Doug Berger wrote: > The lowmem_reserve arrays provide a means of applying pressure > against allocations from lower zones that were targeted at > higher zones. Its values are a function of the number of pages > managed by higher zones and are assigned by a call

Re: [PATCH] squashfs: avoid bio_alloc() failure with 1Mbyte blocks

2020-08-18 Thread Andrew Morton
On Fri, 14 Aug 2020 21:30:33 -0700 Guenter Roeck wrote: > On Fri, Aug 14, 2020 at 8:57 PM Phillip Lougher > wrote: > > > > This is a regression introduced by the "migrate from ll_rw_block usage > > to BIO" patch. > > > > Bio_alloc() is limited to 256 pages (1 Mbyte). This can cause a > > fail

Re: [PATCH] hugetlb_cgroup: convert comma to semicolon

2020-08-18 Thread Andrew Morton
On Tue, 18 Aug 2020 06:43:33 + Xu Wang wrote: > Replace a comma between expression statements by a semicolon. > > ... > > --- a/mm/hugetlb_cgroup.c > +++ b/mm/hugetlb_cgroup.c > @@ -655,7 +655,7 @@ static void __init __hugetlb_cgroup_file_dfl_init(int idx) > snprintf(cft->name, MAX_CFT

Re: KASAN: use-after-free Write in page_counter_uncharge

2020-08-18 Thread Andrew Morton
On Tue, 18 Aug 2020 07:50:28 -0700 syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:a1d21081 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=17ceb0ce90 > kernel con

Re: [PATCH] mm : sync ra->ra_pages with bdi->ra_pages

2020-08-15 Thread Andrew Morton
On Fri, 14 Aug 2020 13:10:34 -0700 Andrew Morton wrote: > On Fri, 14 Aug 2020 17:03:44 +0800 Zhaoyang Huang > wrote: > > > Some system(like android) will turbo read during startup via expanding the > > readahead window and then set it back to normal(128kb as usual

Re: [PATCH] mm : sync ra->ra_pages with bdi->ra_pages

2020-08-14 Thread Andrew Morton
On Fri, 14 Aug 2020 17:03:44 +0800 Zhaoyang Huang wrote: > Some system(like android) will turbo read during startup via expanding the > readahead window and then set it back to normal(128kb as usual). However, some > files in the system process context will keep to be opened since it is opened >

Re: [PATCH] bootconfig: Fix off-by-one in xbc_node_compose_key_after()

2020-08-13 Thread Andrew Morton
On Thu, 13 Aug 2020 18:30:50 -0400 Steven Rostedt wrote: > From: Steven Rostedt (VMware) > > While reviewing some patches for bootconfig, I noticed the following > code in xbc_node_compose_key_after(): > > ret = snprintf(buf, size, "%s%s", xbc_node_get_data(node), >

Re: [PATCH] mm : update ra->ra_pages if it's NOT equal to bdi->ra_pages

2020-08-13 Thread Andrew Morton
On Fri, 14 Aug 2020 10:20:11 +0800 Zhaoyang Huang wrote: > On Fri, Aug 14, 2020 at 10:07 AM Matthew Wilcox wrote: > > > > On Fri, Aug 14, 2020 at 02:43:55AM +0100, Matthew Wilcox wrote: > > > On Fri, Aug 14, 2020 at 09:30:11AM +0800, Zhaoyang Huang wrote: > > > > file->f_ra->ra_pages will remai

Re: [PATCH v2] sched, mm: Optimize current_gfp_context()

2020-08-11 Thread Andrew Morton
On Thu, 18 Jun 2020 17:29:36 -0400 Waiman Long wrote: > The current_gfp_context() converts a number of PF_MEMALLOC_* per-process > flags into the corresponding GFP_* flags for memory allocation. In > that function, current->flags is accessed 3 times. That may lead to > duplicated access of the sa

<    1   2   3   4   5   6   7   8   9   10   >