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 tag 'mm-hotfixes-stable-2024-07-26-14-33' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc hotfixes from Andrew Morton:
"11 hotfixes, 7 of which are cc:stable. 7 are MM, 4 are other"

* tag 'mm-hotfixes-stable-2024-07-26-14-33' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
nilfs2: handle inconsistent state in nilfs_btnode_create_block()
selftests/mm: skip test for non-LPA2 and non-LVA systems
mm/page_alloc: fix pcp->count race between drain_pages_zone() vs __rmqueue_pcplist()
mm: memcg: add cacheline padding after lruvec in mem_cgroup_per_node
alloc_tag: outline and export free_reserved_page()
decompress_bunzip2: fix rare decompression failure
mm/huge_memory: avoid PMD-size page cache if needed
mm: huge_memory: use !CONFIG_64BIT to relax huge page alignment on 32 bit machines
mm: fix old/young bit handling in the faulting path
dt-bindings: arm: update James Clark's email address
MAINTAINERS: mailmap: update James Clark's email address

+95 -42
+1
.mailmap
··· 260 260 Jakub Kicinski <kuba@kernel.org> <jakub.kicinski@netronome.com> 261 261 James Bottomley <jejb@mulgrave.(none)> 262 262 James Bottomley <jejb@titanic.il.steeleye.com> 263 + James Clark <james.clark@linaro.org> <james.clark@arm.com> 263 264 James E Wilson <wilson@specifix.com> 264 265 James Hogan <jhogan@kernel.org> <james@albanarts.com> 265 266 James Hogan <jhogan@kernel.org> <james.hogan@imgtec.com>
+1 -1
Documentation/devicetree/bindings/arm/arm,coresight-dummy-sink.yaml
··· 30 30 maintainers: 31 31 - Mike Leach <mike.leach@linaro.org> 32 32 - Suzuki K Poulose <suzuki.poulose@arm.com> 33 - - James Clark <james.clark@arm.com> 33 + - James Clark <james.clark@linaro.org> 34 34 - Mao Jinlong <quic_jinlmao@quicinc.com> 35 35 - Hao Zhang <quic_hazha@quicinc.com> 36 36
+1 -1
Documentation/devicetree/bindings/arm/arm,coresight-dummy-source.yaml
··· 29 29 maintainers: 30 30 - Mike Leach <mike.leach@linaro.org> 31 31 - Suzuki K Poulose <suzuki.poulose@arm.com> 32 - - James Clark <james.clark@arm.com> 32 + - James Clark <james.clark@linaro.org> 33 33 - Mao Jinlong <quic_jinlmao@quicinc.com> 34 34 - Hao Zhang <quic_hazha@quicinc.com> 35 35
+2 -2
MAINTAINERS
··· 2196 2196 ARM/CORESIGHT FRAMEWORK AND DRIVERS 2197 2197 M: Suzuki K Poulose <suzuki.poulose@arm.com> 2198 2198 R: Mike Leach <mike.leach@linaro.org> 2199 - R: James Clark <james.clark@arm.com> 2199 + R: James Clark <james.clark@linaro.org> 2200 2200 L: coresight@lists.linaro.org (moderated for non-subscribers) 2201 2201 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2202 2202 S: Maintained ··· 17894 17894 PERFORMANCE EVENTS TOOLING ARM64 17895 17895 R: John Garry <john.g.garry@oracle.com> 17896 17896 R: Will Deacon <will@kernel.org> 17897 - R: James Clark <james.clark@arm.com> 17897 + R: James Clark <james.clark@linaro.org> 17898 17898 R: Mike Leach <mike.leach@linaro.org> 17899 17899 R: Leo Yan <leo.yan@linux.dev> 17900 17900 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+20 -5
fs/nilfs2/btnode.c
··· 51 51 52 52 bh = nilfs_grab_buffer(inode, btnc, blocknr, BIT(BH_NILFS_Node)); 53 53 if (unlikely(!bh)) 54 - return NULL; 54 + return ERR_PTR(-ENOMEM); 55 55 56 56 if (unlikely(buffer_mapped(bh) || buffer_uptodate(bh) || 57 57 buffer_dirty(bh))) { 58 - brelse(bh); 59 - BUG(); 58 + /* 59 + * The block buffer at the specified new address was already 60 + * in use. This can happen if it is a virtual block number 61 + * and has been reallocated due to corruption of the bitmap 62 + * used to manage its allocation state (if not, the buffer 63 + * clearing of an abandoned b-tree node is missing somewhere). 64 + */ 65 + nilfs_error(inode->i_sb, 66 + "state inconsistency probably due to duplicate use of b-tree node block address %llu (ino=%lu)", 67 + (unsigned long long)blocknr, inode->i_ino); 68 + goto failed; 60 69 } 61 70 memset(bh->b_data, 0, i_blocksize(inode)); 62 71 bh->b_bdev = inode->i_sb->s_bdev; ··· 76 67 folio_unlock(bh->b_folio); 77 68 folio_put(bh->b_folio); 78 69 return bh; 70 + 71 + failed: 72 + folio_unlock(bh->b_folio); 73 + folio_put(bh->b_folio); 74 + brelse(bh); 75 + return ERR_PTR(-EIO); 79 76 } 80 77 81 78 int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr, ··· 232 217 } 233 218 234 219 nbh = nilfs_btnode_create_block(btnc, newkey); 235 - if (!nbh) 236 - return -ENOMEM; 220 + if (IS_ERR(nbh)) 221 + return PTR_ERR(nbh); 237 222 238 223 BUG_ON(nbh == obh); 239 224 ctxt->newbh = nbh;
+2 -2
fs/nilfs2/btree.c
··· 63 63 struct buffer_head *bh; 64 64 65 65 bh = nilfs_btnode_create_block(btnc, ptr); 66 - if (!bh) 67 - return -ENOMEM; 66 + if (IS_ERR(bh)) 67 + return PTR_ERR(bh); 68 68 69 69 set_buffer_nilfs_volatile(bh); 70 70 *bhp = bh;
+9 -3
include/linux/huge_mm.h
··· 74 74 #define THP_ORDERS_ALL_ANON ((BIT(PMD_ORDER + 1) - 1) & ~(BIT(0) | BIT(1))) 75 75 76 76 /* 77 - * Mask of all large folio orders supported for file THP. 77 + * Mask of all large folio orders supported for file THP. Folios in a DAX 78 + * file is never split and the MAX_PAGECACHE_ORDER limit does not apply to 79 + * it. 78 80 */ 79 - #define THP_ORDERS_ALL_FILE (BIT(PMD_ORDER) | BIT(PUD_ORDER)) 81 + #define THP_ORDERS_ALL_FILE_DAX \ 82 + (BIT(PMD_ORDER) | BIT(PUD_ORDER)) 83 + #define THP_ORDERS_ALL_FILE_DEFAULT \ 84 + ((BIT(MAX_PAGECACHE_ORDER + 1) - 1) & ~BIT(0)) 80 85 81 86 /* 82 87 * Mask of all large folio orders supported for THP. 83 88 */ 84 - #define THP_ORDERS_ALL (THP_ORDERS_ALL_ANON | THP_ORDERS_ALL_FILE) 89 + #define THP_ORDERS_ALL \ 90 + (THP_ORDERS_ALL_ANON | THP_ORDERS_ALL_FILE_DAX | THP_ORDERS_ALL_FILE_DEFAULT) 85 91 86 92 #define TVA_SMAPS (1 << 0) /* Will be used for procfs */ 87 93 #define TVA_IN_PF (1 << 1) /* Page fault handler */
+1
include/linux/memcontrol.h
··· 109 109 110 110 /* Fields which get updated often at the end. */ 111 111 struct lruvec lruvec; 112 + CACHELINE_PADDING(_pad2_); 112 113 unsigned long lru_zone_size[MAX_NR_ZONES][NR_LRU_LISTS]; 113 114 struct mem_cgroup_reclaim_iter iter; 114 115 };
+1 -15
include/linux/mm.h
··· 3137 3137 phys_addr_t end, int nid); 3138 3138 3139 3139 /* Free the reserved page into the buddy system, so it gets managed. */ 3140 - static inline void free_reserved_page(struct page *page) 3141 - { 3142 - if (mem_alloc_profiling_enabled()) { 3143 - union codetag_ref *ref = get_page_tag_ref(page); 3144 - 3145 - if (ref) { 3146 - set_codetag_empty(ref); 3147 - put_page_tag_ref(ref); 3148 - } 3149 - } 3150 - ClearPageReserved(page); 3151 - init_page_count(page); 3152 - __free_page(page); 3153 - adjust_managed_page_count(page, 1); 3154 - } 3140 + void free_reserved_page(struct page *page); 3155 3141 #define free_highmem_page(page) free_reserved_page(page) 3156 3142 3157 3143 static inline void mark_page_reserved(struct page *page)
+2 -1
lib/decompress_bunzip2.c
··· 232 232 RUNB) */ 233 233 symCount = symTotal+2; 234 234 for (j = 0; j < groupCount; j++) { 235 - unsigned char length[MAX_SYMBOLS], temp[MAX_HUFCODE_BITS+1]; 235 + unsigned char length[MAX_SYMBOLS]; 236 + unsigned short temp[MAX_HUFCODE_BITS+1]; 236 237 int minLen, maxLen, pp; 237 238 /* Read Huffman code lengths for each symbol. They're 238 239 stored in a way similar to mtf; record a starting
+11 -3
mm/huge_memory.c
··· 89 89 bool smaps = tva_flags & TVA_SMAPS; 90 90 bool in_pf = tva_flags & TVA_IN_PF; 91 91 bool enforce_sysfs = tva_flags & TVA_ENFORCE_SYSFS; 92 + unsigned long supported_orders; 93 + 92 94 /* Check the intersection of requested and supported orders. */ 93 - orders &= vma_is_anonymous(vma) ? 94 - THP_ORDERS_ALL_ANON : THP_ORDERS_ALL_FILE; 95 + if (vma_is_anonymous(vma)) 96 + supported_orders = THP_ORDERS_ALL_ANON; 97 + else if (vma_is_dax(vma)) 98 + supported_orders = THP_ORDERS_ALL_FILE_DAX; 99 + else 100 + supported_orders = THP_ORDERS_ALL_FILE_DEFAULT; 101 + 102 + orders &= supported_orders; 95 103 if (!orders) 96 104 return 0; 97 105 ··· 885 877 loff_t off_align = round_up(off, size); 886 878 unsigned long len_pad, ret, off_sub; 887 879 888 - if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall()) 880 + if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall()) 889 881 return 0; 890 882 891 883 if (off_end <= off_align || (off_end - off_align) < size)
+1 -1
mm/memory.c
··· 4780 4780 { 4781 4781 struct vm_area_struct *vma = vmf->vma; 4782 4782 bool write = vmf->flags & FAULT_FLAG_WRITE; 4783 - bool prefault = in_range(vmf->address, addr, nr * PAGE_SIZE); 4783 + bool prefault = !in_range(vmf->address, addr, nr * PAGE_SIZE); 4784 4784 pte_t entry; 4785 4785 4786 4786 flush_icache_pages(vma, page, nr);
+28 -7
mm/page_alloc.c
··· 2343 2343 static void drain_pages_zone(unsigned int cpu, struct zone *zone) 2344 2344 { 2345 2345 struct per_cpu_pages *pcp = per_cpu_ptr(zone->per_cpu_pageset, cpu); 2346 - int count = READ_ONCE(pcp->count); 2346 + int count; 2347 2347 2348 - while (count) { 2349 - int to_drain = min(count, pcp->batch << CONFIG_PCP_BATCH_SCALE_MAX); 2350 - count -= to_drain; 2351 - 2348 + do { 2352 2349 spin_lock(&pcp->lock); 2353 - free_pcppages_bulk(zone, to_drain, pcp, 0); 2350 + count = pcp->count; 2351 + if (count) { 2352 + int to_drain = min(count, 2353 + pcp->batch << CONFIG_PCP_BATCH_SCALE_MAX); 2354 + 2355 + free_pcppages_bulk(zone, to_drain, pcp, 0); 2356 + count -= to_drain; 2357 + } 2354 2358 spin_unlock(&pcp->lock); 2355 - } 2359 + } while (count); 2356 2360 } 2357 2361 2358 2362 /* ··· 5818 5814 5819 5815 return pages; 5820 5816 } 5817 + 5818 + void free_reserved_page(struct page *page) 5819 + { 5820 + if (mem_alloc_profiling_enabled()) { 5821 + union codetag_ref *ref = get_page_tag_ref(page); 5822 + 5823 + if (ref) { 5824 + set_codetag_empty(ref); 5825 + put_page_tag_ref(ref); 5826 + } 5827 + } 5828 + ClearPageReserved(page); 5829 + init_page_count(page); 5830 + __free_page(page); 5831 + adjust_managed_page_count(page, 1); 5832 + } 5833 + EXPORT_SYMBOL(free_reserved_page); 5821 5834 5822 5835 static int page_alloc_cpu_dead(unsigned int cpu) 5823 5836 {
+15 -1
tools/testing/selftests/mm/va_high_addr_switch.c
··· 293 293 return ret; 294 294 } 295 295 296 + #ifdef __aarch64__ 297 + /* Check if userspace VA > 48 bits */ 298 + static int high_address_present(void) 299 + { 300 + void *ptr = mmap((void *)(1UL << 50), 1, PROT_READ | PROT_WRITE, 301 + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); 302 + if (ptr == MAP_FAILED) 303 + return 0; 304 + 305 + munmap(ptr, 1); 306 + return 1; 307 + } 308 + #endif 309 + 296 310 static int supported_arch(void) 297 311 { 298 312 #if defined(__powerpc64__) ··· 314 300 #elif defined(__x86_64__) 315 301 return 1; 316 302 #elif defined(__aarch64__) 317 - return 1; 303 + return high_address_present(); 318 304 #else 319 305 return 0; 320 306 #endif