Re: [PATCH 1/3] userfaultfd: UFFDIO_REMAP: rmap preparation

2023-09-14 Thread Matthew Wilcox
On Thu, Sep 14, 2023 at 08:26:11AM -0700, Suren Baghdasaryan wrote: > From: Andrea Arcangeli > > As far as the rmap code is concerned, UFFDIO_REMAP only alters the > page->mapping and page->index. It does it while holding the page folio->mapping and folio->index. It does it while holding the fo

Re: [PATCH 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-09-14 Thread Matthew Wilcox
On Thu, Sep 14, 2023 at 08:26:12AM -0700, Suren Baghdasaryan wrote: > +++ b/include/linux/userfaultfd_k.h > @@ -93,6 +93,23 @@ extern int mwriteprotect_range(struct mm_struct *dst_mm, > extern long uffd_wp_range(struct vm_area_struct *vma, > unsigned long start, unsigned lo

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-16 Thread Matthew Wilcox
On Mon, Oct 16, 2023 at 02:38:19PM +, jef...@chromium.org wrote: > Modern CPUs support memory permissions such as RW and NX bits. Linux has > supported NX since the release of kernel version 2.6.8 in August 2004 [1]. This seems like a confusing way to introduce the subject. Here, you're talki

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-17 Thread Matthew Wilcox
On Tue, Oct 17, 2023 at 01:34:35AM -0700, Jeff Xu wrote: > > > types: bit mask to specify which syscall to seal, currently they are: > > > MM_SEAL_MSEAL 0x1 > > > MM_SEAL_MPROTECT 0x2 > > > MM_SEAL_MUNMAP 0x4 > > > MM_SEAL_MMAP 0x8 > > > MM_SEAL_MREMAP 0x10 > > > > I don't understand why we want th

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-18 Thread Matthew Wilcox
On Tue, Oct 17, 2023 at 08:18:47PM -0700, Jeff Xu wrote: > In practice: libc could do below: > #define MM_IMMUTABLE > (MM_SEAL_MPROTECT|MM_SEAL_MUNMAP|MM_SEAL_MREMAP|MM_SEAL_MMAP) > mseal(add,len, MM_IMMUTABLE) > it will be equivalent to BSD's immutable(). No, it wouldn't, because you've carefully

Re: [PATCH v8 1/6] list_lru: allows explicit memcg and NUMA node selection

2023-11-30 Thread Matthew Wilcox
On Thu, Nov 30, 2023 at 11:40:18AM -0800, Nhat Pham wrote: > This patch changes list_lru interface so that the caller must explicitly > specify numa node and memcg when adding and removing objects. The old > list_lru_add() and list_lru_del() are renamed to list_lru_add_obj() and > list_lru_del_obj(

Re: [RFC PATCH v5 2/4] mseal: add mseal syscall

2024-01-09 Thread Matthew Wilcox
On Tue, Jan 09, 2024 at 03:45:40PM +, jef...@chromium.org wrote: > +extern bool can_modify_mm(struct mm_struct *mm, unsigned long start, > + unsigned long end); > +extern bool can_modify_mm_madv(struct mm_struct *mm, unsigned long start, > + unsigned long end, int behavi

Re: [PATCH v14] exec: Fix dead-lock in de_thread with ptrace_attach

2024-01-15 Thread Matthew Wilcox
On Mon, Jan 15, 2024 at 08:22:19PM +0100, Bernd Edlinger wrote: > This introduces signal->exec_bprm, which is used to > fix the case when at least one of the sibling threads > is traced, and therefore the trace process may dead-lock > in ptrace_attach, but de_thread will need to wait for the > trac

Re: [RFC v3 3/3] ktest: sys_move_phys_pages ktest

2024-03-19 Thread Matthew Wilcox
On Tue, Mar 19, 2024 at 01:26:09PM -0400, Gregory Price wrote: > Implement simple ktest that looks up the physical address via > /proc/self/pagemap and migrates the page based on that information. What? LOL. No.

Re: [RFC v3 3/3] ktest: sys_move_phys_pages ktest

2024-03-19 Thread Matthew Wilcox
On Tue, Mar 19, 2024 at 05:52:46PM +, Matthew Wilcox wrote: > On Tue, Mar 19, 2024 at 01:26:09PM -0400, Gregory Price wrote: > > Implement simple ktest that looks up the physical address via > > /proc/self/pagemap and migrates the page based on that information. > > W

Re: [RFC v3 3/3] ktest: sys_move_phys_pages ktest

2024-03-19 Thread Matthew Wilcox
On Tue, Mar 19, 2024 at 02:14:33PM -0400, Gregory Price wrote: > On Tue, Mar 19, 2024 at 05:52:46PM +0000, Matthew Wilcox wrote: > > On Tue, Mar 19, 2024 at 01:26:09PM -0400, Gregory Price wrote: > > > Implement simple ktest that looks up the physical address via > >

Re: [RFC v3 3/3] ktest: sys_move_phys_pages ktest

2024-03-19 Thread Matthew Wilcox
On Tue, Mar 19, 2024 at 02:32:17PM -0400, Gregory Price wrote: > On Tue, Mar 19, 2024 at 06:20:33PM +0000, Matthew Wilcox wrote: > > On Tue, Mar 19, 2024 at 02:14:33PM -0400, Gregory Price wrote: > > > On Tue, Mar 19, 2024 at 05:52:46PM +0000, Matthew Wilcox wrote: > > >

Re: [PATCH v10 0/5] Introduce mseal

2024-05-14 Thread Matthew Wilcox
On Tue, May 14, 2024 at 02:59:57PM -0600, Jonathan Corbet wrote: > Andrew Morton writes: > > > On Mon, 15 Apr 2024 16:35:19 + jef...@chromium.org wrote: > > > >> This patchset proposes a new mseal() syscall for the Linux kernel. > > > > I have not moved this into mm-stable for a 6.10 merge.

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Matthew Wilcox
On Thu, Jun 06, 2024 at 01:58:35PM +, Pankaj Raghav (Samsung) wrote: > +++ b/tools/testing/selftests/mm/split_huge_page_test.c > @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, > size_t fd_size, int *fd, > char **addr) > { > size_t i; > - int

Re: [PATCH v1 2/2] selftests/mm: mseal_test add more tests

2024-08-29 Thread Matthew Wilcox
On Thu, Aug 29, 2024 at 12:54:09PM -0700, Jeff Xu wrote: > Hi Lorenzo > > On Thu, Aug 29, 2024 at 8:44 AM Lorenzo Stoakes > wrote: > > > > > > > > > Also, this is a really unusual way to send a series - why is this a 2/2 > > > > in > > > > reply to the 1/2 and no cover letter? Why is this chang

Re: [PATCH v3 1/4] ida: Add ida_find_first_range()

2024-09-12 Thread Matthew Wilcox
_ida)) > 0) { > //anything to do with the allocated ID > ida_free(pasid_ida, pasid); > } > > Cc: Matthew Wilcox (Oracle) > Suggested-by: Jason Gunthorpe > Signed-off-by: Yi Liu > --- > include/linux/idr.h | 11 > lib/i

Re: [PATCH v3 1/4] ida: Add ida_find_first_range()

2024-09-13 Thread Matthew Wilcox
On Fri, Sep 13, 2024 at 07:45:55PM +0800, Yi Liu wrote: > > No test cases for the test suite? ;-( > > let me add something like the below. :) That looks pretty comprehensive, thanks! Acked-by: Matthew Wilcox (Oracle)