All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] pow.3: Add note on performance characteristics of pow
@ 2014-10-16 23:51 Manuel López-Ibáñez
       [not found] ` <CAESRpQDx5TfgfRp1q69NiuCB5ve8+fR1NC2up9h5LOkogMKkqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-16 23:51 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA
  Cc: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

Hello,

This patch documents
https://sourceware.org/bugzilla/show_bug.cgi?id=13932 as requested in
https://sourceware.org/bugzilla/show_bug.cgi?id=15267. It would be
nice to add more details, but it seems the behavior and its
consequences is not well understood. The purpose of the note is to
warn users of this behavior and thus avoid frustration
(http://entropymine.com/imageworsener/slowpow/).

This is my first patch. I followed (hopefully correctly) the instructions here:
https://www.kernel.org/doc/man-pages/patches.html

Cheers,

Manuel.

[-- Attachment #2: pow.diff --]
[-- Type: text/plain, Size: 562 bytes --]

diff --git a/man3/pow.3 b/man3/pow.3
index d0a2ea8..3d2151a 100644
--- a/man3/pow.3
+++ b/man3/pow.3
@@ -320,6 +320,17 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some inputs than for other nearby
+inputs. The inputs that produce such behavior are different for
+.BR powf (),
+.BR pow ()
+and
+.BR powl ().
+
 In glibc 2.9 and earlier,
 .\"
 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
       [not found] ` <CAESRpQDx5TfgfRp1q69NiuCB5ve8+fR1NC2up9h5LOkogMKkqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-10-17  5:24   ` Michael Kerrisk (man-pages)
       [not found]     ` <5440A816.8000002-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-10-17  5:24 UTC (permalink / raw)
  To: Manuel López-Ibáñez, linux-man-u79uwXL29TY76Z2rM5mHXA
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, GNU C Library

Hello Manuel,


On 10/17/2014 01:51 AM, Manuel López-Ibáñez wrote:
> Hello,
> 
> This patch documents
> https://sourceware.org/bugzilla/show_bug.cgi?id=13932 as requested in
> https://sourceware.org/bugzilla/show_bug.cgi?id=15267. It would be
> nice to add more details, but it seems the behavior and its
> consequences is not well understood. The purpose of the note is to
> warn users of this behavior and thus avoid frustration
> (http://entropymine.com/imageworsener/slowpow/).
> 
> This is my first patch. I followed (hopefully correctly) the instructions here:
> https://www.kernel.org/doc/man-pages/patches.html


Thanks for this patch. It looks good. But inline patches are easier to review.
One small question below.

> diff --git a/man3/pow.3 b/man3/pow.3
> index d0a2ea8..3d2151a 100644
> --- a/man3/pow.3
> +++ b/man3/pow.3
> @@ -320,6 +320,17 @@ The variant returning
>  also conforms to
>  SVr4, 4.3BSD, C89.
>  .SH BUGS
> +On 64-bits,
> +.\"
> +.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
> +.BR pow ()
> +may be more than 10,000 times slower for some inputs than for other nearby

I plan to change "some" to "some (rare)". Sound okay? The point is not to
worry people that this is a problem that is commonly encountered. (Or is it?)

Thanks,

Michael

> +inputs. The inputs that produce such behavior are different for
> +.BR powf (),
> +.BR pow ()
> +and
> +.BR powl ().
> +
>  In glibc 2.9 and earlier,
>  .\"
>  .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
       [not found]     ` <5440A816.8000002-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-10-17  7:58       ` Siddhesh Poyarekar
       [not found]         ` <20141017075845.GL1552-EBXREzpM9Zo4v7BKUif6HKfLeoKvNuZc@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-17  7:58 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Manuel López-Ibáñez,
	linux-man-u79uwXL29TY76Z2rM5mHXA, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

On Fri, Oct 17, 2014 at 07:24:38AM +0200, Michael Kerrisk (man-pages) wrote:
> > diff --git a/man3/pow.3 b/man3/pow.3
> > index d0a2ea8..3d2151a 100644
> > --- a/man3/pow.3
> > +++ b/man3/pow.3
> > @@ -320,6 +320,17 @@ The variant returning
> >  also conforms to
> >  SVr4, 4.3BSD, C89.
> >  .SH BUGS
> > +On 64-bits,
> > +.\"
> > +.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
> > +.BR pow ()
> > +may be more than 10,000 times slower for some inputs than for other nearby
> 
> I plan to change "some" to "some (rare)". Sound okay? The point is not to
> worry people that this is a problem that is commonly encountered. (Or is it?)

Rare is OK, these points don't occur very frequently.

> > +inputs. The inputs that produce such behavior are different for
> > +.BR powf (),
> > +.BR pow ()
> > +and
> > +.BR powl ().
> > +

The slow fallback is only taken for pow, not powf or powl.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
       [not found]         ` <20141017075845.GL1552-EBXREzpM9Zo4v7BKUif6HKfLeoKvNuZc@public.gmane.org>
@ 2014-10-17 13:51           ` Manuel López-Ibáñez
       [not found]             ` <CAESRpQB5K9U1sBreXUrNa4tPB69cwxC+fdu1bUr5BkU-dtxJMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2014-11-11 12:58             ` Michael Kerrisk (man-pages)
  0 siblings, 2 replies; 6+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-17 13:51 UTC (permalink / raw)
  To: Siddhesh Poyarekar
  Cc: Michael Kerrisk (man-pages),
	linux-man-u79uwXL29TY76Z2rM5mHXA, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

On 17 October 2014 09:58, Siddhesh Poyarekar <siddhesh-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> > +inputs. The inputs that produce such behavior are different for
>> > +.BR powf (),
>> > +.BR pow ()
>> > +and
>> > +.BR powl ().
>> > +
>
> The slow fallback is only taken for pow, not powf or powl.

Updated patch inline:

diff --git a/man3/pow.3 b/man3/pow.3
index d0a2ea8..1b05292 100644
--- a/man3/pow.3
+++ b/man3/pow.3
@@ -320,6 +320,18 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some (rare) inputs than for
other nearby
+inputs.  This only affects
+.BR pow (),
+and not
+.BR powf ()
+nor
+.BR powl ().
+
 In glibc 2.9 and earlier,
 .\"
 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776

and attached in case gmail messes it up.

Cheers,

Manuel.

[-- Attachment #2: pow.diff --]
[-- Type: text/plain, Size: 543 bytes --]

diff --git a/man3/pow.3 b/man3/pow.3
index d0a2ea8..1b05292 100644
--- a/man3/pow.3
+++ b/man3/pow.3
@@ -320,6 +320,18 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some (rare) inputs than for other nearby
+inputs.  This only affects 
+.BR pow (),
+and not 
+.BR powf ()
+nor
+.BR powl ().
+
 In glibc 2.9 and earlier,
 .\"
 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
       [not found]             ` <CAESRpQB5K9U1sBreXUrNa4tPB69cwxC+fdu1bUr5BkU-dtxJMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-10-30 23:30               ` Manuel López-Ibáñez
  0 siblings, 0 replies; 6+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-30 23:30 UTC (permalink / raw)
  Cc: Michael Kerrisk (man-pages),
	linux-man-u79uwXL29TY76Z2rM5mHXA, GNU C Library

I think this hasn't been committed yet:

https://sourceware.org/ml/libc-alpha/2014-10/msg00389.html

Cheers,

Manuel.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
  2014-10-17 13:51           ` Manuel López-Ibáñez
       [not found]             ` <CAESRpQB5K9U1sBreXUrNa4tPB69cwxC+fdu1bUr5BkU-dtxJMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-11-11 12:58             ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-11-11 12:58 UTC (permalink / raw)
  To: Manuel López-Ibáñez, Siddhesh Poyarekar
  Cc: mtk.manpages, linux-man, GNU C Library

Hello Manuel,

On 10/17/2014 03:51 PM, Manuel López-Ibáñez wrote:
> On 17 October 2014 09:58, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
>>>> +inputs. The inputs that produce such behavior are different for
>>>> +.BR powf (),
>>>> +.BR pow ()
>>>> +and
>>>> +.BR powl ().
>>>> +
>>
>> The slow fallback is only taken for pow, not powf or powl.
> 
> Updated patch inline:
> 
> diff --git a/man3/pow.3 b/man3/pow.3
> index d0a2ea8..1b05292 100644
> --- a/man3/pow.3
> +++ b/man3/pow.3
> @@ -320,6 +320,18 @@ The variant returning
>  also conforms to
>  SVr4, 4.3BSD, C89.
>  .SH BUGS
> +On 64-bits,
> +.\"
> +.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
> +.BR pow ()
> +may be more than 10,000 times slower for some (rare) inputs than for
> other nearby
> +inputs.  This only affects
> +.BR pow (),
> +and not
> +.BR powf ()
> +nor
> +.BR powl ().
> +
>  In glibc 2.9 and earlier,
>  .\"
>  .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
> 
> and attached in case gmail messes it up.

Thanks for revising the patch. I've applied it.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-11 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-16 23:51 [patch] pow.3: Add note on performance characteristics of pow Manuel López-Ibáñez
     [not found] ` <CAESRpQDx5TfgfRp1q69NiuCB5ve8+fR1NC2up9h5LOkogMKkqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-17  5:24   ` Michael Kerrisk (man-pages)
     [not found]     ` <5440A816.8000002-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-17  7:58       ` Siddhesh Poyarekar
     [not found]         ` <20141017075845.GL1552-EBXREzpM9Zo4v7BKUif6HKfLeoKvNuZc@public.gmane.org>
2014-10-17 13:51           ` Manuel López-Ibáñez
     [not found]             ` <CAESRpQB5K9U1sBreXUrNa4tPB69cwxC+fdu1bUr5BkU-dtxJMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-30 23:30               ` Manuel López-Ibáñez
2014-11-11 12:58             ` Michael Kerrisk (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.