lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 30 Jun 2013 23:49:15 +0200
From:	Sedat Dilek <sedat.dilek@...il.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Tejun Heo <tj@...nel.org>,
	Daniel Vetter <daniel.vetter@...ll.ch>,
	Imre Deak <imre.deak@...el.com>,
	Lukas Czerner <lczerner@...hat.com>,
	Samuel Ortiz <samuel@...tiz.org>,
	Wensong Zhang <wensong@...ux-vs.org>,
	Simon Horman <horms@...ge.net.au>,
	Julian Anastasov <ja@....bg>,
	Ralf Baechle <ralf@...ux-mips.org>, Valdis.Kletnieks@...edu
Subject: Re: linux-next: Tree for Jun 28 [ BISECTED: rsyslog/imklog: High CPU
 usage ]

On Sun, Jun 30, 2013 at 8:19 PM, Oleg Nesterov <oleg@...hat.com> wrote:
> Andrew, please drop these
>
>         wait-introduce-wait_event_commonwq-condition-state-timeout.patch
>         wait-introduce-prepare_to_wait_event.patch
>
> patches again. I'll send v3 although it really looks like I should
> never try to touch wait.h.
>
> On 06/29, Sedat Dilek wrote:
>>
>> As this all did not show me what caused the problem I started a
>> git-bisect session.
>>
>> This revealed the following culprit commit:
>>
>>      commit bb1f30cb7d3ba21098f0ee7e0382160ba2599a43
>>      "wait: introduce wait_event_common(wq, condition, state, timeout)"
>
> Heh. First of all, I am really sorry.
>
> Not only "__wait_no_timeout(tout) ?:" was wrong, I didn't bother
> to recheck this logic even after I got the "warning: the omitted
> middle operand in ?:" reports.
>
> Sedat, thanks you very much! Any chance you can try the patch below?
>

Thanks for the quick fix!

No worries. Good we catched the issue, now.

Yupp, the patch fixes the issue here.

Please, send a patch against reported tree (here: next-20130628) next time.
( Attached is the one which applied here. )

I have zero clue about that "tout-tout" and "?" but you should keep
coding-style within your patch?
...
+                       __ret = __wait_no_timeout(tout) ? 0 :           \
+                                                       (__tout ?: 1);
 \ <--- ((__tout) ?: 1) like below ((tout) ?: 1)
...
+               __ret = __wait_no_timeout(tout) ? 0 : ((tout) ?: 1);    \

Feel free to give credits :-).

- Sedat -

> Oleg.
>
>
> --- a/include/linux/wait.h
> +++ b/include/linux/wait.h
> @@ -191,12 +191,8 @@ wait_queue_head_t *bit_waitqueue(void *, int);
>         for (;;) {                                                      \
>                 __ret = prepare_to_wait_event(&wq, &__wait, state);     \
>                 if (condition) {                                        \
> -                       __ret = __wait_no_timeout(tout);                \
> -                       if (!__ret) {                                   \
> -                               __ret = __tout;                         \
> -                               if (!__ret)                             \
> -                                       __ret = 1;                      \
> -                       }                                               \
> +                       __ret = __wait_no_timeout(tout) ? 0 :           \
> +                                                       (__tout ?: 1);  \
>                         break;                                          \
>                 }                                                       \
>                                                                         \
> @@ -217,16 +213,10 @@ wait_queue_head_t *bit_waitqueue(void *, int);
>  #define wait_event_common(wq, condition, state, tout)                  \
>  ({                                                                     \
>         long __ret;                                                     \
> -       if (condition) {                                                \
> -               __ret = __wait_no_timeout(tout);                        \
> -               if (!__ret) {                                           \
> -                       __ret = tout;                                   \
> -                       if (!__ret)                                     \
> -                               __ret = 1;                              \
> -               }                                                       \
> -       } else {                                                        \
> +       if (condition)                                                  \
> +               __ret = __wait_no_timeout(tout) ? 0 : ((tout) ?: 1);    \
> +       else                                                            \
>                 __ret = __wait_event_common(wq, condition, state, tout);\
> -       }                                                               \
>         __ret;                                                          \
>  })
>
>

Download attachment "3.10.0-rc7-next20130628-10-iniza-small.patch" of type "application/octet-stream" (7236 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ