From: kernel test robot <lkp@intel.com>
To: "Alex Shi (Tencent)" <alexs@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [alexshi:mmunstable2 38/42] mm/memory.c:4650:35: error: assignment to 'struct ptdesc *' from incompatible pointer type 'pgtable_t' {aka 'pte_t *'}
Date: Sun, 21 Jul 2024 21:51:26 +0800 [thread overview]
Message-ID: <202407212146.6dFfRFLE-lkp@intel.com> (raw)
tree: https://github.com/alexshi/linux.git mmunstable2
head: 17ce8ec8001d3efaa81c659d6ec565025c3f42b0
commit: f4c4f25d6f74bc03fe3e095de591c9a78735d6d2 [38/42] mm: convert vmf.prealloc_pte to struct ptdesc pointer
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240721/202407212146.6dFfRFLE-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240721/202407212146.6dFfRFLE-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/202407212146.6dFfRFLE-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/m68k/include/generated/asm/hardirq.h:1,
from include/linux/hardirq.h:11,
from include/linux/interrupt.h:11,
from include/linux/kernel_stat.h:9,
from mm/memory.c:43:
arch/m68k/include/asm/motorola_pgalloc.h: In function 'pmd_populate':
include/linux/mm_types.h:504:41: error: passing argument 2 of 'pmd_set' 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 *
arch/m68k/include/asm/motorola_pgalloc.h:89:22: note: in expansion of macro 'ptdesc_page'
89 | pmd_set(pmd, ptdesc_page(page));
| ^~~~~~~~~~~
In file included from arch/m68k/include/asm/pgtable_mm.h:157,
from arch/m68k/include/asm/pgtable.h:10,
from include/linux/pgtable.h:6,
from include/linux/mm.h:30,
from mm/memory.c:44:
arch/m68k/include/asm/motorola_pgtable.h:96:48: note: expected 'pte_t *' but argument is of type 'struct page *'
96 | static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
| ~~~~~~~^~~~
mm/memory.c: In function '__pte_alloc':
mm/memory.c:448:33: error: initialization of 'struct ptdesc *' from incompatible pointer type 'pgtable_t' {aka 'pte_t *'} [-Wincompatible-pointer-types]
448 | struct ptdesc *ptdesc = pte_alloc_one(mm);
| ^~~~~~~~~~~~~
mm/memory.c:454:30: error: passing argument 2 of 'pte_free' from incompatible pointer type [-Wincompatible-pointer-types]
454 | pte_free(mm, ptdesc);
| ^~~~~~
| |
| struct ptdesc *
In file included from arch/m68k/include/asm/pgalloc.h:16,
from mm/memory.c:86:
arch/m68k/include/asm/motorola_pgalloc.h:42:61: note: expected 'pgtable_t' {aka 'pte_t *'} but argument is of type 'struct ptdesc *'
42 | static inline void pte_free(struct mm_struct *mm, pgtable_t pgtable)
| ~~~~~~~~~~^~~~~~~
mm/memory.c: In function '__do_fault':
>> mm/memory.c:4650:35: error: assignment to 'struct ptdesc *' from incompatible pointer type 'pgtable_t' {aka 'pte_t *'} [-Wincompatible-pointer-types]
4650 | vmf->prealloc_pte = pte_alloc_one(vma->vm_mm);
| ^
mm/memory.c: In function 'do_fault_around':
mm/memory.c:5013:35: error: assignment to 'struct ptdesc *' from incompatible pointer type 'pgtable_t' {aka 'pte_t *'} [-Wincompatible-pointer-types]
5013 | vmf->prealloc_pte = pte_alloc_one(vmf->vma->vm_mm);
| ^
mm/memory.c: In function 'do_fault':
mm/memory.c:5199:36: error: passing argument 2 of 'pte_free' from incompatible pointer type [-Wincompatible-pointer-types]
5199 | pte_free(vm_mm, vmf->prealloc_pte);
| ~~~^~~~~~~~~~~~~~
| |
| struct ptdesc *
arch/m68k/include/asm/motorola_pgalloc.h:42:61: note: expected 'pgtable_t' {aka 'pte_t *'} but argument is of type 'struct ptdesc *'
42 | static inline void pte_free(struct mm_struct *mm, pgtable_t pgtable)
| ~~~~~~~~~~^~~~~~~
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 = 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
reply other threads:[~2024-07-21 13:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202407212146.6dFfRFLE-lkp@intel.com \
--to=lkp@intel.com \
--cc=alexs@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.