> Actually, spinlock_t is not suitable. Because spin_unlcok() does NOT imply
> mb(). The subsequent wait_event_timeout()->atomic_read() may leak into the
> critical section.
>
> We can use set_mb(), if we don't want to play with smp_mb() by hand :)
spin_unlock implies a smp_wmb() but yeah, not
On 07/03, Benjamin Herrenschmidt wrote:
>
> On Tue, 2007-06-26 at 00:27 +0200, Rafael J. Wysocki wrote:
> > > > case PM_HIBERNATION_PREPARE:
> > > > case PM_SUSPEND_PREPARE:
> > > > usermodehelper_disabled = 1;
> > > > - return NOTIFY_OK;
> > > > + smp_mb();
On Tuesday, 3 July 2007 15:19, Rafael J. Wysocki wrote:
> On Tuesday, 3 July 2007 07:30, Benjamin Herrenschmidt wrote:
> > On Tue, 2007-06-26 at 00:27 +0200, Rafael J. Wysocki wrote:
> > > > > case PM_HIBERNATION_PREPARE:
> > > > > case PM_SUSPEND_PREPARE:
> > > > >
On Tuesday, 3 July 2007 07:30, Benjamin Herrenschmidt wrote:
> On Tue, 2007-06-26 at 00:27 +0200, Rafael J. Wysocki wrote:
> > > > case PM_HIBERNATION_PREPARE:
> > > > case PM_SUSPEND_PREPARE:
> > > > usermodehelper_disabled = 1;
> > > > - return NOTIFY_OK;
> > > > +
On Tuesday, 3 July 2007 07:30, Benjamin Herrenschmidt wrote:
On Tue, 2007-06-26 at 00:27 +0200, Rafael J. Wysocki wrote:
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
usermodehelper_disabled = 1;
- return NOTIFY_OK;
+ smp_mb();
On Tuesday, 3 July 2007 15:19, Rafael J. Wysocki wrote:
On Tuesday, 3 July 2007 07:30, Benjamin Herrenschmidt wrote:
On Tue, 2007-06-26 at 00:27 +0200, Rafael J. Wysocki wrote:
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
usermodehelper_disabled = 1;
On 07/03, Benjamin Herrenschmidt wrote:
On Tue, 2007-06-26 at 00:27 +0200, Rafael J. Wysocki wrote:
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
usermodehelper_disabled = 1;
- return NOTIFY_OK;
+ smp_mb();
Actually, spinlock_t is not suitable. Because spin_unlcok() does NOT imply
mb(). The subsequent wait_event_timeout()-atomic_read() may leak into the
critical section.
We can use set_mb(), if we don't want to play with smp_mb() by hand :)
spin_unlock implies a smp_wmb() but yeah, not a full
On Tue, 2007-06-26 at 10:48 +0200, Pavel Machek wrote:
> > The problem, as far as I understand it, is that the instructions can
> get
> > reordered if there are no barriers in there.
>
> Are you sure? I thought atomic variables have barrirers built-in.
bzzzt. they don't.
Ben.
-
To
On Tue, 2007-06-26 at 00:27 +0200, Rafael J. Wysocki wrote:
> > > case PM_HIBERNATION_PREPARE:
> > > case PM_SUSPEND_PREPARE:
> > > usermodehelper_disabled = 1;
> > > - return NOTIFY_OK;
> > > + smp_mb();
> >
> > usermodehelper_disabled should be atomic
On Tue, 2007-06-26 at 10:48 +0200, Pavel Machek wrote:
The problem, as far as I understand it, is that the instructions can
get
reordered if there are no barriers in there.
Are you sure? I thought atomic variables have barrirers built-in.
bzzzt. they don't.
Ben.
-
To unsubscribe from
On Tue, 2007-06-26 at 00:27 +0200, Rafael J. Wysocki wrote:
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
usermodehelper_disabled = 1;
- return NOTIFY_OK;
+ smp_mb();
usermodehelper_disabled should be atomic variable, too, so we
Hi!
> > > [I hope the ACKs still apply.]
> >
> > Uhuh, not 100% sure.
> >
> > > +static int usermodehelper_disabled;
> > > +
> >
> >
> > ...
> >
> > > case PM_HIBERNATION_PREPARE:
> > > case PM_SUSPEND_PREPARE:
> > > usermodehelper_disabled = 1;
> > > - return
On 06/26, Rafael J. Wysocki wrote:
>
> On Monday, 25 June 2007 23:55, Pavel Machek wrote:
> >
> > > case PM_HIBERNATION_PREPARE:
> > > case PM_SUSPEND_PREPARE:
> > > usermodehelper_disabled = 1;
> > > - return NOTIFY_OK;
> > > + smp_mb();
> >
> >
On Monday, 25. June 2007, Rafael J. Wysocki wrote:
> [I hope the ACKs still apply.]
>
Mine does
> +static void helper_lock(void)
> +{
> + atomic_inc(_helpers);
> + smp_mb__after_atomic_inc();
> +}
> +
> +static void helper_unlock(void)
> +{
> + if
On Monday, 25. June 2007, Rafael J. Wysocki wrote:
[I hope the ACKs still apply.]
Mine does
+static void helper_lock(void)
+{
+ atomic_inc(running_helpers);
+ smp_mb__after_atomic_inc();
+}
+
+static void helper_unlock(void)
+{
+ if
On 06/26, Rafael J. Wysocki wrote:
On Monday, 25 June 2007 23:55, Pavel Machek wrote:
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
usermodehelper_disabled = 1;
- return NOTIFY_OK;
+ smp_mb();
usermodehelper_disabled should be atomic
Hi!
[I hope the ACKs still apply.]
Uhuh, not 100% sure.
+static int usermodehelper_disabled;
+
...
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
usermodehelper_disabled = 1;
- return NOTIFY_OK;
+ smp_mb();
On Monday, 25 June 2007 23:55, Pavel Machek wrote:
> Hi!
>
> > [I hope the ACKs still apply.]
>
> Uhuh, not 100% sure.
>
> > +static int usermodehelper_disabled;
> > +
>
>
> ...
>
> > case PM_HIBERNATION_PREPARE:
> > case PM_SUSPEND_PREPARE:
> > usermodehelper_disabled =
Hi!
> [I hope the ACKs still apply.]
Uhuh, not 100% sure.
> +static int usermodehelper_disabled;
> +
...
> case PM_HIBERNATION_PREPARE:
> case PM_SUSPEND_PREPARE:
> usermodehelper_disabled = 1;
> - return NOTIFY_OK;
> + smp_mb();
On Tuesday 26 June 2007 07:52:23 Rafael J. Wysocki wrote:
> [I hope the ACKs still apply.]
Mine does :>
Nigel
pgp9gRcYEcqWK.pgp
Description: PGP signature
[I hope the ACKs still apply.]
---
From: Rafael J. Wysocki <[EMAIL PROTECTED]>
At present, if a user mode helper is running while usermodehelper_pm_callback()
is executed, the helper may be frozen and the completion in
call_usermodehelper_exec() won't be completed until user space processes are
[I hope the ACKs still apply.]
---
From: Rafael J. Wysocki [EMAIL PROTECTED]
At present, if a user mode helper is running while usermodehelper_pm_callback()
is executed, the helper may be frozen and the completion in
call_usermodehelper_exec() won't be completed until user space processes are
On Tuesday 26 June 2007 07:52:23 Rafael J. Wysocki wrote:
[I hope the ACKs still apply.]
Mine does :
Nigel
pgp9gRcYEcqWK.pgp
Description: PGP signature
Hi!
[I hope the ACKs still apply.]
Uhuh, not 100% sure.
+static int usermodehelper_disabled;
+
...
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
usermodehelper_disabled = 1;
- return NOTIFY_OK;
+ smp_mb();
On Monday, 25 June 2007 23:55, Pavel Machek wrote:
Hi!
[I hope the ACKs still apply.]
Uhuh, not 100% sure.
+static int usermodehelper_disabled;
+
...
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
usermodehelper_disabled = 1;
-
26 matches
Mail list logo