Re: [PATCH RFC 01/14] mm/memory: drop highest_memmap_pfn sanity check in vm_normal_page()

2025-07-11 Thread Hugh Dickins
On Fri, 11 Jul 2025, David Hildenbrand wrote: > On 08.07.25 04:52, Hugh Dickins wrote: > > > > Of course it's limited in what it can catch (and won't even get called > > if the present bit was not set - a more complete patch might unify with > > those various

Re: [PATCH RFC 01/14] mm/memory: drop highest_memmap_pfn sanity check in vm_normal_page()

2025-07-07 Thread Hugh Dickins
On Mon, 7 Jul 2025, David Hildenbrand wrote: > On 07.07.25 08:31, Hugh Dickins wrote: > > On Fri, 4 Jul 2025, David Hildenbrand wrote: > >> On 03.07.25 16:44, Lance Yang wrote: > >>> On 2025/7/3 20:39, David Hildenbrand wrote: > >>>> On 03.07.25 14

Re: [PATCH RFC 01/14] mm/memory: drop highest_memmap_pfn sanity check in vm_normal_page()

2025-07-06 Thread Hugh Dickins
On Fri, 4 Jul 2025, David Hildenbrand wrote: > On 03.07.25 16:44, Lance Yang wrote: > > On 2025/7/3 20:39, David Hildenbrand wrote: > >> On 03.07.25 14:34, Lance Yang wrote: > >>> On Mon, Jun 23, 2025 at 10:04 PM David Hildenbrand > >>> wrote: > > On 20.06.25 14:50, Oscar Salvador wrote:

Re: [PATCH 00/10] mm/mremap: permit mremap() move of multiple VMAs

2025-07-06 Thread Hugh Dickins
On Mon, 7 Jul 2025, Lorenzo Stoakes wrote: > Historically we've made it a uAPI requirement that mremap() may only > operate on a single VMA at a time. > > For instances where VMAs need to be resized, this makes sense, as it > becomes very difficult to determine what a user actually wants should t

Re: [PATCH v9 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-10 Thread Hugh Dickins
On Thu, 6 Mar 2025, Zi Yan wrote: > On 5 Mar 2025, at 17:38, Hugh Dickins wrote: > > On Wed, 5 Mar 2025, Zi Yan wrote: > >> On 5 Mar 2025, at 16:03, Hugh Dickins wrote: > >>> > >>> Beyond checking that, I didn't have time yesterday to investigate

Re: [PATCH v9 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-05 Thread Hugh Dickins
On Wed, 5 Mar 2025, Zi Yan wrote: > On 5 Mar 2025, at 16:03, Hugh Dickins wrote: > > > > Beyond checking that, I didn't have time yesterday to investigate > > further, but I'll try again today (still using last weekend's mm.git). > > I am trying to re

Re: [PATCH v9 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-05 Thread Hugh Dickins
On Wed, 5 Mar 2025, Zi Yan wrote: > On 5 Mar 2025, at 15:50, Hugh Dickins wrote: > > > > (Historically, there was quite a lot of difficulty in getting the order > > of events in __split_huge_page_tail() to be safe: I wonder whether we > > shall see a crop of new weird

Re: [PATCH v9 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-05 Thread Hugh Dickins
On Tue, 4 Mar 2025, Zi Yan wrote: > On 4 Mar 2025, at 6:49, Hugh Dickins wrote: > > > > I'd been unable to complete even a single iteration of my "kernel builds > > on huge tmpfs while swapping to SSD" testing during this current 6.14-rc > > mm.git cycle (

Re: [PATCH v9 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-05 Thread Hugh Dickins
On Wed, 5 Mar 2025, Zi Yan wrote: > On 4 Mar 2025, at 6:49, Hugh Dickins wrote: > > > > I think (might be wrong, I'm in a rush) my mods are all to this > > "add two new (not yet used) functions for folio_split()" patch: > > please merge them in if you ag

Re: [PATCH v9 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-04 Thread Hugh Dickins
;release" loop but fixed that too. 4. While correcting anon versus mapping versus swap_cache, shortened the lines by avoiding origin_folio->mapping and &release->page. Signed-off-by: Hugh Dickins --- mm/huge_memory.c | 39 --- 1 file cha

Re: [PATCH v4] memfd: `MFD_NOEXEC_SEAL` should not imply `MFD_ALLOW_SEALING`

2024-12-04 Thread Hugh Dickins
Jann, I notice you active in the SEALing arena recently, and wonder whether you would would have time to consider Barnabás's patiently pinged and repinged points here. Instinct tells me that he knows what he's talking about: but the SEALing protocol was a little too subtle for me, even at the star

Re: WARNING in shmem_release_dquot

2024-02-19 Thread Hugh Dickins
On Mon, 29 Jan 2024, Ubisectech Sirius wrote: > Hello. > We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. > Recently, our team has discovered a issue in Linux kernel > 6.8.0-rc1-gecb1b8288dc7. Attached to the email were a POC file of the issue. > > Stack dump: > [ 246.

Re: [PATCH v2] mm, thp: Relax the VM_DENYWRITE constraint on file-backed THPs

2021-04-16 Thread Hugh Dickins
-loads# 1.064 G/sec > 803,233,322iTLB-load-misses # 0.229182% miss rate > > Total test time: 329.826087 seconds > > A check of /proc/$(pidof dex2oat64)/smaps shows THPs in use: > > /apex/com.android.art/lib64/libart.so > FilePmdMapped: 4096 kB >

Re: [PATCH v2 9/9] userfaultfd/shmem: modify shmem_mcopy_atomic_pte to use install_ptes

2021-04-16 Thread Hugh Dickins
On Mon, 12 Apr 2021, Axel Rasmussen wrote: > In a previous commit, we added the mcopy_atomic_install_ptes() helper. > This helper does the job of setting up PTEs for an existing page, to map > it into a given VMA. It deals with both the anon and shmem cases, as > well as the shared and private cas

Re: [PATCH v2 4/9] userfaultfd/shmem: support UFFDIO_CONTINUE for shmem

2021-04-16 Thread Hugh Dickins
On Mon, 12 Apr 2021, Axel Rasmussen wrote: > With this change, userspace can resolve a minor fault within a > shmem-backed area with a UFFDIO_CONTINUE ioctl. The semantics for this > match those for hugetlbfs - we look up the existing page in the page > cache, and install PTEs for it. s/PTEs/a PT

Re: [PATCH v3 00/10] userfaultfd: add minor fault handling for shmem

2021-04-15 Thread Hugh Dickins
On Thu, 15 Apr 2021, Axel Rasmussen wrote: > Base > > > This series is based on (and therefore should apply cleanly to) the tag > "v5.12-rc7-mmots-2021-04-11-20-49", additionally with Peter's selftest cleanup > series applied first: > > https://lore.kernel.org/patchwork/cover/1412450/ > >

Re: [PATCH v2 3/9] userfaultfd/shmem: support minor fault registration for shmem

2021-04-14 Thread Hugh Dickins
On Mon, 12 Apr 2021, Axel Rasmussen wrote: > This patch allows shmem-backed VMAs to be registered for minor faults. > Minor faults are appropriately relayed to userspace in the fault path, > for VMAs with the relevant flag. > > This commit doesn't hook up the UFFDIO_CONTINUE ioctl for shmem-backe

Re: [PATCH v2 2/9] userfaultfd/shmem: combine shmem_{mcopy_atomic,mfill_zeropage}_pte

2021-04-13 Thread Hugh Dickins
is equivalent to pgoff, so we can get rid of offset entirely. > - Split two VM_BUG_ON cases into two statements. This means the line > number reported when the BUG is hit specifies exactly which condition > was true. > > Reviewed-by: Peter Xu > Signed-off-by: Axel Rasmu

Re: [PATCH v2 1/9] userfaultfd/hugetlbfs: avoid including userfaultfd_k.h in hugetlb.h

2021-04-13 Thread Hugh Dickins
On Mon, 12 Apr 2021, Axel Rasmussen wrote: > Minimizing header file inclusion is desirable. In this case, we can do > so just by forward declaring the enumeration our signature relies upon. > > Reviewed-by: Peter Xu > Signed-off-by: Axel Rasmussen > --- > include/linux/hugetlb.h | 4 +++- > mm

Re: linux-next: Tree for Apr 9 (x86 boot problem)

2021-04-13 Thread Hugh Dickins
de() and make comments describing trim_snb_memory() > operation more elaborate. > > Fixes: a799c2bd29d1 ("x86/setup: Consolidate early memory reservations") > Reported-by: Randy Dunlap > Signed-off-by: Mike Rapoport Tested-by: Hugh Dickins Thanks Mike and Randy. ThinkPad T

Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-12 Thread Hugh Dickins
On Mon, 12 Apr 2021, Peter Xu wrote: > On Tue, Apr 06, 2021 at 11:14:30PM -0700, Hugh Dickins wrote: > > > +static int mcopy_atomic_install_ptes(struct mm_struct *dst_mm, pmd_t > > > *dst_pmd, > > > +

Re: [PATCH v5] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-08 Thread Hugh Dickins
On Thu, 8 Apr 2021, Axel Rasmussen wrote: > On Tue, Apr 6, 2021 at 4:49 PM Peter Xu wrote: > > On Mon, Apr 05, 2021 at 10:19:17AM -0700, Axel Rasmussen wrote: ... > > > --- a/mm/userfaultfd.c > > > +++ b/mm/userfaultfd.c ... > > > + > > > + if (is_file_backed) { > > > + /* The shme

Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-07 Thread Hugh Dickins
On Wed, 7 Apr 2021, Axel Rasmussen wrote: > Agreed about taking one direction or the other further. > > I get the sense that Peter prefers the mcopy_atomic_install_ptes() > version, and would thus prefer to just expose that and let > shmem_mcopy_atomic_pte() use it. > > But, I get the sense that

Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-06 Thread Hugh Dickins
[PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior was a significant rework, so here I'm reviewing a synthetic patch merged from 5.12-rc5's 2021-03-31 mmotm patches: userfaultfd-support-minor-fault-handling-for-shmem.patch userfaultfd-support-minor-fault-handling-for-shmem-fix.pat

linux-kernel@vger.kernel.org

2021-04-02 Thread Hugh Dickins
On Fri, 2 Apr 2021, Hugh Dickins wrote: > > There is a "Put holes back where they were" xas_store(&xas, NULL) on > the failure path, which I think we would expect to delete empty nodes. > But it only goes as far as nr_none. Is it ok to xas_store(&xas, NULL) >

linux-kernel@vger.kernel.org

2021-04-02 Thread Hugh Dickins
On Fri, 2 Apr 2021, Matthew Wilcox wrote: > OK, more competent testing, and that previous bug now detected and fixed. > I have a reasonable amount of confidence this will solve your problem. > If you do apply this patch, don't enable CONFIG_TEST_XARRAY as the new > tests assume that attempting to

linux-kernel@vger.kernel.org

2021-03-31 Thread Hugh Dickins
On Wed, 31 Mar 2021, Matthew Wilcox wrote: > On Tue, Mar 30, 2021 at 06:30:22PM -0700, Hugh Dickins wrote: > > Running my usual tmpfs kernel builds swapping load, on Sunday's rc4-mm1 > > mmotm (I never got to try rc3-mm1 but presume it behaved the same way), > > I

Re: [PATCH mmotm] mm: vmscan: fix shrinker_rwsem in free_shrinker_info()

2021-03-31 Thread Hugh Dickins
On Wed, 31 Mar 2021, Yang Shi wrote: > On Wed, Mar 31, 2021 at 6:54 AM Shakeel Butt wrote: > > On Tue, Mar 30, 2021 at 4:44 PM Hugh Dickins wrote: > > > > > > Lockdep warns mm/vmscan.c: suspicious rcu_dereference_protected() usage! > > > when

linux-kernel@vger.kernel.org

2021-03-30 Thread Hugh Dickins
Running my usual tmpfs kernel builds swapping load, on Sunday's rc4-mm1 mmotm (I never got to try rc3-mm1 but presume it behaved the same way), I hit clear_inode()'s BUG_ON(!mapping_empty(&inode->i_data)); on two machines, within an hour or few, repeatably though not to order. The stack backtrace

[PATCH mmotm] mm: vmscan: fix shrinker_rwsem in free_shrinker_info()

2021-03-30 Thread Hugh Dickins
free_shrinker_info() can manage the shrinker_rwsem for itself. Link: https://lkml.kernel.org/r/20210317140615.GB28839@xsang-OptiPlex-9020 Reported-by: kernel test robot Signed-off-by: Hugh Dickins Cc: Yang Shi --- Sorry, I've made no attempt to work out precisely where in the series the locking

Re: [PATCH] mm: page_alloc: fix memcg accounting leak in speculative cache lookup

2021-03-25 Thread Hugh Dickins
On Fri, 26 Mar 2021, Matthew Wilcox wrote: > On Thu, Mar 25, 2021 at 06:55:42PM -0700, Hugh Dickins wrote: > > The first reason occurred to me this morning. I thought I had been > > clever to spot the PageHead race which you fix here. But now I just feel > > very stupid no

Re: [PATCH] mm: page_alloc: fix memcg accounting leak in speculative cache lookup

2021-03-25 Thread Hugh Dickins
On Tue, 23 Mar 2021, Hugh Dickins wrote: > On Tue, 23 Mar 2021, Johannes Weiner wrote: > > From f6f062a3ec46f4fb083dcf6792fde9723f18cfc5 Mon Sep 17 00:00:00 2001 > > From: Johannes Weiner > > Date: Fri, 19 Mar 2021 02:17:00 -0400 > > Subject: [PATCH] mm: page_alloc: fix

Re: [PATCH] x86/tlb: Flush global mappings when KAISER is disabled

2021-03-25 Thread Hugh Dickins
sh those global mappings in the KAISER disabled case. > > Co-debugged by Babu Moger . > > Reported-by: Jim Mattson > Signed-off-by: Borislav Petkov > Link: > https://lkml.kernel.org/r/CALMp9eRDSW66%2BXvbHVF4ohL7XhThoPoT0BrB0TcS0cgk=dk...@mail.gmail.com Acked-by: Hugh Dickins Great wr

Re: [PATCH v6 00/12] SVM cleanup and INVPCID feature support

2021-03-24 Thread Hugh Dickins
On Wed, 24 Mar 2021, Hugh Dickins wrote: > On Wed, 24 Mar 2021, Borislav Petkov wrote: > > > Ok, > > > > some more experimenting Babu and I did lead us to: > > > > --- > > diff --git a/arch/x86/include/asm/tlbflush.h > > b/arch/x86/include/asm

Re: [PATCH v6 00/12] SVM cleanup and INVPCID feature support

2021-03-24 Thread Hugh Dickins
On Wed, 24 Mar 2021, Borislav Petkov wrote: > Ok, > > some more experimenting Babu and I did lead us to: > > --- > diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h > index f5ca15622dc9..259aa4889cad 100644 > --- a/arch/x86/include/asm/tlbflush.h > +++ b/arch/x86/inc

Re: [PATCH] mm: page_alloc: fix memcg accounting leak in speculative cache lookup

2021-03-23 Thread Hugh Dickins
what exactly is > happening to the page during that race. > > Fixes: e320d3012d25 mm/page_alloc.c: fix freeing non-compound pages > Reported-by: Hugh Dickins > Reported-by: Matthew Wilcox > Signed-off-by: Johannes Weiner > Cc: # 5.10+ This is great, thanks Hannes. Acked-

Re: [PATCH v4 2/3] Revert "mremap: don't allow MREMAP_DONTUNMAP on special_mappings and aio"

2021-03-23 Thread Hugh Dickins
lines still describe an earlier version, they should say: "mappings, and these special mappings are now protected by a check of !VM_DONTEXPAND and !VM_PFNMAP which will result in a -EINVAL." > > 1. https://lkml.org/lkml/2020/12/28/2340 > > Signed-off-by: Brian Geffon > Ack

Re: [PATCH] mm: page_alloc: fix memcg accounting leak in speculative cache lookup

2021-03-19 Thread Hugh Dickins
ify what exactly is happening to the page during that race. > > This bug is old and has its roots in the speculative page cache patch > and adding cgroup accounting of kernel pages. There are no known user > reports. A backport to stable is therefor not warranted. > > Reported-b

Re: [PATCH 2/2] mm: memcontrol: deprecate swapaccounting=0 mode

2021-03-19 Thread Hugh Dickins
On Fri, 19 Mar 2021, Johannes Weiner wrote: > The swapaccounting= commandline option already does very little > today. To close a trivial containment failure case, the swap ownership > tracking part of the swap controller has recently become mandatory > (see commit 2d1c498072de ("mm: memcontrol: m

Re: [PATCH 1/2] mm: memcontrol: don't allocate cgroup swap arrays when memcg is disabled

2021-03-19 Thread Hugh Dickins
ntrol: make swap tracking an integral part of > memory control") > Reported-by: Hugh Dickins > Signed-off-by: Johannes Weiner Acked-by: Hugh Dickins Thanks for the memory! > --- > mm/memcontrol.c | 3 +++ > mm/swap_cgroup.c | 6 ++ > 2 files changed,

Re: [PATCH] mm: Allow shmem mappings with MREMAP_DONTUNMAP

2021-03-18 Thread Hugh Dickins
aults didn't know about the new vm_insert_page() case. Also make some things a bit more anal wrt VM_PFNMAP. Pointed out by Hugh Dickins Signed-off-by: Linus Torvalds So apparently I do bear some anal responsibility. My concern seems to have been that in those days an unexpected page faul

Re: [PATCH v3 2/2] Revert "mremap: don't allow MREMAP_DONTUNMAP on special_mappings and aio"

2021-03-18 Thread Hugh Dickins
xup needed: -EFAULT was what the incorrect v2 gave, but v3 issues -EINVAL like before, and I'm content with that difference. > > 1. https://lkml.org/lkml/2020/12/28/2340 > > Signed-off-by: Brian Geffon Acked-by: Hugh Dickins Thanks Brian, I'm happy with this result. > ---

Re: [PATCH v3 1/2] mm: Allow non-VM_DONTEXPAND and VM_PFNMAP mappings with MREMAP_DONTUNMAP

2021-03-18 Thread Hugh Dickins
AP_DONTUNMAP only supports private anonymous mappings, this > patch will enable using UFFDIO_CONTINUE for the new userfaultfd-based heap > compaction." > > [1] > https://lore.kernel.org/linux-mm/20201215030730.nc3cu98e4%25a...@linux-foundation.org/ > [2] > https://lore.ke

Re: [PATCH] mm: Allow shmem mappings with MREMAP_DONTUNMAP

2021-03-13 Thread Hugh Dickins
On Wed, 3 Mar 2021, Brian Geffon wrote: > Currently MREMAP_DONTUNMAP only accepts private anonymous mappings. This > change > will widen the support to include shmem mappings. The primary use case > is to support MREMAP_DONTUNMAP on mappings which may have been created from > a memfd. > > Lokesh

Re: [PATCH v4 00/25] Page folios

2021-03-13 Thread Hugh Dickins
On Sat, 13 Mar 2021, Andrew Morton wrote: > On Fri, 5 Mar 2021 04:18:36 + "Matthew Wilcox (Oracle)" > wrote: > > > Our type system does not currently distinguish between tail pages and > > head or single pages. This is a problem because we call compound_head() > > multiple times (and the c

Re: [PATCH v1] mm, hwpoison: enable error handling on shmem thp

2021-03-11 Thread Hugh Dickins
On Thu, 11 Mar 2021, Jue Wang wrote: > On Thu, Mar 11, 2021 at 7:14 AM HORIGUCHI NAOYA(堀口 直也) > wrote: > > On Wed, Mar 10, 2021 at 11:22:18PM -0800, Hugh Dickins wrote: > > > > > > I'm not much into memory-failure myself, but Jue discovered that the

Re: [PATCH v2 2/2] mm/memcg: set memcg when split page

2021-03-11 Thread Hugh Dickins
On Thu, 11 Mar 2021, Michal Hocko wrote: > On Thu 11-03-21 10:21:39, Johannes Weiner wrote: > > On Thu, Mar 11, 2021 at 09:37:02AM +0100, Michal Hocko wrote: > > > Johannes, Hugh, > > > > > > what do you think about this approach? If we want to stick with > > > split_page approach then we need to

Re: [PATCH v1] mm, hwpoison: enable error handling on shmem thp

2021-03-10 Thread Hugh Dickins
return 0; > } > + pr_info("%s: %#lx: thp split failed\n", msg, page_to_pfn(page)); > unlock_page(page); > - > - return 0; > + put_page(page); > + return -EBUSY; > } > > static int memory_failure_hugetlb(unsigned long pfn, int fl

Re: [PATCH v2 1/2] mm/memcg: rename mem_cgroup_split_huge_fixup to split_page_memcg

2021-03-10 Thread Hugh Dickins
On Thu, 11 Mar 2021, Singh, Balbir wrote: > On 9/3/21 7:28 pm, Michal Hocko wrote: > > On Tue 09-03-21 09:37:29, Balbir Singh wrote: > >> On 4/3/21 6:40 pm, Zhou Guanghui wrote: > > [...] > >>> -#ifdef CONFIG_TRANSPARENT_HUGEPAGE > >>> /* > >>> - * Because page_memcg(head) is not set on compound t

Re: [PATCH 1/2] iwlwifi: fix DVM build regression in 5.12-rc

2021-03-06 Thread Hugh Dickins
On Sat, 6 Mar 2021, Sedat Dilek wrote: > On Sat, Mar 6, 2021 at 8:48 PM Hugh Dickins wrote: > > > > There is no iwl_so_trans_cfg if CONFIG_IWLDVM but not CONFIG_IWLMVM: > > move the CONFIG_IWLMVM guard up before the problematic SnJ workaround > > to fix the bu

[PATCH 2/2] iwlwifi: fix DVM boot regression in 5.12-rc

2021-03-06 Thread Hugh Dickins
No time_point op has been provided for DVM: check for NULL before calling, to fix the oops (blank screen booting non-modular kernel). Fixes: d01293154c0a ("iwlwifi: dbg: add op_mode callback for collecting debug data.") Signed-off-by: Hugh Dickins --- drivers/net/wireless/intel/iwlw

[PATCH 1/2] iwlwifi: fix DVM build regression in 5.12-rc

2021-03-06 Thread Hugh Dickins
There is no iwl_so_trans_cfg if CONFIG_IWLDVM but not CONFIG_IWLMVM: move the CONFIG_IWLMVM guard up before the problematic SnJ workaround to fix the build breakage. Fixes: 930be4e76f26 ("iwlwifi: add support for SnJ with Jf devices") Signed-off-by: Hugh Dickins --- drivers/net/wire

Re: [PATCH v4] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Hugh Dickins
On Fri, 5 Mar 2021, Shakeel Butt wrote: > On Fri, Mar 5, 2021 at 1:26 PM Shakeel Butt wrote: > > > > Currently the kernel adds the page, allocated for swapin, to the > > swapcache before charging the page. This is fine but now we want a > > per-memcg swapcache stat which is essential for folks who

Re: [PATCH v3] memcg: charge before adding to swapcache on swapin

2021-03-05 Thread Hugh Dickins
nd I'm glad Johannes talked you out of __GFP_NOFAIL: much better like this). I'll say Acked-by: Hugh Dickins but I am quite unhappy with the name mem_cgroup_finish_swapin_page(): it doesn't finish the swapin, it doesn't finish the page, and I'm not persuaded by your p

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-03 Thread Hugh Dickins
On Tue, 2 Mar 2021, Johannes Weiner wrote: > On Tue, Mar 02, 2021 at 12:24:41PM -0800, Hugh Dickins wrote: > > On Tue, 2 Mar 2021, Michal Hocko wrote: > > > [Cc Johannes for awareness and fixup Nick's email] > > > > > > On Tue 02-03-21 01:34:51, Zhou Gua

Re: [PATCH] mm/memcg: set memcg when split pages

2021-03-02 Thread Hugh Dickins
On Tue, 2 Mar 2021, Michal Hocko wrote: > [Cc Johannes for awareness and fixup Nick's email] > > On Tue 02-03-21 01:34:51, Zhou Guanghui wrote: > > When split page, the memory cgroup info recorded in first page is > > not copied to tail pages. In this case, when the tail pages are > > freed, the u

[PATCH v2 3/4] mm: /proc/sys/vm/stat_refresh skip checking known negative stats

2021-03-02 Thread Hugh Dickins
-by: Roman Gushchin Signed-off-by: Hugh Dickins --- mm/vmstat.c | 15 +++ 1 file changed, 15 insertions(+) --- vmstat2/mm/vmstat.c 2021-02-25 11:56:18.0 -0800 +++ vmstat3/mm/vmstat.c 2021-02-25 12:42:15.0 -0800 @@ -1840,6 +1840,14 @@ int vmstat_refresh(struct ctl_

Re: [PATCH 3/4] mm: /proc/sys/vm/stat_refresh skip checking known negative stats

2021-03-01 Thread Hugh Dickins
On Sun, 28 Feb 2021, Roman Gushchin wrote: > On Thu, Feb 25, 2021 at 03:14:03PM -0800, Hugh Dickins wrote: > > vmstat_refresh() can occasionally catch nr_zone_write_pending and > > nr_writeback when they are transiently negative. The reason is partly > > that the interrupt

Re: [PATCH v2 3/3] mm: use PF_ONLY_HEAD for PG_active and PG_unevictable

2021-03-01 Thread Hugh Dickins
On Mon, 1 Mar 2021, Yu Zhao wrote: > On Mon, Mar 01, 2021 at 02:50:07PM +0300, Kirill A. Shutemov wrote: > > On Fri, Feb 26, 2021 at 12:13:14PM +, Matthew Wilcox wrote: > > > On Fri, Feb 26, 2021 at 02:17:18AM -0700, Yu Zhao wrote: > > > > All places but one test, set or clear PG_active and PG_

Re: [PATCH 1/2] mm: Guard a use of node_reclaim_distance with CONFIFG_NUMA

2021-02-26 Thread Hugh Dickins
On Fri, 26 Feb 2021, Palmer Dabbelt wrote: > On Fri, 26 Feb 2021 17:31:40 PST (-0800), hu...@google.com wrote: > > On Fri, 26 Feb 2021, Andrew Morton wrote: > > > On Fri, 26 Feb 2021 12:17:20 -0800 Palmer Dabbelt > > > wrote: > > > > From: Palmer Dabbelt > > > > > > > > This is only useful under

Re: [PATCH 1/2] mm: Guard a use of node_reclaim_distance with CONFIFG_NUMA

2021-02-26 Thread Hugh Dickins
On Fri, 26 Feb 2021, Andrew Morton wrote: > On Fri, 26 Feb 2021 12:17:20 -0800 Palmer Dabbelt wrote: > > From: Palmer Dabbelt > > > > This is only useful under CONFIG_NUMA. IIUC skipping the check is the > > right thing to do here, as without CONFIG_NUMA there will never be any > > large node d

[PATCH 4/4] mm: /proc//sys/vm/stat_refresh stop checking monotonic numa stats

2021-02-25 Thread Hugh Dickins
All of the VM NUMA stats are event counts, incremented never decremented: it is not very useful for vmstat_refresh() to check them throughout their first aeon, then warn on them throughout their next. Signed-off-by: Hugh Dickins --- mm/vmstat.c |9 - 1 file changed, 9 deletions

[PATCH 3/4] mm: /proc/sys/vm/stat_refresh skip checking known negative stats

2021-02-25 Thread Hugh Dickins
t the migratetype of a pageblock is not guaranteed to be constant. Use switch statements so we can most easily add or remove cases later. Link: https://lore.kernel.org/linux-mm/20200714173747.3315771-1-g...@fb.com/ Reported-by: Roman Gushchin Signed-off-by: Hugh Dickins --- mm/vmstat.c |

[PATCH 2/4] mm: no more EINVAL from /proc/sys/vm/stat_refresh

2021-02-25 Thread Hugh Dickins
sh touch failed with that error. Stop doing that. Signed-off-by: Hugh Dickins --- mm/vmstat.c |5 - 1 file changed, 5 deletions(-) --- vmstat1/mm/vmstat.c 2021-02-25 11:50:36.0 -0800 +++ vmstat2/mm/vmstat.c 2021-02-25 11:56:18.0 -0800 @@ -1844,7 +1844,6 @@ int vmstat

[PATCH 1/4] mm: restore node stat checking in /proc/sys/vm/stat_refresh

2021-02-25 Thread Hugh Dickins
EMS without updating vmstat_refresh(): so it has been missing out much of the vmstat underflow checking ever since. Reinstate it. Thanks to Roman Gushchin for tangentially pointing this out. Signed-off-by: Hugh Dickins --- mm/vmstat.c |8 1 file changed, 8 insertions(+) --- 5.12-rc/mm

Re: [PATCH v2] mm: vmstat: fix /proc/sys/vm/stat_refresh generating false warnings

2021-02-25 Thread Hugh Dickins
On Wed, 24 Feb 2021, Roman Gushchin wrote: > On Tue, Feb 23, 2021 at 11:24:23PM -0800, Hugh Dickins wrote: > > On Thu, 6 Aug 2020, Andrew Morton wrote: > > > On Thu, 6 Aug 2020 16:38:04 -0700 Roman Gushchin wrote: > > > > August, yikes, I thought it was much more

Re: [PATCH v6 0/3] mm,thp,shm: limit shmem THP alloc gfp_mask

2021-02-24 Thread Hugh Dickins
On Wed, 24 Feb 2021, Rik van Riel wrote: > On Wed, 2021-02-24 at 00:41 -0800, Hugh Dickins wrote: > > On Mon, 14 Dec 2020, Vlastimil Babka wrote: > > > > > > (There's also a specific issue with the gfp_mask limiting: I have > > > > not yet reviewed the

Re: [PATCH v6 0/3] mm,thp,shm: limit shmem THP alloc gfp_mask

2021-02-24 Thread Hugh Dickins
On Mon, 14 Dec 2020, Vlastimil Babka wrote: > On 12/14/20 10:16 PM, Hugh Dickins wrote: > > On Tue, 24 Nov 2020, Rik van Riel wrote: > > > >> The allocation flags of anonymous transparent huge pages can be controlled > >> through the files in /sys/kernel/mm/trans

Re: [PATCH v2] mm: vmstat: fix /proc/sys/vm/stat_refresh generating false warnings

2021-02-23 Thread Hugh Dickins
On Thu, 6 Aug 2020, Andrew Morton wrote: > On Thu, 6 Aug 2020 16:38:04 -0700 Roman Gushchin wrote: August, yikes, I thought it was much more recent. > > > it seems that Hugh and me haven't reached a consensus here. > > Can, you, please, not merge this patch into 5.9, so we would have > > more t

Re: [PATCH] percpu_counter: increase batch count

2021-02-22 Thread Hugh Dickins
On Mon, 22 Feb 2021, Jens Axboe wrote: > On 2/22/21 2:31 PM, Hugh Dickins wrote: > > On Thu, 18 Feb 2021, Jens Axboe wrote: > >> On 2/18/21 4:16 PM, Andrew Morton wrote: > >>> On Thu, 18 Feb 2021 14:36:31 -0700 Jens Axboe wrote: > >>> > >&

Re: [PATCH] percpu_counter: increase batch count

2021-02-22 Thread Hugh Dickins
On Thu, 18 Feb 2021, Jens Axboe wrote: > On 2/18/21 4:16 PM, Andrew Morton wrote: > > On Thu, 18 Feb 2021 14:36:31 -0700 Jens Axboe wrote: > > > >> Currently we cap the batch count at max(32, 2*nr_online_cpus), which these > >> days is kind of silly as systems have gotten much bigger than in 2009

Re: Very slow unlockall()

2021-02-10 Thread Hugh Dickins
On Wed, 10 Feb 2021, Michal Hocko wrote: > On Wed 10-02-21 17:57:29, Michal Hocko wrote: > > On Wed 10-02-21 16:18:50, Vlastimil Babka wrote: > [...] > > > And the munlock (munlock_vma_pages_range()) is slow, because it uses > > > follow_page_mask() in a loop incrementing addresses by PAGE_SIZE, so

Re: [PATCH v2] mm: page-writeback: simplify memcg handling in test_clear_page_writeback()

2021-02-10 Thread Hugh Dickins
On Wed, 10 Feb 2021, Johannes Weiner wrote: > On Wed, Feb 10, 2021 at 08:22:00AM -0800, Hugh Dickins wrote: > > On Tue, 9 Feb 2021, Hugh Dickins wrote: > > > On Tue, 9 Feb 2021, Johannes Weiner wrote: > > > > > > > Page writeback doesn't hol

Re: [PATCH] mm: page-writeback: simplify memcg handling in test_clear_page_writeback()

2021-02-10 Thread Hugh Dickins
On Tue, 9 Feb 2021, Hugh Dickins wrote: > On Tue, 9 Feb 2021, Johannes Weiner wrote: > > > Page writeback doesn't hold a page reference, which allows truncate to > > free a page the second PageWriteback is cleared. This used to require > > special attention in test_

Re: [PATCH] mm: page-writeback: simplify memcg handling in test_clear_page_writeback()

2021-02-09 Thread Hugh Dickins
/memcontrol.c, and its declarations deleted from include/linux/memcontrol.h? And further: delete __dec_lruvec_state() and dec_lruvec_state() from include/linux/vmstat.h - unless you feel that every "inc" ought to be matched by a "dec", even when unused. > > Signed-o

Re: [PATCH] tmpfs: disallow CONFIG_TMPFS_INODE64 on alpha

2021-02-08 Thread Hugh Dickins
alpha. > > Fixes: ea3271f7196c ("tmpfs: support 64-bit inums per-sb") > Cc: sta...@vger.kernel.org # v5.9+ > Signed-off-by: Seth Forshee Thanks, Acked-by: Hugh Dickins > --- > fs/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff

Re: [PATCH] tmpfs: Disallow CONFIG_TMPFS_INODE64 on s390

2021-02-08 Thread Hugh Dickins
the mount options and thus passes it in the > options for the remount. > > > So prevent CONFIG_TMPFS_INODE64 from being selected on s390. > > Link: > https://lkml.kernel.org/r/20210205230620.518245-1-seth.fors...@canonical.com > Fixes: ea3271f7196c ("tmpfs: suppo

Re: [PATCH RFC 00/30] userfaultfd-wp: Support shmem and hugetlbfs

2021-02-05 Thread Hugh Dickins
On Fri, 29 Jan 2021, Peter Xu wrote: > > Huge & Mike, > > Would any of you have comment/concerns on the high-level design of this > series? > > It would be great to know it, especially major objection, before move on to an > non-rfc version. Seeing Mike's update prompts me to speak up: I have

Re: INFO: task can't die in shrink_inactive_list (2)

2021-02-05 Thread Hugh Dickins
21, 2020 at 08:33:44PM +, Matthew Wilcox wrote: > > On Mon, Dec 21, 2020 at 11:56:36AM -0800, Hugh Dickins wrote: > > > On Mon, 23 Nov 2020, Andrew Morton wrote: > > > > On Fri, 20 Nov 2020 17:55:22 -0800 syzbot > > > > wrote: > > > > >

Re: Possible deny of service with memfd_create()

2021-02-04 Thread Hugh Dickins
On Thu, 4 Feb 2021, Michal Hocko wrote: > On Thu 04-02-21 17:32:20, Christian Koenig wrote: > > Hi Michal, > > > > as requested in the other mail thread the following sample code gets my test > > system down within seconds. > > > > The issue is that the memory allocated for the file descriptor is

Re: [PATCH] userfaultfd: hugetlbfs: only compile UFFD helpers if config enabled

2021-02-02 Thread Hugh Dickins
On Tue, 2 Feb 2021, Axel Rasmussen wrote: > On Tue, Feb 2, 2021 at 1:03 PM Hugh Dickins wrote: > > On Tue, 2 Feb 2021, Axel Rasmussen wrote: > > > > > For background, mm/userfaultfd.c provides a general mcopy_atomic > > > implementation. But some types of memo

Re: [PATCH] userfaultfd: hugetlbfs: only compile UFFD helpers if config enabled

2021-02-02 Thread Hugh Dickins
On Tue, 2 Feb 2021, Axel Rasmussen wrote: > For background, mm/userfaultfd.c provides a general mcopy_atomic > implementation. But some types of memory (e.g., hugetlb and shmem) need > a slightly different implementation, so they provide their own helpers > for this. In other words, userfaultfd is

Re: [PATCH v4 0/8] Create 'old' ptes for faultaround mappings on arm64 with hardware access flag

2021-01-26 Thread Hugh Dickins
On Tue, 26 Jan 2021, Will Deacon wrote: > On Wed, Jan 20, 2021 at 05:36:04PM +, Will Deacon wrote: > > Hi all, > > > > This is version four of the patches I previously posted here: > > > > v1: https://lore.kernel.org/r/20201209163950.8494-1-w...@kernel.org > > v2: https://lore.kernel.org/

Re: Infinite recursion in device_reorder_to_tail() due to circular device links

2021-01-24 Thread Hugh Dickins
On Sun, 24 Jan 2021, Greg Kroah-Hartman wrote: > On Sat, Jan 23, 2021 at 03:37:30PM -0800, Hugh Dickins wrote: > > On Tue, 12 Jan 2021, Greg Kroah-Hartman wrote: > > > On Tue, Jan 12, 2021 at 03:32:04PM +0100, Rafael J. Wysocki wrote: > > > > On Mon, Jan 11, 2

Re: Infinite recursion in device_reorder_to_tail() due to circular device links

2021-01-23 Thread Hugh Dickins
On Tue, 12 Jan 2021, Greg Kroah-Hartman wrote: > On Tue, Jan 12, 2021 at 03:32:04PM +0100, Rafael J. Wysocki wrote: > > On Mon, Jan 11, 2021 at 7:46 PM Stephan Gerhold wrote: > > > > > > Hi, > > > > > > since 5.11-rc1 I get kernel crashes with infinite recursion in > > > device_reorder_to_tail() i

[PATCH] mm: thp: fix MADV_REMOVE deadlock on shmem THP

2021-01-16 Thread Hugh Dickins
thp: make the THP mapcount atomic against __split_huge_pmd_locked()") Signed-off-by: Hugh Dickins Reviewed-by: Andrea Arcangeli Cc: sta...@vger.kernel.org --- The status of reuse_swap_page(), and its use on THPs, is currently under discussion, and may need to be changed: but this patch is a simple fix to the

Re: madvise(MADV_REMOVE) deadlocks on shmem THP

2021-01-13 Thread Hugh Dickins
On Thu, 14 Jan 2021, Sergey Senozhatsky wrote: > Hi, > > We are running into lockups during the memory pressure tests on our > boards, which essentially NMI panic them. In short the test case is > > - THP shmem > echo advise > /sys/kernel/mm/transparent_hugepage/shmem_enabled > > - And a us

Re: 5.11-rc device reordering breaks ThinkPad rmi4 suspend

2021-01-11 Thread Hugh Dickins
On Mon, 11 Jan 2021, Saravana Kannan wrote: > On Mon, Jan 11, 2021 at 4:44 PM Hugh Dickins wrote: > > On Mon, 11 Jan 2021, Saravana Kannan wrote: > > > > > > Did you see this patch change the organization of devices under > > > /sys/devices/? > > >

Re: 5.11-rc device reordering breaks ThinkPad rmi4 suspend

2021-01-11 Thread Hugh Dickins
On Mon, 11 Jan 2021, Saravana Kannan wrote: > On Mon, Jan 11, 2021 at 3:42 PM Hugh Dickins wrote: > > On Mon, 11 Jan 2021, Saravana Kannan wrote: > > > > > > I happen to have an X1 Carbon (different gen though) lying around and > > > I poked at its /sys

Re: 5.11-rc device reordering breaks ThinkPad rmi4 suspend

2021-01-11 Thread Hugh Dickins
On Mon, 11 Jan 2021, Saravana Kannan wrote: > > I happen to have an X1 Carbon (different gen though) lying around and > I poked at its /sys folders. None of the devices in the rmi4_smbus are > considered the grandchildren of the i2c device. I think the real > problem is rmi_register_transport_devi

Re: [PATCH v2 0/3] Create 'old' ptes for faultaround mappings on arm64 with hardware access flag

2021-01-11 Thread Hugh Dickins
On Mon, 11 Jan 2021, Will Deacon wrote: > On Fri, Jan 08, 2021 at 11:34:08AM -0800, Linus Torvalds wrote: > > On Fri, Jan 8, 2021 at 9:15 AM Will Deacon wrote: > > > > > > The big difference in this version is that I have reworked it based on > > > Kirill's patch which he posted as a follow-up to

Re: [PATCH 5.10 109/145] mm: make wait_on_page_writeback() wait for multiple pending writebacks

2021-01-11 Thread Hugh Dickins
ot; > behavior as we have for page locking, we'd have to change our roughly > ~50 different writeback functions. Painful. > > Instead, just make "wait_on_page_writeback()" loop on the very unlikely > situation that the PG_writeback bit is still set, basically re-insta

Re: 5.11-rc device reordering breaks ThinkPad rmi4 suspend

2021-01-11 Thread Hugh Dickins
On Mon, 11 Jan 2021, Thierry Reding wrote: > On Sun, Jan 10, 2021 at 08:44:13PM -0800, Hugh Dickins wrote: > > > > Synaptics RMI4 SMBus touchpad on ThinkPad X1 Carbon (5th generation) > > fails to suspend when running 5.11-rc kernels: bisected to > > 5b6164d3465f (&q

Re: 5.11-rc device reordering breaks ThinkPad rmi4 suspend

2021-01-11 Thread Hugh Dickins
On Mon, 11 Jan 2021, Rafael J. Wysocki wrote: > On Mon, Jan 11, 2021 at 5:44 AM Hugh Dickins wrote: > > > > Hi Rafael, > > > > Synaptics RMI4 SMBus touchpad on ThinkPad X1 Carbon (5th generation) > > fails to suspend when running 5.11-rc kernels: bisected

5.11-rc device reordering breaks ThinkPad rmi4 suspend

2021-01-10 Thread Hugh Dickins
Hi Rafael, Synaptics RMI4 SMBus touchpad on ThinkPad X1 Carbon (5th generation) fails to suspend when running 5.11-rc kernels: bisected to 5b6164d3465f ("driver core: Reorder devices on successful probe"), and reverting that fixes it. dmesg.xz attached, but go ahead and ask me to switch on a deb

Re: [PATCH] mm/memcontrol: fix warning in mem_cgroup_page_lruvec()

2021-01-08 Thread Hugh Dickins
On Thu, 7 Jan 2021, Vlastimil Babka wrote: > On 1/4/21 6:03 AM, Hugh Dickins wrote: > > Boot a CONFIG_MEMCG=y kernel with "cgroup_disabled=memory" and you are > > met by a series of warnings from the VM_WARN_ON_ONCE_PAGE(!memcg, page) > > recently added to th

Re: [PATCH] mm/mmap: replace if (cond) BUG() with BUG_ON()

2021-01-06 Thread Hugh Dickins
On Wed, 6 Jan 2021, Andrea Arcangeli wrote: > > I'd be surprised if the kernel can boot with BUG_ON() defined as "do > {}while(0)" so I guess it doesn't make any difference. I had been afraid of that too, when CONFIG_BUG is not set: but I think it's actually "if (cond) do {} while (0)".

Re: [PATCH] mm/mmap: replace if (cond) BUG() with BUG_ON()

2021-01-06 Thread Hugh Dickins
On Wed, 6 Jan 2021, Andrew Morton wrote: > On Tue, 5 Jan 2021 20:28:27 -0800 (PST) Hugh Dickins wrote: > > > Alex, please consider why the authors of these lines (whom you > > did not Cc) chose to write them without BUG_ON(): it has always > > been preferred pra

Re: [PATCH] mm/mmap: replace if (cond) BUG() with BUG_ON()

2021-01-05 Thread Hugh Dickins
On Sat, 12 Dec 2020, Alex Shi wrote: > > I'm very sorry, a typo here. the patch should be updated: > > From ed4fa1c6d5bed5766c5f0c35af0c597855d7be06 Mon Sep 17 00:00:00 2001 > From: Alex Shi > Date: Fri, 11 Dec 2020 21:26:46 +0800 > Subject: [PATCH] mm/mmap: replace if (cond) BUG() with BUG_ON()

Re: [PATCH v21 00/19] per memcg lru lock

2021-01-05 Thread Hugh Dickins
On Tue, 5 Jan 2021, Qian Cai wrote: > On Tue, 2021-01-05 at 13:35 -0800, Hugh Dickins wrote: > > This patchset went into mmotm 2020-11-16-16-23, so probably linux-next > > on 2020-11-17: you'll have had three trouble-free weeks testing with it > > in, so it's n

  1   2   3   4   5   6   7   8   9   10   >