The patch titled Subject: swap-choose-swap-device-according-to-numa-node-v2-fix has been added to the -mm tree. Its filename is swap-choose-swap-device-according-to-numa-node-v2-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/swap-choose-swap-device-according-to-numa-node-v2-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/swap-choose-swap-device-according-to-numa-node-v2-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Subject: swap-choose-swap-device-according-to-numa-node-v2-fix use kmalloc_array() Cc: "Chen, Tim C" <tim.c.chen@xxxxxxxxx> Cc: Aaron Lu <aaron.lu@xxxxxxxxx> Cc: Andi Kleen <andi@xxxxxxxxxxxxxx> Cc: Huang Ying <ying.huang@xxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/swapfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN mm/swapfile.c~swap-choose-swap-device-according-to-numa-node-v2-fix mm/swapfile.c --- a/mm/swapfile.c~swap-choose-swap-device-according-to-numa-node-v2-fix +++ a/mm/swapfile.c @@ -3700,7 +3700,8 @@ static int __init swapfile_init(void) { int nid; - swap_avail_heads = kmalloc(nr_node_ids * sizeof(struct plist_head), GFP_KERNEL); + swap_avail_heads = kmalloc_array(nr_node_ids, sizeof(struct plist_head), + GFP_KERNEL); if (!swap_avail_heads) { pr_emerg("Not enough memory for swap heads, swap is disabled\n"); return -ENOMEM; _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are i-need-old-gcc.patch arm-arch-arm-include-asm-pageh-needs-personalityh.patch ocfs2-old-mle-put-and-release-after-the-function-dlm_add_migration_mle-called-fix.patch ocfs2-dlm-optimization-of-code-while-free-dead-node-locks-checkpatch-fixes.patch mm.patch mm-memory_hotplug-just-build-zonelist-for-new-added-node-fix.patch mm-memory_hotplug-just-build-zonelist-for-new-added-node-fix-fix.patch mm-thp-enable-thp-migration-in-generic-path-fix-fix.patch zsmalloc-zs_page_migrate-skip-unnecessary-loops-but-not-return-ebusy-if-zspage-is-not-inuse-fix.patch userfaultfd-selftest-exercise-uffdio_copy-zeropage-eexist-fix.patch mm-swap-add-swap-readahead-hit-statistics-fix.patch swap-choose-swap-device-according-to-numa-node-v2-fix.patch add-testcases-for-memset16-32-64-fix.patch lib-add-test-for-bitmap_parselist-fix.patch bitmap-introduce-bitmap_from_u64-checkpatch-fixes.patch bitmap-introduce-bitmap_from_u64-checkpatch-fixes-fix.patch kernel-reboot-add-devm_register_reboot_notifier-fix.patch linux-next-rejects.patch treewide-remove-gfp_temporary-allocation-flag-fix.patch treewide-remove-gfp_temporary-allocation-flag-checkpatch-fixes.patch kernel-forkc-export-kernel_thread-to-modules.patch slab-leaks3-default-y.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html