Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
"13 patches.

Subsystems affected by this patch series: mips, mm (kfence, debug,
pagealloc, memory-hotplug, hugetlb, kasan, and hugetlb), init, proc,
lib, ocfs2, and mailmap"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mailmap: use private address for Michel Lespinasse
ocfs2: fix data corruption by fallocate
lib: crc64: fix kernel-doc warning
mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY
mm/kasan/init.c: fix doc warning
proc: add .gitignore for proc-subset-pid selftest
hugetlb: pass head page to remove_hugetlb_page()
drivers/base/memory: fix trying offlining memory blocks with memory holes on aarch64
mm/page_alloc: fix counting of free pages after take off from buddy
mm/debug_vm_pgtable: fix alignment for pmd/pud_advanced_tests()
pid: take a reference when initializing `cad_pid`
kfence: use TASK_IDLE when awaiting allocation
Revert "MIPS: make userspace mapping young by default"

+108 -37
+3
.mailmap
··· 243 243 Mayuresh Janorkar <mayur@ti.com> 244 244 Michael Buesch <m@bues.ch> 245 245 Michel Dänzer <michel@tungstengraphics.com> 246 + Michel Lespinasse <michel@lespinasse.org> 247 + Michel Lespinasse <michel@lespinasse.org> <walken@google.com> 248 + Michel Lespinasse <michel@lespinasse.org> <walken@zoy.org> 246 249 Miguel Ojeda <ojeda@kernel.org> <miguel.ojeda.sandonis@gmail.com> 247 250 Mike Rapoport <rppt@kernel.org> <mike@compulab.co.il> 248 251 Mike Rapoport <rppt@kernel.org> <mike.rapoport@gmail.com>
+14 -16
arch/mips/mm/cache.c
··· 158 158 EXPORT_SYMBOL(_page_cachable_default); 159 159 160 160 #define PM(p) __pgprot(_page_cachable_default | (p)) 161 - #define PVA(p) PM(_PAGE_VALID | _PAGE_ACCESSED | (p)) 162 161 163 162 static inline void setup_protection_map(void) 164 163 { 165 164 protection_map[0] = PM(_PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); 166 - protection_map[1] = PVA(_PAGE_PRESENT | _PAGE_NO_EXEC); 167 - protection_map[2] = PVA(_PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); 168 - protection_map[3] = PVA(_PAGE_PRESENT | _PAGE_NO_EXEC); 169 - protection_map[4] = PVA(_PAGE_PRESENT); 170 - protection_map[5] = PVA(_PAGE_PRESENT); 171 - protection_map[6] = PVA(_PAGE_PRESENT); 172 - protection_map[7] = PVA(_PAGE_PRESENT); 165 + protection_map[1] = PM(_PAGE_PRESENT | _PAGE_NO_EXEC); 166 + protection_map[2] = PM(_PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); 167 + protection_map[3] = PM(_PAGE_PRESENT | _PAGE_NO_EXEC); 168 + protection_map[4] = PM(_PAGE_PRESENT); 169 + protection_map[5] = PM(_PAGE_PRESENT); 170 + protection_map[6] = PM(_PAGE_PRESENT); 171 + protection_map[7] = PM(_PAGE_PRESENT); 173 172 174 173 protection_map[8] = PM(_PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); 175 - protection_map[9] = PVA(_PAGE_PRESENT | _PAGE_NO_EXEC); 176 - protection_map[10] = PVA(_PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE | 174 + protection_map[9] = PM(_PAGE_PRESENT | _PAGE_NO_EXEC); 175 + protection_map[10] = PM(_PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE | 177 176 _PAGE_NO_READ); 178 - protection_map[11] = PVA(_PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE); 179 - protection_map[12] = PVA(_PAGE_PRESENT); 180 - protection_map[13] = PVA(_PAGE_PRESENT); 181 - protection_map[14] = PVA(_PAGE_PRESENT); 182 - protection_map[15] = PVA(_PAGE_PRESENT); 177 + protection_map[11] = PM(_PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE); 178 + protection_map[12] = PM(_PAGE_PRESENT); 179 + protection_map[13] = PM(_PAGE_PRESENT); 180 + protection_map[14] = PM(_PAGE_PRESENT | _PAGE_WRITE); 181 + protection_map[15] = PM(_PAGE_PRESENT | _PAGE_WRITE); 183 182 } 184 183 185 - #undef _PVA 186 184 #undef PM 187 185 188 186 void cpu_cache_init(void)
+3 -3
drivers/base/memory.c
··· 218 218 struct zone *zone; 219 219 int ret; 220 220 221 - zone = page_zone(pfn_to_page(start_pfn)); 222 - 223 221 /* 224 222 * Unaccount before offlining, such that unpopulated zone and kthreads 225 223 * can properly be torn down in offline_pages(). 226 224 */ 227 - if (nr_vmemmap_pages) 225 + if (nr_vmemmap_pages) { 226 + zone = page_zone(pfn_to_page(start_pfn)); 228 227 adjust_present_page_count(zone, -nr_vmemmap_pages); 228 + } 229 229 230 230 ret = offline_pages(start_pfn + nr_vmemmap_pages, 231 231 nr_pages - nr_vmemmap_pages);
+50 -5
fs/ocfs2/file.c
··· 1856 1856 } 1857 1857 1858 1858 /* 1859 + * zero out partial blocks of one cluster. 1860 + * 1861 + * start: file offset where zero starts, will be made upper block aligned. 1862 + * len: it will be trimmed to the end of current cluster if "start + len" 1863 + * is bigger than it. 1864 + */ 1865 + static int ocfs2_zeroout_partial_cluster(struct inode *inode, 1866 + u64 start, u64 len) 1867 + { 1868 + int ret; 1869 + u64 start_block, end_block, nr_blocks; 1870 + u64 p_block, offset; 1871 + u32 cluster, p_cluster, nr_clusters; 1872 + struct super_block *sb = inode->i_sb; 1873 + u64 end = ocfs2_align_bytes_to_clusters(sb, start); 1874 + 1875 + if (start + len < end) 1876 + end = start + len; 1877 + 1878 + start_block = ocfs2_blocks_for_bytes(sb, start); 1879 + end_block = ocfs2_blocks_for_bytes(sb, end); 1880 + nr_blocks = end_block - start_block; 1881 + if (!nr_blocks) 1882 + return 0; 1883 + 1884 + cluster = ocfs2_bytes_to_clusters(sb, start); 1885 + ret = ocfs2_get_clusters(inode, cluster, &p_cluster, 1886 + &nr_clusters, NULL); 1887 + if (ret) 1888 + return ret; 1889 + if (!p_cluster) 1890 + return 0; 1891 + 1892 + offset = start_block - ocfs2_clusters_to_blocks(sb, cluster); 1893 + p_block = ocfs2_clusters_to_blocks(sb, p_cluster) + offset; 1894 + return sb_issue_zeroout(sb, p_block, nr_blocks, GFP_NOFS); 1895 + } 1896 + 1897 + /* 1859 1898 * Parts of this function taken from xfs_change_file_space() 1860 1899 */ 1861 1900 static int __ocfs2_change_file_space(struct file *file, struct inode *inode, ··· 1904 1865 { 1905 1866 int ret; 1906 1867 s64 llen; 1907 - loff_t size; 1868 + loff_t size, orig_isize; 1908 1869 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1909 1870 struct buffer_head *di_bh = NULL; 1910 1871 handle_t *handle; ··· 1935 1896 goto out_inode_unlock; 1936 1897 } 1937 1898 1899 + orig_isize = i_size_read(inode); 1938 1900 switch (sr->l_whence) { 1939 1901 case 0: /*SEEK_SET*/ 1940 1902 break; ··· 1943 1903 sr->l_start += f_pos; 1944 1904 break; 1945 1905 case 2: /*SEEK_END*/ 1946 - sr->l_start += i_size_read(inode); 1906 + sr->l_start += orig_isize; 1947 1907 break; 1948 1908 default: 1949 1909 ret = -EINVAL; ··· 1997 1957 default: 1998 1958 ret = -EINVAL; 1999 1959 } 1960 + 1961 + /* zeroout eof blocks in the cluster. */ 1962 + if (!ret && change_size && orig_isize < size) { 1963 + ret = ocfs2_zeroout_partial_cluster(inode, orig_isize, 1964 + size - orig_isize); 1965 + if (!ret) 1966 + i_size_write(inode, size); 1967 + } 2000 1968 up_write(&OCFS2_I(inode)->ip_alloc_sem); 2001 1969 if (ret) { 2002 1970 mlog_errno(ret); ··· 2020 1972 mlog_errno(ret); 2021 1973 goto out_inode_unlock; 2022 1974 } 2023 - 2024 - if (change_size && i_size_read(inode) < size) 2025 - i_size_write(inode, size); 2026 1975 2027 1976 inode->i_ctime = inode->i_mtime = current_time(inode); 2028 1977 ret = ocfs2_mark_inode_dirty(handle, inode, di_bh);
+8
include/linux/pgtable.h
··· 432 432 * To be differentiate with macro pte_mkyoung, this macro is used on platforms 433 433 * where software maintains page access bit. 434 434 */ 435 + #ifndef pte_sw_mkyoung 436 + static inline pte_t pte_sw_mkyoung(pte_t pte) 437 + { 438 + return pte; 439 + } 440 + #define pte_sw_mkyoung pte_sw_mkyoung 441 + #endif 442 + 435 443 #ifndef pte_savedwrite 436 444 #define pte_savedwrite pte_write 437 445 #endif
+1 -1
init/main.c
··· 1537 1537 */ 1538 1538 set_mems_allowed(node_states[N_MEMORY]); 1539 1539 1540 - cad_pid = task_pid(current); 1540 + cad_pid = get_pid(task_pid(current)); 1541 1541 1542 1542 smp_prepare_cpus(setup_max_cpus); 1543 1543
+1 -1
lib/crc64.c
··· 37 37 /** 38 38 * crc64_be - Calculate bitwise big-endian ECMA-182 CRC64 39 39 * @crc: seed value for computation. 0 or (u64)~0 for a new CRC calculation, 40 - or the previous crc64 value if computing incrementally. 40 + * or the previous crc64 value if computing incrementally. 41 41 * @p: pointer to buffer over which CRC64 is run 42 42 * @len: length of buffer @p 43 43 */
+2 -2
mm/debug_vm_pgtable.c
··· 192 192 193 193 pr_debug("Validating PMD advanced\n"); 194 194 /* Align the address wrt HPAGE_PMD_SIZE */ 195 - vaddr = (vaddr & HPAGE_PMD_MASK) + HPAGE_PMD_SIZE; 195 + vaddr &= HPAGE_PMD_MASK; 196 196 197 197 pgtable_trans_huge_deposit(mm, pmdp, pgtable); 198 198 ··· 330 330 331 331 pr_debug("Validating PUD advanced\n"); 332 332 /* Align the address wrt HPAGE_PUD_SIZE */ 333 - vaddr = (vaddr & HPAGE_PUD_MASK) + HPAGE_PUD_SIZE; 333 + vaddr &= HPAGE_PUD_MASK; 334 334 335 335 set_pud_at(mm, vaddr, pudp, pud); 336 336 pudp_set_wrprotect(mm, vaddr, pudp);
+14 -4
mm/hugetlb.c
··· 1793 1793 SetPageHWPoison(page); 1794 1794 ClearPageHWPoison(head); 1795 1795 } 1796 - remove_hugetlb_page(h, page, false); 1796 + remove_hugetlb_page(h, head, false); 1797 1797 h->max_huge_pages--; 1798 1798 spin_unlock_irq(&hugetlb_lock); 1799 1799 update_and_free_page(h, head); ··· 4889 4889 if (!page) 4890 4890 goto out; 4891 4891 } else if (!*pagep) { 4892 - ret = -ENOMEM; 4893 - page = alloc_huge_page(dst_vma, dst_addr, 0); 4894 - if (IS_ERR(page)) 4892 + /* If a page already exists, then it's UFFDIO_COPY for 4893 + * a non-missing case. Return -EEXIST. 4894 + */ 4895 + if (vm_shared && 4896 + hugetlbfs_pagecache_present(h, dst_vma, dst_addr)) { 4897 + ret = -EEXIST; 4895 4898 goto out; 4899 + } 4900 + 4901 + page = alloc_huge_page(dst_vma, dst_addr, 0); 4902 + if (IS_ERR(page)) { 4903 + ret = -ENOMEM; 4904 + goto out; 4905 + } 4896 4906 4897 4907 ret = copy_huge_page_from_user(page, 4898 4908 (const void __user *) src_addr,
+2 -2
mm/kasan/init.c
··· 220 220 /** 221 221 * kasan_populate_early_shadow - populate shadow memory region with 222 222 * kasan_early_shadow_page 223 - * @shadow_start - start of the memory range to populate 224 - * @shadow_end - end of the memory range to populate 223 + * @shadow_start: start of the memory range to populate 224 + * @shadow_end: end of the memory range to populate 225 225 */ 226 226 int __ref kasan_populate_early_shadow(const void *shadow_start, 227 227 const void *shadow_end)
+3 -3
mm/kfence/core.c
··· 627 627 * During low activity with no allocations we might wait a 628 628 * while; let's avoid the hung task warning. 629 629 */ 630 - wait_event_timeout(allocation_wait, atomic_read(&kfence_allocation_gate), 631 - sysctl_hung_task_timeout_secs * HZ / 2); 630 + wait_event_idle_timeout(allocation_wait, atomic_read(&kfence_allocation_gate), 631 + sysctl_hung_task_timeout_secs * HZ / 2); 632 632 } else { 633 - wait_event(allocation_wait, atomic_read(&kfence_allocation_gate)); 633 + wait_event_idle(allocation_wait, atomic_read(&kfence_allocation_gate)); 634 634 } 635 635 636 636 /* Disable static key and reset timer. */
+4
mm/memory.c
··· 2939 2939 } 2940 2940 flush_cache_page(vma, vmf->address, pte_pfn(vmf->orig_pte)); 2941 2941 entry = mk_pte(new_page, vma->vm_page_prot); 2942 + entry = pte_sw_mkyoung(entry); 2942 2943 entry = maybe_mkwrite(pte_mkdirty(entry), vma); 2943 2944 2944 2945 /* ··· 3603 3602 __SetPageUptodate(page); 3604 3603 3605 3604 entry = mk_pte(page, vma->vm_page_prot); 3605 + entry = pte_sw_mkyoung(entry); 3606 3606 if (vma->vm_flags & VM_WRITE) 3607 3607 entry = pte_mkwrite(pte_mkdirty(entry)); 3608 3608 ··· 3788 3786 3789 3787 if (prefault && arch_wants_old_prefaulted_pte()) 3790 3788 entry = pte_mkold(entry); 3789 + else 3790 + entry = pte_sw_mkyoung(entry); 3791 3791 3792 3792 if (write) 3793 3793 entry = maybe_mkwrite(pte_mkdirty(entry), vma);
+2
mm/page_alloc.c
··· 9158 9158 del_page_from_free_list(page_head, zone, page_order); 9159 9159 break_down_buddy_pages(zone, page_head, page, 0, 9160 9160 page_order, migratetype); 9161 + if (!is_migrate_isolate(migratetype)) 9162 + __mod_zone_freepage_state(zone, -1, migratetype); 9161 9163 ret = true; 9162 9164 break; 9163 9165 }
+1
tools/testing/selftests/proc/.gitignore
··· 10 10 /proc-self-map-files-002 11 11 /proc-self-syscall 12 12 /proc-self-wchan 13 + /proc-subset-pid 13 14 /proc-uptime-001 14 15 /proc-uptime-002 15 16 /read