The patch titled Subject: mm-compaction-fix-an-undefined-behaviour-fix has been added to the -mm tree. Its filename is mm-compaction-fix-an-undefined-behaviour-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-compaction-fix-an-undefined-behaviour-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-compaction-fix-an-undefined-behaviour-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/process/submit-checklist.rst 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: mm-compaction-fix-an-undefined-behaviour-fix code cleanup Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Qian Cai <cai@xxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/mm/compaction.c~mm-compaction-fix-an-undefined-behaviour-fix +++ a/mm/compaction.c @@ -1157,9 +1157,9 @@ static bool suitable_migration_target(st static inline unsigned int freelist_scan_limit(struct compact_control *cc) { - return (COMPACT_CLUSTER_MAX >> - min((unsigned short)(BITS_PER_LONG - 1), cc->fast_search_fail)) - + 1; + unsigned short shift = BITS_PER_LONG - 1; + + return (COMPACT_CLUSTER_MAX >> min(shift, cc->fast_search_fail)) + 1; } /* _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are kmemleak-skip-scanning-holes-in-the-bss-section-fix.patch ocfs2-clear-zero-in-unaligned-direct-io-checkpatch-fixes.patch mm.patch userfaultfd-sysctl-add-vmunprivileged_userfaultfd-fix.patch mm-compaction-fix-an-undefined-behaviour-fix.patch psi-introduce-psi-monitor-fix.patch psi-introduce-psi-monitor-fix-fix.patch psi-introduce-psi-monitor-fix-3.patch mm-add-probe_user_read-fix.patch mm-maintain-randomization-of-page-free-lists-checkpatch-fixes.patch fs-binfmt_elfc-remove-unneeded-initialization-of-mm-start_stack.patch linux-next-rejects.patch scripts-atomic-check-atomicssh-dont-assume-that-scripts-are-executable.patch kernel-forkc-export-kernel_thread-to-modules.patch slab-leaks3-default-y.patch