summaryrefslogtreecommitdiffstats
path: root/mm/compaction.c
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2014-05-06 21:50:01 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-05-06 22:04:58 +0200
commitd5c9fde3dae750889168807038243ff36431d276 (patch)
tree8b57ac0da7278daae45c9b7ac87a6bec7a554983 /mm/compaction.c
parenthugetlb: ensure hugepage access is denied if hugepages are not supported (diff)
downloadlinux-d5c9fde3dae750889168807038243ff36431d276.tar.xz
linux-d5c9fde3dae750889168807038243ff36431d276.zip
mm/page-writeback.c: fix divide by zero in pos_ratio_polynom
It is possible for "limit - setpoint + 1" to equal zero, after getting truncated to a 32 bit variable, and resulting in a divide by zero error. Using the fully 64 bit divide functions avoids this problem. It also will cause pos_ratio_polynom() to return the correct value when (setpoint - limit) exceeds 2^32. Also uninline pos_ratio_polynom, at Andrew's request. Signed-off-by: Rik van Riel <riel@redhat.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com> Cc: Luiz Capitulino <lcapitulino@redhat.com> Cc: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
0 files changed, 0 insertions, 0 deletions