* [alexshi:mmunstable 31/43] mm/memory.c:4650:35: error: assignment to 'pgtable_t' {aka 'long unsigned int *'} from incompatible pointer type 'struct page *'
@ 2024-07-21 17:28 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-07-21 17:28 UTC (permalink / raw)
To: Alex Shi (Tencent); +Cc: oe-kbuild-all
tree: https://github.com/alexshi/linux.git mmunstable
head: 24c8778745b223097d5e3d590967626176306b1d
commit: 3ee93675accebc1936331d1225cb0e84411ee71f [31/43] mm/pgtable: fully use ptdesc in pte_alloc_one series functions
config: sparc-allnoconfig (https://download.01.org/0day-ci/archive/20240722/202407220155.P6mZKB5R-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240722/202407220155.P6mZKB5R-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407220155.P6mZKB5R-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/mmzone.h:22,
from include/linux/topology.h:33,
from include/linux/irq.h:19,
from include/asm-generic/hardirq.h:17,
from arch/sparc/include/asm/hardirq_32.h:11,
from arch/sparc/include/asm/hardirq.h:7,
from include/linux/hardirq.h:11,
from include/linux/interrupt.h:11,
from include/linux/kernel_stat.h:9,
from mm/memory.c:43:
mm/memory.c: In function '__pte_alloc':
include/linux/mm_types.h:504:41: error: passing argument 2 of 'pte_free' from incompatible pointer type [-Wincompatible-pointer-types]
502 | #define ptdesc_page(pt) (_Generic((pt), \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
503 | const struct ptdesc *: (const struct page *)(pt), \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
504 | struct ptdesc *: (struct page *)(pt)))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
| |
| struct page *
mm/memory.c:454:30: note: in expansion of macro 'ptdesc_page'
454 | pte_free(mm, ptdesc_page(ptdesc));
| ^~~~~~~~~~~
In file included from arch/sparc/include/asm/pgalloc.h:7,
from mm/memory.c:86:
arch/sparc/include/asm/pgalloc_32.h:74:48: note: expected 'pgtable_t' {aka 'long unsigned int *'} but argument is of type 'struct page *'
74 | void pte_free(struct mm_struct * mm, pgtable_t pte);
| ~~~~~~~~~~^~~
mm/memory.c: In function '__do_fault':
>> mm/memory.c:4650:35: error: assignment to 'pgtable_t' {aka 'long unsigned int *'} from incompatible pointer type 'struct page *' [-Wincompatible-pointer-types]
4650 | vmf->prealloc_pte = ptdesc_page(pte_alloc_one(vma->vm_mm));
| ^
mm/memory.c: In function 'do_fault_around':
mm/memory.c:5013:35: error: assignment to 'pgtable_t' {aka 'long unsigned int *'} from incompatible pointer type 'struct page *' [-Wincompatible-pointer-types]
5013 | vmf->prealloc_pte = ptdesc_page(pte_alloc_one(vmf->vma->vm_mm));
| ^
--
>> arch/sparc/mm/srmmu.c:349:11: error: conflicting types for 'pte_alloc_one'; have 'pte_t *(struct mm_struct *)' {aka 'long unsigned int *(struct mm_struct *)'}
349 | pgtable_t pte_alloc_one(struct mm_struct *mm)
| ^~~~~~~~~~~~~
In file included from arch/sparc/include/asm/pgalloc.h:7,
from arch/sparc/mm/srmmu.c:30:
arch/sparc/include/asm/pgalloc_32.h:58:16: note: previous declaration of 'pte_alloc_one' with type 'struct ptdesc *(struct mm_struct *)'
58 | struct ptdesc *pte_alloc_one(struct mm_struct *mm);
| ^~~~~~~~~~~~~
arch/sparc/mm/srmmu.c: In function 'poke_hypersparc':
arch/sparc/mm/srmmu.c:1082:32: warning: variable 'clear' set but not used [-Wunused-but-set-variable]
1082 | volatile unsigned long clear;
| ^~~~~
vim +4650 mm/memory.c
4622
4623 /*
4624 * The mmap_lock must have been held on entry, and may have been
4625 * released depending on flags and vma->vm_ops->fault() return value.
4626 * See filemap_fault() and __lock_page_retry().
4627 */
4628 static vm_fault_t __do_fault(struct vm_fault *vmf)
4629 {
4630 struct vm_area_struct *vma = vmf->vma;
4631 struct folio *folio;
4632 vm_fault_t ret;
4633
4634 /*
4635 * Preallocate pte before we take page_lock because this might lead to
4636 * deadlocks for memcg reclaim which waits for pages under writeback:
4637 * lock_page(A)
4638 * SetPageWriteback(A)
4639 * unlock_page(A)
4640 * lock_page(B)
4641 * lock_page(B)
4642 * pte_alloc_one
4643 * shrink_folio_list
4644 * wait_on_page_writeback(A)
4645 * SetPageWriteback(B)
4646 * unlock_page(B)
4647 * # flush A, B to clear the writeback
4648 */
4649 if (pmd_none(*vmf->pmd) && !vmf->prealloc_pte) {
> 4650 vmf->prealloc_pte = ptdesc_page(pte_alloc_one(vma->vm_mm));
4651 if (!vmf->prealloc_pte)
4652 return VM_FAULT_OOM;
4653 }
4654
4655 ret = vma->vm_ops->fault(vmf);
4656 if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY |
4657 VM_FAULT_DONE_COW)))
4658 return ret;
4659
4660 folio = page_folio(vmf->page);
4661 if (unlikely(PageHWPoison(vmf->page))) {
4662 vm_fault_t poisonret = VM_FAULT_HWPOISON;
4663 if (ret & VM_FAULT_LOCKED) {
4664 if (page_mapped(vmf->page))
4665 unmap_mapping_folio(folio);
4666 /* Retry if a clean folio was removed from the cache. */
4667 if (mapping_evict_folio(folio->mapping, folio))
4668 poisonret = VM_FAULT_NOPAGE;
4669 folio_unlock(folio);
4670 }
4671 folio_put(folio);
4672 vmf->page = NULL;
4673 return poisonret;
4674 }
4675
4676 if (unlikely(!(ret & VM_FAULT_LOCKED)))
4677 folio_lock(folio);
4678 else
4679 VM_BUG_ON_PAGE(!folio_test_locked(folio), vmf->page);
4680
4681 return ret;
4682 }
4683
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-07-21 17:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-21 17:28 [alexshi:mmunstable 31/43] mm/memory.c:4650:35: error: assignment to 'pgtable_t' {aka 'long unsigned int *'} from incompatible pointer type 'struct page *' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.