[folded-merged] mm-dont-miss-the-last-page-because-of-round-off-error-fix.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: math64: prevent double calculation of DIV64_U64_ROUND_UP() arguments
has been removed from the -mm tree.  Its filename was
     mm-dont-miss-the-last-page-because-of-round-off-error-fix.patch

This patch was dropped because it was folded into mm-dont-miss-the-last-page-because-of-round-off-error.patch

------------------------------------------------------
From: Roman Gushchin <guro@xxxxxx>
Subject: math64: prevent double calculation of DIV64_U64_ROUND_UP() arguments

Cause the DIV64_U64_ROUND_UP(ll, d) macro to cache the result of (d)
expression in a local variable to avoid double calculation, which might
bring unexpected side effects.

Link: http://lkml.kernel.org/r/20180829213311.GA13501@castle
Signed-off-by: Roman Gushchin <guro@xxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Rik van Riel <riel@xxxxxxxxxxx>
Cc: Konstantin Khlebnikov <koct9i@xxxxxxxxx>
Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---


--- a/include/linux/math64.h~mm-dont-miss-the-last-page-because-of-round-off-error-fix
+++ a/include/linux/math64.h
@@ -281,6 +281,7 @@ static inline u64 mul_u64_u32_div(u64 a,
 }
 #endif /* mul_u64_u32_div */
 
-#define DIV64_U64_ROUND_UP(ll, d)	div64_u64((ll) + (d) - 1, (d))
+#define DIV64_U64_ROUND_UP(ll, d)	\
+	({ u64 _tmp = (d); div64_u64((ll) + _tmp - 1, _tmp); })
 
 #endif /* _LINUX_MATH64_H */
_

Patches currently in -mm which might be from guro@xxxxxx are

mm-rework-memcg-kernel-stack-accounting.patch
mm-drain-memcg-stocks-on-css-offlining.patch
mm-dont-miss-the-last-page-because-of-round-off-error.patch
mm-dont-raise-memcg_oom-event-due-to-failed-high-order-allocation.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux