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:	Tue, 18 Jun 2013 11:56:52 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Kirill Tkhai <tkhai@...dex.ru>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 2/2] sched,misc: Use schedule_(raw_)spin_unlock and
 schedule_(raw_)spin_unlock_irq

On Tue, 2013-06-18 at 19:36 +0400, Kirill Tkhai wrote:
> diff --git a/include/linux/wait.h b/include/linux/wait.h
> index f487a47..f0ab843 100644
> --- a/include/linux/wait.h
> +++ b/include/linux/wait.h
> @@ -474,10 +474,9 @@ do
> {                                                                       \
>                         break;                                          \
>                 }                                                       \
>                 if
> (irq)                                                \
> -                       spin_unlock_irq(&(wq).lock);                    \
> +                       schedule_spin_unlock_irq(&(wq).lock);           \
>                 else                                                    \
> -                       spin_unlock(&(wq).lock);                        \
> -               schedule();                                             \
> +                       schedule_spin_unlock(&(wq).lock);               \
>                 if
> (irq)                                                \
>                         spin_lock_irq(&(wq).lock);                      \
>                 else                                                 


In this part, I would clean it up as:

	if (irq) {
		schedule_spin_unlock_irq(&(wq).lock)
		spin_lock_irq(&(wq).lock);
	} else {
		schedule_spin_unlock(&(wq).lock);
		spin_lock(&(wq).lock);
	}

The old way just had a single call to schedule. The new way has two
different calls to schedule via the helper functions. No need to have
two if statements for that.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ