From: Hannes Frederic Sowa
> On Thu, Jan 16, 2014 at 10:37:37AM -0600, Christoph Lameter wrote:
> > On Thu, 16 Jan 2014, Daniel Borkmann wrote:
> >
> > > - * or else the performance is slower than a normal divide.
> > > - */
> > > -extern u32 reciprocal_value(u32 B);
> > > +struct reciprocal_value
From: Hannes Frederic Sowa
On Thu, Jan 16, 2014 at 10:37:37AM -0600, Christoph Lameter wrote:
On Thu, 16 Jan 2014, Daniel Borkmann wrote:
- * or else the performance is slower than a normal divide.
- */
-extern u32 reciprocal_value(u32 B);
+struct reciprocal_value {
+ u32 m;
On Thu, 2014-01-16 at 10:37 -0600, Christoph Lameter wrote:
> On Thu, 16 Jan 2014, Daniel Borkmann wrote:
>
> > - * or else the performance is slower than a normal divide.
> > - */
> > -extern u32 reciprocal_value(u32 B);
> > +struct reciprocal_value {
> > + u32 m;
> > + u8 sh1, sh2;
> > +};
On Thu, Jan 16, 2014 at 10:37:37AM -0600, Christoph Lameter wrote:
> On Thu, 16 Jan 2014, Daniel Borkmann wrote:
>
> > - * or else the performance is slower than a normal divide.
> > - */
> > -extern u32 reciprocal_value(u32 B);
> > +struct reciprocal_value {
> > + u32 m;
> > + u8 sh1, sh2;
>
On Thu, 16 Jan 2014, Daniel Borkmann wrote:
> - * or else the performance is slower than a normal divide.
> - */
> -extern u32 reciprocal_value(u32 B);
> +struct reciprocal_value {
> + u32 m;
> + u8 sh1, sh2;
> +};
>
> +#define RECIPROCAL_VALUE_RESULT_TO_ZERO ((struct
Hi Eric!
On Wed, Jan 15, 2014 at 07:07:26PM -0800, Eric Dumazet wrote:
> On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote:
>
> > Also, reciprocal_value() and reciprocal_divide() always return 0
> > for divisions by 1. This is a bit worrisome as those functions
> > also get used in
Hi Eric!
On Wed, Jan 15, 2014 at 07:07:26PM -0800, Eric Dumazet wrote:
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote:
Also, reciprocal_value() and reciprocal_divide() always return 0
for divisions by 1. This is a bit worrisome as those functions
also get used in mm/slab.c and
On Thu, 16 Jan 2014, Daniel Borkmann wrote:
- * or else the performance is slower than a normal divide.
- */
-extern u32 reciprocal_value(u32 B);
+struct reciprocal_value {
+ u32 m;
+ u8 sh1, sh2;
+};
+#define RECIPROCAL_VALUE_RESULT_TO_ZERO ((struct reciprocal_value){.sh1 =
On Thu, Jan 16, 2014 at 10:37:37AM -0600, Christoph Lameter wrote:
On Thu, 16 Jan 2014, Daniel Borkmann wrote:
- * or else the performance is slower than a normal divide.
- */
-extern u32 reciprocal_value(u32 B);
+struct reciprocal_value {
+ u32 m;
+ u8 sh1, sh2;
+};
On Thu, 2014-01-16 at 10:37 -0600, Christoph Lameter wrote:
On Thu, 16 Jan 2014, Daniel Borkmann wrote:
- * or else the performance is slower than a normal divide.
- */
-extern u32 reciprocal_value(u32 B);
+struct reciprocal_value {
+ u32 m;
+ u8 sh1, sh2;
+};
+#define
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote:
> Also, reciprocal_value() and reciprocal_divide() always return 0
> for divisions by 1. This is a bit worrisome as those functions
> also get used in mm/slab.c and lib/flex_array.c, apparently for
> index calculation to access array
On Thu, Jan 16, 2014 at 12:17:50AM +, Ben Hutchings wrote:
> On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote:
> [...]
> > --- a/include/linux/reciprocal_div.h
> > +++ b/include/linux/reciprocal_div.h
> [...]
> > + * RECIPROCAL_VALUE_TO_ZERO can be used to express an element, which
> >
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote:
[...]
> --- a/include/linux/reciprocal_div.h
> +++ b/include/linux/reciprocal_div.h
[...]
> + * RECIPROCAL_VALUE_TO_ZERO can be used to express an element, which
> + * used as the argument to reciprocal_divide always yields zero.
> */
From: Hannes Frederic Sowa
Jakub Zawadzki noticed that some divisions by reciprocal_divide()
were not correct [1][2], which he could also show with BPF code
after divisions are transformed into reciprocal_value() for runtime
invariant which can be passed to reciprocal_divide() later on;
reverse
From: Hannes Frederic Sowa han...@stressinduktion.org
Jakub Zawadzki noticed that some divisions by reciprocal_divide()
were not correct [1][2], which he could also show with BPF code
after divisions are transformed into reciprocal_value() for runtime
invariant which can be passed to
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote:
[...]
--- a/include/linux/reciprocal_div.h
+++ b/include/linux/reciprocal_div.h
[...]
+ * RECIPROCAL_VALUE_TO_ZERO can be used to express an element, which
+ * used as the argument to reciprocal_divide always yields zero.
*/
[...]
On Thu, Jan 16, 2014 at 12:17:50AM +, Ben Hutchings wrote:
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote:
[...]
--- a/include/linux/reciprocal_div.h
+++ b/include/linux/reciprocal_div.h
[...]
+ * RECIPROCAL_VALUE_TO_ZERO can be used to express an element, which
+ * used
On Thu, 2014-01-16 at 00:23 +0100, Daniel Borkmann wrote:
Also, reciprocal_value() and reciprocal_divide() always return 0
for divisions by 1. This is a bit worrisome as those functions
also get used in mm/slab.c and lib/flex_array.c, apparently for
index calculation to access array slots.
18 matches
Mail list logo