Re: [PATCH RFC v3 for-6.8/block 09/17] btrfs: use bdev apis

2023-12-23 Thread Matthew Wilcox
On Thu, Dec 21, 2023 at 04:57:04PM +0800, Yu Kuai wrote: > @@ -3674,16 +3670,17 @@ struct btrfs_super_block > *btrfs_read_dev_one_super(struct block_device *bdev, >* Drop the page of the primary superblock, so later read will >* always read from the device. >

Re: [PATCH -next RFC 01/14] block: add some bdev apis

2023-12-06 Thread Matthew Wilcox
On Tue, Dec 05, 2023 at 08:37:15PM +0800, Yu Kuai wrote: > +struct folio *bdev_read_folio(struct block_device *bdev, pgoff_t index) > +{ > + return read_mapping_folio(bdev->bd_inode->i_mapping, index, NULL); > +} > +EXPORT_SYMBOL_GPL(bdev_read_folio); I'm coming to the opinion that 'index' is

Re: [PATCH v6 06/38] mm: Add default definition of set_ptes()

2023-10-12 Thread Matthew Wilcox
On Thu, Oct 12, 2023 at 02:53:05PM +0100, David Woodhouse wrote: > > +   arch_enter_lazy_mmu_mode(); > > +   for (;;) { > > +   set_pte(ptep, pte); > > +   if (--nr == 0) > > +   break; > > +   ptep++; > > +   pte =

Re: [PATCH mm-unstable v7 00/31] Split ptdesc from struct page

2023-07-26 Thread Matthew Wilcox
On Mon, Jul 24, 2023 at 09:41:36PM -0700, Hugh Dickins wrote: > On Mon, 24 Jul 2023, Vishal Moola (Oracle) wrote: > > > The MM subsystem is trying to shrink struct page. This patchset > > introduces a memory descriptor for page table tracking - struct ptdesc. > > > > This patchset introduces

Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-04 Thread Matthew Wilcox
On Tue, Jul 04, 2023 at 07:06:26AM -0700, Bart Van Assche wrote: > On 7/4/23 05:21, Jan Kara wrote: > > +struct bdev_handle { > > + struct block_device *bdev; > > + void *holder; > > +}; > > Please explain in the patch description why a holder pointer is introduced > in struct bdev_handle and

Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-04 Thread Matthew Wilcox
On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode, > + void *holder, const struct blk_holder_ops *hops) > +{ > + struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle), > +

Re: [PATCH v6 00/33] Split ptdesc from struct page

2023-06-28 Thread Matthew Wilcox
On Wed, Jun 28, 2023 at 09:41:18AM +0200, David Hildenbrand wrote: > I'm not a friend of these "overlays"; it all only really makes sense to me > once we actually allocate the descriptors dynamically. Maybe some of the > existing/ongoing conversions were different (that's why I was asking for the

Re: [PATCH v6 00/33] Split ptdesc from struct page

2023-06-27 Thread Matthew Wilcox
On Mon, Jun 26, 2023 at 09:44:08PM -0700, Hugh Dickins wrote: > On Mon, 26 Jun 2023, Vishal Moola (Oracle) wrote: > > > The MM subsystem is trying to shrink struct page. This patchset > > introduces a memory descriptor for page table tracking - struct ptdesc. > ... > > 39 files changed, 686

Re: [PATCH v4 04/34] pgtable: Create struct ptdesc

2023-06-16 Thread Matthew Wilcox
On Thu, Jun 15, 2023 at 12:57:19AM -0700, Hugh Dickins wrote: > Probably just trivial collisions in most architectures, which either > of us can easily adjust to the other; powerpc likely to be more awkward, > but fairly easily resolved; s390 quite a problem. > > I've so far been unable to post a

Re: [PATCH 4/4] Strict XenStore entry parsing

2023-06-09 Thread Matthew Wilcox
On Fri, Jun 09, 2023 at 10:57:59PM -0400, Demi Marie Obenour wrote: > This uses the newly-introduced strict version of sscanf(). I can see that. Why does it do that? Documentation/process/5.Posting.rst (in general, there is a lack of detail across all four of these patches justifying why any

Re: [PATCH v2 05/34] mm: add utility functions for ptdesc

2023-05-27 Thread Matthew Wilcox
On Sat, May 27, 2023 at 01:41:44PM +0300, Mike Rapoport wrote: > Sorry if I wasn't clear, by "page table page" I meant the page (or memory > for that matter) for actual page table rather than struct page describing > that memory. > > So what we allocate here is the actual memory for the page

Re: [PATCH v2 01/34] mm: Add PAGE_TYPE_OP folio functions

2023-05-25 Thread Matthew Wilcox
On Thu, May 25, 2023 at 01:38:54PM -0700, Vishal Moola wrote: > On Thu, May 25, 2023 at 1:20 PM Mike Rapoport wrote: > > > > On Thu, May 25, 2023 at 10:00:23AM -0700, Vishal Moola wrote: > > > On Thu, May 25, 2023 at 1:56 AM Mike Rapoport wrote: > > > > > > > > Hi, > > > > > > > > On Mon, May

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-26 Thread Matthew Wilcox
On Thu, Jan 26, 2023 at 04:50:59PM +0200, Mike Rapoport wrote: > On Thu, Jan 26, 2023 at 11:17:09AM +0200, Mike Rapoport wrote: > > On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > > > +/* Use when VMA is not part of the VMA tree and needs no locking */ > > > +static inline

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Matthew Wilcox
On Wed, Jan 25, 2023 at 08:49:50AM -0800, Suren Baghdasaryan wrote: > On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote: > > > + /* > > > + * Flags, see mm.h. > > > + * WARNING! Do not modify directly. > > > + * Use {init|reset|set|clear|mod}_vm_flags() functions instead. >

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Matthew Wilcox
On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > +/* Use when VMA is not part of the VMA tree and needs no locking */ > +static inline void init_vm_flags(struct vm_area_struct *vma, > + unsigned long flags) > +{ > + vma->vm_flags = flags;

Re: [Ocfs2-devel] [RFC PATCH 02/34] block: introduce and use bio_new

2021-01-28 Thread Matthew Wilcox
FYI your email is completely unreadable to those not using html. I can't tell what you wrote and what Damien wrote. On Thu, Jan 28, 2021 at 08:33:10AM +, Chaitanya Kulkarni wrote: > On 1/27/21 11:21 PM, Damien Le Moal wrote: > > On 2021/01/28 16:12, Chaitanya Kulkarni wrote: > > >

Re: [PATCH 02/45] filemap: consistently use ->f_mapping over ->i_mapping

2020-11-24 Thread Matthew Wilcox
On Tue, Nov 24, 2020 at 02:27:08PM +0100, Christoph Hellwig wrote: > Use file->f_mapping in all remaining places that have a struct file > available to properly handle the case where inode->i_mapping != > file_inode(file)->i_mapping. > > Signed-off-by: Christoph Hellwi

Re: [RFC] MAINTAINERS tag for cleanup robot

2020-11-22 Thread Matthew Wilcox
On Sun, Nov 22, 2020 at 06:46:46AM -0800, Tom Rix wrote: > > On 11/21/20 7:23 PM, Matthew Wilcox wrote: > > On Sat, Nov 21, 2020 at 08:50:58AM -0800, t...@redhat.com wrote: > >> The fixer review is > >> https://reviews.llvm.org/D91789 > >> > >> A

Re: [RFC] MAINTAINERS tag for cleanup robot

2020-11-21 Thread Matthew Wilcox
On Sat, Nov 21, 2020 at 08:50:58AM -0800, t...@redhat.com wrote: > The fixer review is > https://reviews.llvm.org/D91789 > > A run over allyesconfig for x86_64 finds 62 issues, 5 are false positives. > The false positives are caused by macros passed to other macros and by > some macro expansions

Re: [PATCH 14/20] block: remove the nr_sects field in struct hd_struct

2020-11-20 Thread Matthew Wilcox
On Fri, Nov 20, 2020 at 04:32:53PM +0100, Christoph Hellwig wrote: > On Fri, Nov 20, 2020 at 12:21:21PM +0100, Jan Kara wrote: > > > > AFAICT bd_size_lock is pointless after these changes so we can just > > > > remove > > > > it? > > > > > > I don't think it is, as reuqiring bd_mutex for size

Re: [PATCH 17/20] filemap: consistently use ->f_mapping over ->i_mapping

2020-11-19 Thread Matthew Wilcox
On Wed, Nov 18, 2020 at 09:47:57AM +0100, Christoph Hellwig wrote: > @@ -2887,13 +2887,13 @@ EXPORT_SYMBOL(filemap_map_pages); > vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf) > { > struct page *page = vmf->page; > - struct inode *inode = file_inode(vmf->vma->vm_file); > +

Re: merge struct block_device and struct hd_struct

2020-11-18 Thread Matthew Wilcox
On Wed, Nov 18, 2020 at 10:23:51AM +0100, Jan Beulich wrote: > On 18.11.2020 10:09, Greg KH wrote: > > On Wed, Nov 18, 2020 at 10:04:04AM +0100, Jan Beulich wrote: > >> On 18.11.2020 09:58, Christoph Hellwig wrote: > >>> On Wed, Nov 18, 2020 at 09:56:11AM +0100, Jan Beulich wrote: > since

Re: [Ocfs2-devel] [RFC] treewide: cleanup unreachable breaks

2020-10-18 Thread Matthew Wilcox
On Sun, Oct 18, 2020 at 12:13:35PM -0700, James Bottomley wrote: > On Sun, 2020-10-18 at 19:59 +0100, Matthew Wilcox wrote: > > On Sat, Oct 17, 2020 at 09:09:28AM -0700, t...@redhat.com wrote: > > > clang has a number of useful, new warnings see > > > https:

Re: [Ocfs2-devel] [RFC] treewide: cleanup unreachable breaks

2020-10-18 Thread Matthew Wilcox
On Sat, Oct 17, 2020 at 09:09:28AM -0700, t...@redhat.com wrote: > clang has a number of useful, new warnings see > https://urldefense.com/v3/__https://clang.llvm.org/docs/DiagnosticsReference.html__;!!GqivPVa7Brio!Krxz78O3RKcB9JBMVo_F98FupVhj_jxX60ddN6tKGEbv_cnooXc1nnBmchm-e_O9ieGnyQ$ > Please

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Matthew Wilcox
On Tue, Oct 13, 2020 at 11:44:29AM -0700, Dan Williams wrote: > On Fri, Oct 9, 2020 at 12:52 PM wrote: > > > > From: Ira Weiny > > > > The kmap() calls in this FS are localized to a single thread. To avoid > > the over head of global PKRS updates use the new kmap_thread() call. > > > > Cc:

Re: [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-12 Thread Matthew Wilcox
On Mon, Oct 12, 2020 at 12:53:54PM -0700, Ira Weiny wrote: > On Mon, Oct 12, 2020 at 05:44:38PM +0100, Matthew Wilcox wrote: > > On Mon, Oct 12, 2020 at 09:28:29AM -0700, Dave Hansen wrote: > > > kmap_atomic() is always preferred over kmap()/kmap_thread(). > > > k

Re: [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-12 Thread Matthew Wilcox
On Mon, Oct 12, 2020 at 09:28:29AM -0700, Dave Hansen wrote: > kmap_atomic() is always preferred over kmap()/kmap_thread(). > kmap_atomic() is _much_ more lightweight since its TLB invalidation is > always CPU-local and never broadcast. > > So, basically, unless you *must* sleep while the mapping

Re: [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-09 Thread Matthew Wilcox
On Fri, Oct 09, 2020 at 02:34:34PM -0700, Eric Biggers wrote: > On Fri, Oct 09, 2020 at 12:49:57PM -0700, ira.we...@intel.com wrote: > > The kmap() calls in this FS are localized to a single thread. To avoid > > the over head of global PKRS updates use the new kmap_thread() call. > > > > @@

Re: [PATCH v1 1/5] mm/page_alloc: convert "report" flag of __free_one_page() to a proper flag

2020-10-02 Thread Matthew Wilcox
On Mon, Sep 28, 2020 at 08:21:06PM +0200, David Hildenbrand wrote: > Let's prepare for additional flags and avoid long parameter lists of bools. > Follow-up patches will also make use of the flags in __free_pages_ok(), > however, I wasn't able to come up with a better name for the type - should >

Re: [PATCH 3/6] drm/i915: use vmap in shmem_pin_map

2020-09-22 Thread Matthew Wilcox
On Tue, Sep 22, 2020 at 04:39:06PM +0200, Christoph Hellwig wrote: > On Tue, Sep 22, 2020 at 12:21:44PM +0100, Matthew Wilcox wrote: > > Actually, vfree() will work today; I cc'd you on a documentation update > > to make it clear that this is permitted. > > vfree calls _

Re: [PATCH 3/6] drm/i915: use vmap in shmem_pin_map

2020-09-22 Thread Matthew Wilcox
On Tue, Sep 22, 2020 at 08:22:49AM +0200, Christoph Hellwig wrote: > On Mon, Sep 21, 2020 at 08:11:57PM +0100, Matthew Wilcox wrote: > > This is awkward. I'd like it if we had a vfree() variant which called > > put_page() instead of __free_pages(). I'd like it even more

Re: [PATCH 3/6] drm/i915: use vmap in shmem_pin_map

2020-09-21 Thread Matthew Wilcox
On Fri, Sep 18, 2020 at 06:37:21PM +0200, Christoph Hellwig wrote: > void shmem_unpin_map(struct file *file, void *ptr) > { > + long i = shmem_npages(file); > + > mapping_clear_unevictable(file->f_mapping); > - __shmem_unpin_map(file, ptr, shmem_npte(file)); > + vunmap(ptr); >

Re: [Xen-devel] [PATCH 00/34] put_user_pages(): miscellaneous call sites

2019-08-02 Thread Matthew Wilcox
On Fri, Aug 02, 2019 at 02:41:46PM +0200, Jan Kara wrote: > On Fri 02-08-19 11:12:44, Michal Hocko wrote: > > On Thu 01-08-19 19:19:31, john.hubb...@gmail.com wrote: > > [...] > > > 2) Convert all of the call sites for get_user_pages*(), to > > > invoke put_user_page*(), instead of put_page().

Re: [Xen-devel] [PATCH] mm/pgtable: Drop pgtable_t variable from pte_fn_t functions

2019-05-03 Thread Matthew Wilcox
On Thu, May 02, 2019 at 04:14:57PM +0200, Martin Schwidefsky wrote: > On Thu, 2 May 2019 06:46:23 -0700 > Matthew Wilcox wrote: > > > On Thu, May 02, 2019 at 06:48:46PM +0530, Anshuman Khandual wrote: > > > Drop the pgtable_t variable from all implementat

Re: [Xen-devel] [PATCH] mm/pgtable: Drop pgtable_t variable from pte_fn_t functions

2019-05-02 Thread Matthew Wilcox
On Thu, May 02, 2019 at 06:48:46PM +0530, Anshuman Khandual wrote: > Drop the pgtable_t variable from all implementation for pte_fn_t as none of > them use it. apply_to_pte_range() should stop computing it as well. Should > help us save some cycles. You didn't add Martin Schwidefsky for some

Re: [Xen-devel] xen: Can't insert balloon page into VM userspace (WAS Re: [linux-linus bisection] complete test-arm64-arm64-xl-xsm)

2019-03-12 Thread Matthew Wilcox
ing commit: > > > > commit 0ee930e6cafa048c1925893d0ca89918b2814f2c > > Author: Matthew Wilcox > > Date: Tue Mar 5 15:46:06 2019 -0800 > > > > mm/memory.c: prevent mapping typed pages to userspace > > Pages which use page_type must never be mapped to use

Re: [Xen-devel] [PATCHv2 1/9] mm: Introduce new vm_insert_range and vm_insert_range_buggy API

2019-02-07 Thread Matthew Wilcox
On Thu, Feb 07, 2019 at 09:19:47PM +0530, Souptick Joarder wrote: > Just thought to take opinion for documentation before placing it in v3. > Does it looks fine ? > > +/** > + * __vm_insert_range - insert range of kernel pages into user vma > + * @vma: user vma to map to > + * @pages: pointer to

Re: [Xen-devel] [Intel-gfx] [PATCH 1/3] treewide: Lift switch variables out of switches

2019-01-23 Thread Matthew Wilcox
On Wed, Jan 23, 2019 at 04:17:30PM +0200, Jani Nikula wrote: > Can't have: > > switch (i) { > int j; > case 0: > /* ... */ > } > > because it can't be turned into: > > switch (i) { > int j = 0; /* not valid C */ > case 0: >

Re: [Xen-devel] [PATCH v3 1/9] mm: Introduce new vm_insert_range API

2018-12-07 Thread Matthew Wilcox
On Fri, Dec 07, 2018 at 03:34:56PM +, Robin Murphy wrote: > > +int vm_insert_range(struct vm_area_struct *vma, unsigned long addr, > > + struct page **pages, unsigned long page_count) > > +{ > > + unsigned long uaddr = addr; > > + int ret = 0, i; > > Some of the sites

Re: [Xen-devel] [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-21 Thread Matthew Wilcox
On Wed, Nov 21, 2018 at 04:19:11AM -0700, William Kucharski wrote: > Could you add a line to the description explicitly stating that a failure > to insert any page in the range will fail the entire routine, something > like: > > > * This allows drivers to insert range of kernel pages they've

Re: [Xen-devel] [PATCH 5/9] drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range

2018-11-19 Thread Matthew Wilcox
On Mon, Nov 19, 2018 at 01:02:46PM +0200, Oleksandr Andrushchenko wrote: > On 11/19/18 12:42 PM, Souptick Joarder wrote: > > On Mon, Nov 19, 2018 at 3:22 PM Oleksandr Andrushchenko > > wrote: > > > > - unsigned long addr = vma->vm_start; > > > > - int i; > > > > + int err; > > > I

Re: [Xen-devel] [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-17 Thread Matthew Wilcox
On Sat, Nov 17, 2018 at 12:26:38PM +0530, Souptick Joarder wrote: > On Fri, Nov 16, 2018 at 11:59 PM Mike Rapoport wrote: > > > + * vm_insert_range - insert range of kernel pages into user vma > > > + * @vma: user vma to map to > > > + * @addr: target user address of this page > > > + * @pages:

Re: [Xen-devel] [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-15 Thread Matthew Wilcox
On Fri, Nov 16, 2018 at 11:00:30AM +0530, Souptick Joarder wrote: > On Thu, Nov 15, 2018 at 11:44 PM Randy Dunlap wrote: > > On 11/15/18 7:45 AM, Souptick Joarder wrote: > > What is the opposite of vm_insert_range() or even of vm_insert_page()? > > or is there no need for that? > > There is no

Re: [Xen-devel] [PATCH RFC 2/6] mm: convert PG_balloon to PG_offline

2018-11-14 Thread Matthew Wilcox
On Wed, Nov 14, 2018 at 10:17:00PM +0100, David Hildenbrand wrote: > Rename PG_balloon to PG_offline. This is an indicator that the page is > logically offline, the content stale and that it should not be touched > (e.g. a hypervisor would have to allocate backing storage in order for the > guest

Re: [Xen-devel] [RFC PATCH v2 00/12] get rid of GFP_ZONE_TABLE/BAD

2018-05-25 Thread Matthew Wilcox
On Thu, May 24, 2018 at 05:29:43PM +0200, Michal Hocko wrote: > > ie if we had more, > > could we solve our pain by making them more generic? > > Well, if you have more you will consume more bits in the struct pages, > right? Not necessarily ... the zone number is stored in the struct page

Re: [Xen-devel] [RFC PATCH v2 00/12] get rid of GFP_ZONE_TABLE/BAD

2018-05-24 Thread Matthew Wilcox
On Thu, May 24, 2018 at 02:23:23PM +0200, Michal Hocko wrote: > > If we had eight ZONEs, we could offer: > > No, please no more zones. What we have is quite a maint. burden on its > own. Ideally we should only have lowmem, highmem and special/device > zones for directly kernel accessible memory,

Re: [Xen-devel] [RFC PATCH v2 00/12] get rid of GFP_ZONE_TABLE/BAD

2018-05-23 Thread Matthew Wilcox
On Tue, May 22, 2018 at 08:37:28PM +0200, Michal Hocko wrote: > So why is this any better than the current code. Sure I am not a great > fan of GFP_ZONE_TABLE because of how it is incomprehensible but this > doesn't look too much better, yet we are losing a check for incompatible > gfp flags. The

Re: [Xen-devel] [RFC PATCH v2 10/12] mm/zsmalloc: update usage of address zone modifiers

2018-05-22 Thread Matthew Wilcox
On Mon, May 21, 2018 at 11:20:31PM +0800, Huaisheng Ye wrote: > @@ -343,7 +343,7 @@ static void destroy_cache(struct zs_pool *pool) > static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp) > { > return (unsigned long)kmem_cache_alloc(pool->handle_cachep, > -

Re: [Xen-devel] [Bug 198497] handle_mm_fault / xen_pmd_val / radix_tree_lookup_slot Null pointer

2018-04-21 Thread Matthew Wilcox
On Fri, Apr 20, 2018 at 10:02:29AM -0600, Jan Beulich wrote: > Skylake 32bit PAE Dom0: > Bad swp_entry: 8000 > mm/swap_state.c:683: bad pte d3a39f1c(8004) > > Ivy Bridge 32bit PAE Dom0: > Bad swp_entry: 4000 > mm/swap_state.c:683: bad pte