Select the types of activity you want to include in your feed.
Merge branch 'mm-hotfixes-stable' into mm-stable in order to merge
"mm/huge_memory: only get folio_order() once during __folio_split()" into
mm-stable.
···36913691 struct folio *folio, unsigned long start,36923692 unsigned long addr, unsigned int nr_pages,36933693 unsigned long *rss, unsigned short *mmap_miss,36943694- bool can_map_large)36943694+ pgoff_t file_end)36953695{36963696+ struct address_space *mapping = folio->mapping;36963697 unsigned int ref_from_caller = 1;36973698 vm_fault_t ret = 0;36983699 struct page *page = folio_page(folio, start);···37023701 unsigned long addr0;3703370237043703 /*37053705- * Map the large folio fully where possible.37043704+ * Map the large folio fully where possible:37063705 *37073707- * The folio must not cross VMA or page table boundary.37063706+ * - The folio is fully within size of the file or belong37073707+ * to shmem/tmpfs;37083708+ * - The folio doesn't cross VMA boundary;37093709+ * - The folio doesn't cross page table boundary;37083710 */37093711 addr0 = addr - start * PAGE_SIZE;37103710- if (can_map_large && folio_within_vma(folio, vmf->vma) &&37123712+ if ((file_end >= folio_next_index(folio) || shmem_mapping(mapping)) &&37133713+ folio_within_vma(folio, vmf->vma) &&37113714 (addr0 & PMD_MASK) == ((addr0 + folio_size(folio) - 1) & PMD_MASK)) {37123715 vmf->pte -= start;37133716 page -= start;···38263821 unsigned long rss = 0;38273822 unsigned int nr_pages = 0, folio_type;38283823 unsigned short mmap_miss = 0, mmap_miss_saved;38293829- bool can_map_large;3830382438313825 rcu_read_lock();38323826 folio = next_uptodate_folio(&xas, mapping, end_pgoff);···38363832 end_pgoff = min(end_pgoff, file_end);3837383338383834 /*38393839- * Do not allow to map with PTEs beyond i_size and with PMD38403840- * across i_size to preserve SIGBUS semantics.38353835+ * Do not allow to map with PMD across i_size to preserve38363836+ * SIGBUS semantics.38413837 *38423838 * Make an exception for shmem/tmpfs that for long time38433839 * intentionally mapped with PMDs across i_size.38443840 */38453845- can_map_large = shmem_mapping(mapping) ||38463846- file_end >= folio_next_index(folio);38473847-38483848- if (can_map_large && filemap_map_pmd(vmf, folio, start_pgoff)) {38413841+ if ((file_end >= folio_next_index(folio) || shmem_mapping(mapping)) &&38423842+ filemap_map_pmd(vmf, folio, start_pgoff)) {38493843 ret = VM_FAULT_NOPAGE;38503844 goto out;38513845 }···38723870 else38733871 ret |= filemap_map_folio_range(vmf, folio,38743872 xas.xa_index - folio->index, addr,38753875- nr_pages, &rss, &mmap_miss,38763876- can_map_large);38733873+ nr_pages, &rss, &mmap_miss, file_end);3877387438783875 folio_unlock(folio);38793876 } while ((folio = next_uptodate_folio(&xas, mapping, end_pgoff)) != NULL);
+10-12
mm/huge_memory.c
···35603560 if (folio != page_folio(split_at) || folio != page_folio(lock_at))35613561 return -EINVAL;3562356235633563+ /*35643564+ * Folios that just got truncated cannot get split. Signal to the35653565+ * caller that there was a race.35663566+ *35673567+ * TODO: this will also currently refuse shmem folios that are in the35683568+ * swapcache.35693569+ */35703570+ if (!is_anon && !folio->mapping)35713571+ return -EBUSY;35723572+35633573 if (new_order >= folio_order(folio))35643574 return -EINVAL;35653575···36103600 gfp_t gfp;3611360136123602 mapping = folio->mapping;36133613-36143614- /* Truncated ? */36153615- /*36163616- * TODO: add support for large shmem folio in swap cache.36173617- * When shmem is in swap cache, mapping is NULL and36183618- * folio_test_swapcache() is true.36193619- */36203620- if (!mapping) {36213621- ret = -EBUSY;36223622- goto out;36233623- }36243624-36253603 min_order = mapping_min_folio_order(folio->mapping);36263604 if (new_order < min_order) {36273605 ret = -EINVAL;
+27
mm/memfd.c
···9696 NULL,9797 gfp_mask);9898 if (folio) {9999+ u32 hash;100100+101101+ /*102102+ * Zero the folio to prevent information leaks to userspace.103103+ * Use folio_zero_user() which is optimized for huge/gigantic104104+ * pages. Pass 0 as addr_hint since this is not a faulting path105105+ * and we don't have a user virtual address yet.106106+ */107107+ folio_zero_user(folio, 0);108108+109109+ /*110110+ * Mark the folio uptodate before adding to page cache,111111+ * as required by filemap.c and other hugetlb paths.112112+ */113113+ __folio_mark_uptodate(folio);114114+115115+ /*116116+ * Serialize hugepage allocation and instantiation to prevent117117+ * races with concurrent allocations, as required by all other118118+ * callers of hugetlb_add_to_page_cache().119119+ */120120+ hash = hugetlb_fault_mutex_hash(memfd->f_mapping, idx);121121+ mutex_lock(&hugetlb_fault_mutex_table[hash]);122122+99123 err = hugetlb_add_to_page_cache(folio,100124 memfd->f_mapping,101125 idx);126126+127127+ mutex_unlock(&hugetlb_fault_mutex_table[hash]);128128+102129 if (err) {103130 folio_put(folio);104131 goto err_unresv;
+1
mm/mmap_lock.c
···257257 if (PTR_ERR(vma) == -EAGAIN) {258258 count_vm_vma_lock_event(VMA_LOCK_MISS);259259 /* The area was replaced with another one */260260+ mas_set(&mas, address);260261 goto retry;261262 }262263