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:
"17 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
MIPS: fix DMA contiguous allocation
sh64: fix __NR_fgetxattr
ocfs2: fix SGID not inherited issue
mm/oom_kill.c: avoid attempting to kill init sharing same memory
drivers/base/memory.c: prohibit offlining of memory blocks with missing sections
tmpfs: fix shmem_evict_inode() warnings on i_blocks
mm/hugetlb.c: fix resv map memory leak for placeholder entries
mm: hugetlb: call huge_pte_alloc() only if ptep is null
kernel: remove stop_machine() Kconfig dependency
mm: kmemleak: mark kmemleak_init prototype as __init
mm: fix kerneldoc on mem_cgroup_replace_page
osd fs: __r4w_get_page rely on PageUptodate for uptodate
MAINTAINERS: make Vladimir co-maintainer of the memory controller
mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress
mm: fix swapped Movable and Reclaimable in /proc/pagetypeinfo
memcg: fix memory.high target
mm: hugetlb: fix hugepage memory leak caused by wrong reserve count

+78 -63
+1
MAINTAINERS
··· 2975 2975 CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG) 2976 2976 M: Johannes Weiner <hannes@cmpxchg.org> 2977 2977 M: Michal Hocko <mhocko@kernel.org> 2978 + M: Vladimir Davydov <vdavydov@virtuozzo.com> 2978 2979 L: cgroups@vger.kernel.org 2979 2980 L: linux-mm@kvack.org 2980 2981 S: Maintained
+1 -1
arch/mips/mm/dma-default.c
··· 145 145 146 146 gfp = massage_gfp_flags(dev, gfp); 147 147 148 - if (IS_ENABLED(CONFIG_DMA_CMA) && !(gfp & GFP_ATOMIC)) 148 + if (IS_ENABLED(CONFIG_DMA_CMA) && gfpflags_allow_blocking(gfp)) 149 149 page = dma_alloc_from_contiguous(dev, 150 150 count, get_order(size)); 151 151 if (!page)
+1 -1
arch/sh/include/uapi/asm/unistd_64.h
··· 278 278 #define __NR_fsetxattr 256 279 279 #define __NR_getxattr 257 280 280 #define __NR_lgetxattr 258 281 - #define __NR_fgetxattr 269 281 + #define __NR_fgetxattr 259 282 282 #define __NR_listxattr 260 283 283 #define __NR_llistxattr 261 284 284 #define __NR_flistxattr 262
+4
drivers/base/memory.c
··· 303 303 if (mem->state == MEM_OFFLINE) 304 304 return 0; 305 305 306 + /* Can't offline block with non-present sections */ 307 + if (mem->section_count != sections_per_block) 308 + return -EINVAL; 309 + 306 310 return memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE); 307 311 } 308 312
+1 -4
fs/exofs/inode.c
··· 592 592 } 593 593 unlock_page(page); 594 594 } 595 - if (PageDirty(page) || PageWriteback(page)) 596 - *uptodate = true; 597 - else 598 - *uptodate = PageUptodate(page); 595 + *uptodate = PageUptodate(page); 599 596 EXOFS_DBGMSG2("index=0x%lx uptodate=%d\n", index, *uptodate); 600 597 return page; 601 598 } else {
+1 -4
fs/nfs/objlayout/objio_osd.c
··· 476 476 } 477 477 unlock_page(page); 478 478 } 479 - if (PageDirty(page) || PageWriteback(page)) 480 - *uptodate = true; 481 - else 482 - *uptodate = PageUptodate(page); 479 + *uptodate = PageUptodate(page); 483 480 dprintk("%s: index=0x%lx uptodate=%d\n", __func__, index, *uptodate); 484 481 return page; 485 482 }
+1 -3
fs/ocfs2/namei.c
··· 367 367 goto leave; 368 368 } 369 369 370 - status = posix_acl_create(dir, &mode, &default_acl, &acl); 370 + status = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl); 371 371 if (status) { 372 372 mlog_errno(status); 373 373 goto leave; 374 374 } 375 - /* update inode->i_mode after mask with "umask". */ 376 - inode->i_mode = mode; 377 375 378 376 handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb, 379 377 S_ISDIR(mode),
+1 -1
include/linux/kmemleak.h
··· 25 25 26 26 #ifdef CONFIG_DEBUG_KMEMLEAK 27 27 28 - extern void kmemleak_init(void) __ref; 28 + extern void kmemleak_init(void) __init; 29 29 extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, 30 30 gfp_t gfp) __ref; 31 31 extern void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size,
+3 -3
include/linux/stop_machine.h
··· 99 99 * grabbing every spinlock (and more). So the "read" side to such a 100 100 * lock is anything which disables preemption. 101 101 */ 102 - #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) 102 + #if defined(CONFIG_SMP) || defined(CONFIG_HOTPLUG_CPU) 103 103 104 104 /** 105 105 * stop_machine: freeze the machine on all CPUs and run this function ··· 118 118 119 119 int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, 120 120 const struct cpumask *cpus); 121 - #else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 121 + #else /* CONFIG_SMP || CONFIG_HOTPLUG_CPU */ 122 122 123 123 static inline int stop_machine(cpu_stop_fn_t fn, void *data, 124 124 const struct cpumask *cpus) ··· 137 137 return stop_machine(fn, data, cpus); 138 138 } 139 139 140 - #endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 140 + #endif /* CONFIG_SMP || CONFIG_HOTPLUG_CPU */ 141 141 #endif /* _LINUX_STOP_MACHINE */
-7
init/Kconfig
··· 2030 2030 it was better to provide this option than to break all the archs 2031 2031 and have several arch maintainers pursuing me down dark alleys. 2032 2032 2033 - config STOP_MACHINE 2034 - bool 2035 - default y 2036 - depends on (SMP && MODULE_UNLOAD) || HOTPLUG_CPU 2037 - help 2038 - Need stop_machine() primitive. 2039 - 2040 2033 source "block/Kconfig" 2041 2034 2042 2035 config PREEMPT_NOTIFIERS
+2 -2
kernel/stop_machine.c
··· 531 531 } 532 532 early_initcall(cpu_stop_init); 533 533 534 - #ifdef CONFIG_STOP_MACHINE 534 + #if defined(CONFIG_SMP) || defined(CONFIG_HOTPLUG_CPU) 535 535 536 536 static int __stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus) 537 537 { ··· 631 631 return ret ?: done.ret; 632 632 } 633 633 634 - #endif /* CONFIG_STOP_MACHINE */ 634 + #endif /* CONFIG_SMP || CONFIG_HOTPLUG_CPU */
+16 -3
mm/backing-dev.c
··· 957 957 * jiffies for either a BDI to exit congestion of the given @sync queue 958 958 * or a write to complete. 959 959 * 960 - * In the absence of zone congestion, cond_resched() is called to yield 961 - * the processor if necessary but otherwise does not sleep. 960 + * In the absence of zone congestion, a short sleep or a cond_resched is 961 + * performed to yield the processor and to allow other subsystems to make 962 + * a forward progress. 962 963 * 963 964 * The return value is 0 if the sleep is for the full timeout. Otherwise, 964 965 * it is the number of jiffies that were still remaining when the function ··· 979 978 */ 980 979 if (atomic_read(&nr_wb_congested[sync]) == 0 || 981 980 !test_bit(ZONE_CONGESTED, &zone->flags)) { 982 - cond_resched(); 981 + 982 + /* 983 + * Memory allocation/reclaim might be called from a WQ 984 + * context and the current implementation of the WQ 985 + * concurrency control doesn't recognize that a particular 986 + * WQ is congested if the worker thread is looping without 987 + * ever sleeping. Therefore we have to do a short sleep 988 + * here rather than calling cond_resched(). 989 + */ 990 + if (current->flags & PF_WQ_WORKER) 991 + schedule_timeout(1); 992 + else 993 + cond_resched(); 983 994 984 995 /* In case we scheduled, work out time remaining */ 985 996 ret = timeout - (jiffies - start);
+20 -7
mm/hugetlb.c
··· 372 372 spin_unlock(&resv->lock); 373 373 374 374 trg = kmalloc(sizeof(*trg), GFP_KERNEL); 375 - if (!trg) 375 + if (!trg) { 376 + kfree(nrg); 376 377 return -ENOMEM; 378 + } 377 379 378 380 spin_lock(&resv->lock); 379 381 list_add(&trg->link, &resv->region_cache); ··· 485 483 retry: 486 484 spin_lock(&resv->lock); 487 485 list_for_each_entry_safe(rg, trg, head, link) { 488 - if (rg->to <= f) 486 + /* 487 + * Skip regions before the range to be deleted. file_region 488 + * ranges are normally of the form [from, to). However, there 489 + * may be a "placeholder" entry in the map which is of the form 490 + * (from, to) with from == to. Check for placeholder entries 491 + * at the beginning of the range to be deleted. 492 + */ 493 + if (rg->to <= f && (rg->to != rg->from || rg->to != f)) 489 494 continue; 495 + 490 496 if (rg->from >= t) 491 497 break; 492 498 ··· 1896 1886 page = __alloc_buddy_huge_page_with_mpol(h, vma, addr); 1897 1887 if (!page) 1898 1888 goto out_uncharge_cgroup; 1899 - 1889 + if (!avoid_reserve && vma_has_reserves(vma, gbl_chg)) { 1890 + SetPagePrivate(page); 1891 + h->resv_huge_pages--; 1892 + } 1900 1893 spin_lock(&hugetlb_lock); 1901 1894 list_move(&page->lru, &h->hugepage_activelist); 1902 1895 /* Fall through */ ··· 3706 3693 } else if (unlikely(is_hugetlb_entry_hwpoisoned(entry))) 3707 3694 return VM_FAULT_HWPOISON_LARGE | 3708 3695 VM_FAULT_SET_HINDEX(hstate_index(h)); 3696 + } else { 3697 + ptep = huge_pte_alloc(mm, address, huge_page_size(h)); 3698 + if (!ptep) 3699 + return VM_FAULT_OOM; 3709 3700 } 3710 - 3711 - ptep = huge_pte_alloc(mm, address, huge_page_size(h)); 3712 - if (!ptep) 3713 - return VM_FAULT_OOM; 3714 3701 3715 3702 mapping = vma->vm_file->f_mapping; 3716 3703 idx = vma_hugecache_offset(h, vma, address);
+2 -2
mm/memcontrol.c
··· 2128 2128 */ 2129 2129 do { 2130 2130 if (page_counter_read(&memcg->memory) > memcg->high) { 2131 - current->memcg_nr_pages_over_high += nr_pages; 2131 + current->memcg_nr_pages_over_high += batch; 2132 2132 set_notify_resume(current); 2133 2133 break; 2134 2134 } ··· 5512 5512 * mem_cgroup_replace_page - migrate a charge to another page 5513 5513 * @oldpage: currently charged page 5514 5514 * @newpage: page to transfer the charge to 5515 - * @lrucare: either or both pages might be on the LRU already 5516 5515 * 5517 5516 * Migrate the charge from @oldpage to @newpage. 5518 5517 * 5519 5518 * Both pages must be locked, @newpage->mapping must be set up. 5519 + * Either or both pages might be on the LRU already. 5520 5520 */ 5521 5521 void mem_cgroup_replace_page(struct page *oldpage, struct page *newpage) 5522 5522 {
+2
mm/oom_kill.c
··· 608 608 continue; 609 609 if (unlikely(p->flags & PF_KTHREAD)) 610 610 continue; 611 + if (is_global_init(p)) 612 + continue; 611 613 if (p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) 612 614 continue; 613 615
+2 -1
mm/page_alloc.c
··· 3647 3647 { 3648 3648 static const char types[MIGRATE_TYPES] = { 3649 3649 [MIGRATE_UNMOVABLE] = 'U', 3650 - [MIGRATE_RECLAIMABLE] = 'E', 3651 3650 [MIGRATE_MOVABLE] = 'M', 3651 + [MIGRATE_RECLAIMABLE] = 'E', 3652 + [MIGRATE_HIGHATOMIC] = 'H', 3652 3653 #ifdef CONFIG_CMA 3653 3654 [MIGRATE_CMA] = 'C', 3654 3655 #endif
+15 -21
mm/shmem.c
··· 843 843 list_add_tail(&info->swaplist, &shmem_swaplist); 844 844 845 845 if (add_to_swap_cache(page, swap, GFP_ATOMIC) == 0) { 846 + spin_lock(&info->lock); 847 + shmem_recalc_inode(inode); 848 + info->swapped++; 849 + spin_unlock(&info->lock); 850 + 846 851 swap_shmem_alloc(swap); 847 852 shmem_delete_from_page_cache(page, swp_to_radix_entry(swap)); 848 - 849 - spin_lock(&info->lock); 850 - info->swapped++; 851 - shmem_recalc_inode(inode); 852 - spin_unlock(&info->lock); 853 853 854 854 mutex_unlock(&shmem_swaplist_mutex); 855 855 BUG_ON(page_mapped(page)); ··· 1078 1078 if (sgp != SGP_WRITE && sgp != SGP_FALLOC && 1079 1079 ((loff_t)index << PAGE_CACHE_SHIFT) >= i_size_read(inode)) { 1080 1080 error = -EINVAL; 1081 - goto failed; 1081 + goto unlock; 1082 1082 } 1083 1083 1084 1084 if (page && sgp == SGP_WRITE) ··· 1246 1246 /* Perhaps the file has been truncated since we checked */ 1247 1247 if (sgp != SGP_WRITE && sgp != SGP_FALLOC && 1248 1248 ((loff_t)index << PAGE_CACHE_SHIFT) >= i_size_read(inode)) { 1249 + if (alloced) { 1250 + ClearPageDirty(page); 1251 + delete_from_page_cache(page); 1252 + spin_lock(&info->lock); 1253 + shmem_recalc_inode(inode); 1254 + spin_unlock(&info->lock); 1255 + } 1249 1256 error = -EINVAL; 1250 - if (alloced) 1251 - goto trunc; 1252 - else 1253 - goto failed; 1257 + goto unlock; 1254 1258 } 1255 1259 *pagep = page; 1256 1260 return 0; ··· 1262 1258 /* 1263 1259 * Error recovery. 1264 1260 */ 1265 - trunc: 1266 - info = SHMEM_I(inode); 1267 - ClearPageDirty(page); 1268 - delete_from_page_cache(page); 1269 - spin_lock(&info->lock); 1270 - info->alloced--; 1271 - inode->i_blocks -= BLOCKS_PER_PAGE; 1272 - spin_unlock(&info->lock); 1273 1261 decused: 1274 - sbinfo = SHMEM_SB(inode->i_sb); 1275 1262 if (sbinfo->max_blocks) 1276 1263 percpu_counter_add(&sbinfo->used_blocks, -1); 1277 1264 unacct: 1278 1265 shmem_unacct_blocks(info->flags, 1); 1279 1266 failed: 1280 - if (swap.val && error != -EINVAL && 1281 - !shmem_confirm_swap(mapping, index, swap)) 1267 + if (swap.val && !shmem_confirm_swap(mapping, index, swap)) 1282 1268 error = -EEXIST; 1283 1269 unlock: 1284 1270 if (page) {
+5 -3
mm/vmstat.c
··· 921 921 #ifdef CONFIG_PROC_FS 922 922 static char * const migratetype_names[MIGRATE_TYPES] = { 923 923 "Unmovable", 924 - "Reclaimable", 925 924 "Movable", 925 + "Reclaimable", 926 926 "HighAtomic", 927 927 #ifdef CONFIG_CMA 928 928 "CMA", ··· 1379 1379 #endif /* CONFIG_PROC_FS */ 1380 1380 1381 1381 #ifdef CONFIG_SMP 1382 + static struct workqueue_struct *vmstat_wq; 1382 1383 static DEFINE_PER_CPU(struct delayed_work, vmstat_work); 1383 1384 int sysctl_stat_interval __read_mostly = HZ; 1384 1385 static cpumask_var_t cpu_stat_off; ··· 1392 1391 * to occur in the future. Keep on running the 1393 1392 * update worker thread. 1394 1393 */ 1395 - schedule_delayed_work_on(smp_processor_id(), 1394 + queue_delayed_work_on(smp_processor_id(), vmstat_wq, 1396 1395 this_cpu_ptr(&vmstat_work), 1397 1396 round_jiffies_relative(sysctl_stat_interval)); 1398 1397 } else { ··· 1461 1460 if (need_update(cpu) && 1462 1461 cpumask_test_and_clear_cpu(cpu, cpu_stat_off)) 1463 1462 1464 - schedule_delayed_work_on(cpu, 1463 + queue_delayed_work_on(cpu, vmstat_wq, 1465 1464 &per_cpu(vmstat_work, cpu), 0); 1466 1465 1467 1466 put_online_cpus(); ··· 1550 1549 1551 1550 start_shepherd_timer(); 1552 1551 cpu_notifier_register_done(); 1552 + vmstat_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); 1553 1553 #endif 1554 1554 #ifdef CONFIG_PROC_FS 1555 1555 proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);