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

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
fs/proc/proc_sysctl.c: Fix a NULL pointer dereference
mm/page_alloc.c: fix never set ALLOC_NOFRAGMENT flag
mm/page_alloc.c: avoid potential NULL pointer dereference
mm, page_alloc: always use a captured page regardless of compaction result
mm: do not boost watermarks to avoid fragmentation for the DISCONTIG memory model
lib/test_vmalloc.c: do not create cpumask_t variable on stack
lib/Kconfig.debug: fix build error without CONFIG_BLOCK
zram: pass down the bvec we need to read into in the work struct
mm/memory_hotplug.c: drop memory device reference after find_memory_block()

+39 -23
+8 -8
Documentation/sysctl/vm.txt
··· 866 866 increase the success rate of future high-order allocations such as SLUB 867 867 allocations, THP and hugetlbfs pages. 868 868 869 - To make it sensible with respect to the watermark_scale_factor parameter, 870 - the unit is in fractions of 10,000. The default value of 15,000 means 871 - that up to 150% of the high watermark will be reclaimed in the event of 872 - a pageblock being mixed due to fragmentation. The level of reclaim is 873 - determined by the number of fragmentation events that occurred in the 874 - recent past. If this value is smaller than a pageblock then a pageblocks 875 - worth of pages will be reclaimed (e.g. 2MB on 64-bit x86). A boost factor 876 - of 0 will disable the feature. 869 + To make it sensible with respect to the watermark_scale_factor 870 + parameter, the unit is in fractions of 10,000. The default value of 871 + 15,000 on !DISCONTIGMEM configurations means that up to 150% of the high 872 + watermark will be reclaimed in the event of a pageblock being mixed due 873 + to fragmentation. The level of reclaim is determined by the number of 874 + fragmentation events that occurred in the recent past. If this value is 875 + smaller than a pageblock then a pageblocks worth of pages will be reclaimed 876 + (e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature. 877 877 878 878 ============================================================= 879 879
+3 -2
drivers/block/zram/zram_drv.c
··· 774 774 struct zram *zram; 775 775 unsigned long entry; 776 776 struct bio *bio; 777 + struct bio_vec bvec; 777 778 }; 778 779 779 780 #if PAGE_SIZE != 4096 780 781 static void zram_sync_read(struct work_struct *work) 781 782 { 782 - struct bio_vec bvec; 783 783 struct zram_work *zw = container_of(work, struct zram_work, work); 784 784 struct zram *zram = zw->zram; 785 785 unsigned long entry = zw->entry; 786 786 struct bio *bio = zw->bio; 787 787 788 - read_from_bdev_async(zram, &bvec, entry, bio); 788 + read_from_bdev_async(zram, &zw->bvec, entry, bio); 789 789 } 790 790 791 791 /* ··· 798 798 { 799 799 struct zram_work work; 800 800 801 + work.bvec = *bvec; 801 802 work.zram = zram; 802 803 work.entry = entry; 803 804 work.bio = bio;
+4 -2
fs/proc/proc_sysctl.c
··· 1626 1626 if (--header->nreg) 1627 1627 return; 1628 1628 1629 - if (parent) 1629 + if (parent) { 1630 1630 put_links(header); 1631 - start_unregistering(header); 1631 + start_unregistering(header); 1632 + } 1633 + 1632 1634 if (!--header->count) 1633 1635 kfree_rcu(header, rcu); 1634 1636
+1
lib/Kconfig.debug
··· 1929 1929 depends on m 1930 1930 depends on BLOCK && (64BIT || LBDAF) # for XFS, BTRFS 1931 1931 depends on NETDEVICES && NET_CORE && INET # for TUN 1932 + depends on BLOCK 1932 1933 select TEST_LKM 1933 1934 select XFS_FS 1934 1935 select TUN
+3 -3
lib/test_vmalloc.c
··· 383 383 static int test_func(void *private) 384 384 { 385 385 struct test_driver *t = private; 386 - cpumask_t newmask = CPU_MASK_NONE; 387 386 int random_array[ARRAY_SIZE(test_case_array)]; 388 387 int index, i, j, ret; 389 388 ktime_t kt; 390 389 u64 delta; 391 390 392 - cpumask_set_cpu(t->cpu, &newmask); 393 - set_cpus_allowed_ptr(current, &newmask); 391 + ret = set_cpus_allowed_ptr(current, cpumask_of(t->cpu)); 392 + if (ret < 0) 393 + pr_err("Failed to set affinity to %d CPU\n", t->cpu); 394 394 395 395 for (i = 0; i < ARRAY_SIZE(test_case_array); i++) 396 396 random_array[i] = i;
+1
mm/memory_hotplug.c
··· 874 874 */ 875 875 mem = find_memory_block(__pfn_to_section(pfn)); 876 876 nid = mem->nid; 877 + put_device(&mem->dev); 877 878 878 879 /* associate pfn range with the zone */ 879 880 zone = move_pfn_range(online_type, nid, pfn, nr_pages);
+19 -8
mm/page_alloc.c
··· 266 266 267 267 int min_free_kbytes = 1024; 268 268 int user_min_free_kbytes = -1; 269 + #ifdef CONFIG_DISCONTIGMEM 270 + /* 271 + * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges 272 + * are not on separate NUMA nodes. Functionally this works but with 273 + * watermark_boost_factor, it can reclaim prematurely as the ranges can be 274 + * quite small. By default, do not boost watermarks on discontigmem as in 275 + * many cases very high-order allocations like THP are likely to be 276 + * unsupported and the premature reclaim offsets the advantage of long-term 277 + * fragmentation avoidance. 278 + */ 279 + int watermark_boost_factor __read_mostly; 280 + #else 269 281 int watermark_boost_factor __read_mostly = 15000; 282 + #endif 270 283 int watermark_scale_factor = 10; 271 284 272 285 static unsigned long nr_kernel_pages __initdata; ··· 3432 3419 alloc_flags |= ALLOC_KSWAPD; 3433 3420 3434 3421 #ifdef CONFIG_ZONE_DMA32 3422 + if (!zone) 3423 + return alloc_flags; 3424 + 3435 3425 if (zone_idx(zone) != ZONE_NORMAL) 3436 - goto out; 3426 + return alloc_flags; 3437 3427 3438 3428 /* 3439 3429 * If ZONE_DMA32 exists, assume it is the one after ZONE_NORMAL and ··· 3445 3429 */ 3446 3430 BUILD_BUG_ON(ZONE_NORMAL - ZONE_DMA32 != 1); 3447 3431 if (nr_online_nodes > 1 && !populated_zone(--zone)) 3448 - goto out; 3432 + return alloc_flags; 3449 3433 3450 - out: 3434 + alloc_flags |= ALLOC_NOFRAGMENT; 3451 3435 #endif /* CONFIG_ZONE_DMA32 */ 3452 3436 return alloc_flags; 3453 3437 } ··· 3788 3772 3789 3773 memalloc_noreclaim_restore(noreclaim_flag); 3790 3774 psi_memstall_leave(&pflags); 3791 - 3792 - if (*compact_result <= COMPACT_INACTIVE) { 3793 - WARN_ON_ONCE(page); 3794 - return NULL; 3795 - } 3796 3775 3797 3776 /* 3798 3777 * At least in one zone compaction wasn't deferred or skipped, so let's