Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-10-01 Thread Rafael J. Wysocki
On Tuesday, October 01, 2013 06:38:03 PM Ronald wrote:
> This could be a coincidence, but I had a disk data corruption in /var
> (LVM). Most other partitions are read-only during normal operation. So
> I can safely keep testing this kernel. Just mentioning this, in case
> you see this happening with other ppl testing this patch as well.

If you have a failing resume from hibernation a filesystem is perfectly
possible, unfortunately.

The patch itself should't really cause any corruption to happen.

Thanks,
Rafael


> 2013/9/30 Rafael J. Wysocki :
> > On Monday, September 30, 2013 07:45:54 AM Ronald wrote:
> >> Yes, works as well. Just survived twe cycles with s2disk. I'm
> >> surprised someone else did not report this earlier btw... Because it
> >> looks pretty generic (i.e. not specific to a 64bit UP system).
> >
> > It is a generic bug, actually.  Well, this means the user space driven
> > hibernation doesn't receive much testing coverage these days ...
> >
> > I'll resend the patch with a proper changelog and then push it for 
> > v3.12-rc4.
> >
> > Thanks,
> > Rafael
> >
> >
> >> 2013/9/30 Rafael J. Wysocki :
> >> > On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
> >> >> Attached patch fixes the issue. Both methods function as they did
> >> >> before. Thanks for the superfast fix!
> >> >
> >> > You're welcome, it's not the final one, however.
> >> >
> >> > Can you please test the one below and report back?
> >> >
> >> > Rafael
> >> >
> >> >
> >> > ---
> >> >  kernel/power/snapshot.c |5 -
> >> >  kernel/power/user.c |8 
> >> >  2 files changed, 12 insertions(+), 1 deletion(-)
> >> >
> >> > Index: linux-pm/kernel/power/snapshot.c
> >> > ===
> >> > --- linux-pm.orig/kernel/power/snapshot.c
> >> > +++ linux-pm/kernel/power/snapshot.c
> >> > @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
> >> > struct memory_bitmap *bm1, *bm2;
> >> > int error = 0;
> >> >
> >> > -   BUG_ON(forbidden_pages_map || free_pages_map);
> >> > +   if (forbidden_pages_map && free_pages_map)
> >> > +   return 0;
> >> > +   else
> >> > +   BUG_ON(forbidden_pages_map || free_pages_map);
> >> >
> >> > bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
> >> > if (!bm1)
> >> > Index: linux-pm/kernel/power/user.c
> >> > ===
> >> > --- linux-pm.orig/kernel/power/user.c
> >> > +++ linux-pm/kernel/power/user.c
> >> > @@ -39,6 +39,7 @@ static struct snapshot_data {
> >> > char frozen;
> >> > char ready;
> >> > char platform_support;
> >> > +   bool free_bitmaps;
> >> >  } snapshot_state;
> >> >
> >> >  atomic_t snapshot_device_available = ATOMIC_INIT(1);
> >> > @@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
> >> > data->swap = -1;
> >> > data->mode = O_WRONLY;
> >> > error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
> >> > +   if (!error) {
> >> > +   error = create_basic_memory_bitmaps();
> >> > +   data->free_bitmaps = !error;
> >> > +   }
> >> > if (error)
> >> > pm_notifier_call_chain(PM_POST_RESTORE);
> >> > }
> >> > @@ -111,6 +116,8 @@ static int snapshot_release(struct inode
> >> > pm_restore_gfp_mask();
> >> > free_basic_memory_bitmaps();
> >> > thaw_processes();
> >> > +   } else if (data->free_bitmaps) {
> >> > +   free_basic_memory_bitmaps();
> >> > }
> >> > pm_notifier_call_chain(data->mode == O_RDONLY ?
> >> > PM_POST_HIBERNATION : PM_POST_RESTORE);
> >> > @@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
> >> > break;
> >> > pm_restore_gfp_mask();
> >> > free_basic_memory_bitmaps();
> >> > +   data->free_bitmaps = false;
> >> > thaw_processes();
> >> > data->frozen = 0;
> >> > break;
> >> >
> > --
> > I speak only for myself.
> > Rafael J. Wysocki, Intel Open Source Technology Center.
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-10-01 Thread Ronald
This could be a coincidence, but I had a disk data corruption in /var
(LVM). Most other partitions are read-only during normal operation. So
I can safely keep testing this kernel. Just mentioning this, in case
you see this happening with other ppl testing this patch as well.

2013/9/30 Rafael J. Wysocki :
> On Monday, September 30, 2013 07:45:54 AM Ronald wrote:
>> Yes, works as well. Just survived twe cycles with s2disk. I'm
>> surprised someone else did not report this earlier btw... Because it
>> looks pretty generic (i.e. not specific to a 64bit UP system).
>
> It is a generic bug, actually.  Well, this means the user space driven
> hibernation doesn't receive much testing coverage these days ...
>
> I'll resend the patch with a proper changelog and then push it for v3.12-rc4.
>
> Thanks,
> Rafael
>
>
>> 2013/9/30 Rafael J. Wysocki :
>> > On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
>> >> Attached patch fixes the issue. Both methods function as they did
>> >> before. Thanks for the superfast fix!
>> >
>> > You're welcome, it's not the final one, however.
>> >
>> > Can you please test the one below and report back?
>> >
>> > Rafael
>> >
>> >
>> > ---
>> >  kernel/power/snapshot.c |5 -
>> >  kernel/power/user.c |8 
>> >  2 files changed, 12 insertions(+), 1 deletion(-)
>> >
>> > Index: linux-pm/kernel/power/snapshot.c
>> > ===
>> > --- linux-pm.orig/kernel/power/snapshot.c
>> > +++ linux-pm/kernel/power/snapshot.c
>> > @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
>> > struct memory_bitmap *bm1, *bm2;
>> > int error = 0;
>> >
>> > -   BUG_ON(forbidden_pages_map || free_pages_map);
>> > +   if (forbidden_pages_map && free_pages_map)
>> > +   return 0;
>> > +   else
>> > +   BUG_ON(forbidden_pages_map || free_pages_map);
>> >
>> > bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
>> > if (!bm1)
>> > Index: linux-pm/kernel/power/user.c
>> > ===
>> > --- linux-pm.orig/kernel/power/user.c
>> > +++ linux-pm/kernel/power/user.c
>> > @@ -39,6 +39,7 @@ static struct snapshot_data {
>> > char frozen;
>> > char ready;
>> > char platform_support;
>> > +   bool free_bitmaps;
>> >  } snapshot_state;
>> >
>> >  atomic_t snapshot_device_available = ATOMIC_INIT(1);
>> > @@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
>> > data->swap = -1;
>> > data->mode = O_WRONLY;
>> > error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
>> > +   if (!error) {
>> > +   error = create_basic_memory_bitmaps();
>> > +   data->free_bitmaps = !error;
>> > +   }
>> > if (error)
>> > pm_notifier_call_chain(PM_POST_RESTORE);
>> > }
>> > @@ -111,6 +116,8 @@ static int snapshot_release(struct inode
>> > pm_restore_gfp_mask();
>> > free_basic_memory_bitmaps();
>> > thaw_processes();
>> > +   } else if (data->free_bitmaps) {
>> > +   free_basic_memory_bitmaps();
>> > }
>> > pm_notifier_call_chain(data->mode == O_RDONLY ?
>> > PM_POST_HIBERNATION : PM_POST_RESTORE);
>> > @@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
>> > break;
>> > pm_restore_gfp_mask();
>> > free_basic_memory_bitmaps();
>> > +   data->free_bitmaps = false;
>> > thaw_processes();
>> > data->frozen = 0;
>> > break;
>> >
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-10-01 Thread Ronald
This could be a coincidence, but I had a disk data corruption in /var
(LVM). Most other partitions are read-only during normal operation. So
I can safely keep testing this kernel. Just mentioning this, in case
you see this happening with other ppl testing this patch as well.

2013/9/30 Rafael J. Wysocki r...@rjwysocki.net:
 On Monday, September 30, 2013 07:45:54 AM Ronald wrote:
 Yes, works as well. Just survived twe cycles with s2disk. I'm
 surprised someone else did not report this earlier btw... Because it
 looks pretty generic (i.e. not specific to a 64bit UP system).

 It is a generic bug, actually.  Well, this means the user space driven
 hibernation doesn't receive much testing coverage these days ...

 I'll resend the patch with a proper changelog and then push it for v3.12-rc4.

 Thanks,
 Rafael


 2013/9/30 Rafael J. Wysocki r...@rjwysocki.net:
  On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
  Attached patch fixes the issue. Both methods function as they did
  before. Thanks for the superfast fix!
 
  You're welcome, it's not the final one, however.
 
  Can you please test the one below and report back?
 
  Rafael
 
 
  ---
   kernel/power/snapshot.c |5 -
   kernel/power/user.c |8 
   2 files changed, 12 insertions(+), 1 deletion(-)
 
  Index: linux-pm/kernel/power/snapshot.c
  ===
  --- linux-pm.orig/kernel/power/snapshot.c
  +++ linux-pm/kernel/power/snapshot.c
  @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
  struct memory_bitmap *bm1, *bm2;
  int error = 0;
 
  -   BUG_ON(forbidden_pages_map || free_pages_map);
  +   if (forbidden_pages_map  free_pages_map)
  +   return 0;
  +   else
  +   BUG_ON(forbidden_pages_map || free_pages_map);
 
  bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
  if (!bm1)
  Index: linux-pm/kernel/power/user.c
  ===
  --- linux-pm.orig/kernel/power/user.c
  +++ linux-pm/kernel/power/user.c
  @@ -39,6 +39,7 @@ static struct snapshot_data {
  char frozen;
  char ready;
  char platform_support;
  +   bool free_bitmaps;
   } snapshot_state;
 
   atomic_t snapshot_device_available = ATOMIC_INIT(1);
  @@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
  data-swap = -1;
  data-mode = O_WRONLY;
  error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
  +   if (!error) {
  +   error = create_basic_memory_bitmaps();
  +   data-free_bitmaps = !error;
  +   }
  if (error)
  pm_notifier_call_chain(PM_POST_RESTORE);
  }
  @@ -111,6 +116,8 @@ static int snapshot_release(struct inode
  pm_restore_gfp_mask();
  free_basic_memory_bitmaps();
  thaw_processes();
  +   } else if (data-free_bitmaps) {
  +   free_basic_memory_bitmaps();
  }
  pm_notifier_call_chain(data-mode == O_RDONLY ?
  PM_POST_HIBERNATION : PM_POST_RESTORE);
  @@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
  break;
  pm_restore_gfp_mask();
  free_basic_memory_bitmaps();
  +   data-free_bitmaps = false;
  thaw_processes();
  data-frozen = 0;
  break;
 
 --
 I speak only for myself.
 Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-10-01 Thread Rafael J. Wysocki
On Tuesday, October 01, 2013 06:38:03 PM Ronald wrote:
 This could be a coincidence, but I had a disk data corruption in /var
 (LVM). Most other partitions are read-only during normal operation. So
 I can safely keep testing this kernel. Just mentioning this, in case
 you see this happening with other ppl testing this patch as well.

If you have a failing resume from hibernation a filesystem is perfectly
possible, unfortunately.

The patch itself should't really cause any corruption to happen.

Thanks,
Rafael


 2013/9/30 Rafael J. Wysocki r...@rjwysocki.net:
  On Monday, September 30, 2013 07:45:54 AM Ronald wrote:
  Yes, works as well. Just survived twe cycles with s2disk. I'm
  surprised someone else did not report this earlier btw... Because it
  looks pretty generic (i.e. not specific to a 64bit UP system).
 
  It is a generic bug, actually.  Well, this means the user space driven
  hibernation doesn't receive much testing coverage these days ...
 
  I'll resend the patch with a proper changelog and then push it for 
  v3.12-rc4.
 
  Thanks,
  Rafael
 
 
  2013/9/30 Rafael J. Wysocki r...@rjwysocki.net:
   On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
   Attached patch fixes the issue. Both methods function as they did
   before. Thanks for the superfast fix!
  
   You're welcome, it's not the final one, however.
  
   Can you please test the one below and report back?
  
   Rafael
  
  
   ---
kernel/power/snapshot.c |5 -
kernel/power/user.c |8 
2 files changed, 12 insertions(+), 1 deletion(-)
  
   Index: linux-pm/kernel/power/snapshot.c
   ===
   --- linux-pm.orig/kernel/power/snapshot.c
   +++ linux-pm/kernel/power/snapshot.c
   @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
   struct memory_bitmap *bm1, *bm2;
   int error = 0;
  
   -   BUG_ON(forbidden_pages_map || free_pages_map);
   +   if (forbidden_pages_map  free_pages_map)
   +   return 0;
   +   else
   +   BUG_ON(forbidden_pages_map || free_pages_map);
  
   bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
   if (!bm1)
   Index: linux-pm/kernel/power/user.c
   ===
   --- linux-pm.orig/kernel/power/user.c
   +++ linux-pm/kernel/power/user.c
   @@ -39,6 +39,7 @@ static struct snapshot_data {
   char frozen;
   char ready;
   char platform_support;
   +   bool free_bitmaps;
} snapshot_state;
  
atomic_t snapshot_device_available = ATOMIC_INIT(1);
   @@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
   data-swap = -1;
   data-mode = O_WRONLY;
   error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
   +   if (!error) {
   +   error = create_basic_memory_bitmaps();
   +   data-free_bitmaps = !error;
   +   }
   if (error)
   pm_notifier_call_chain(PM_POST_RESTORE);
   }
   @@ -111,6 +116,8 @@ static int snapshot_release(struct inode
   pm_restore_gfp_mask();
   free_basic_memory_bitmaps();
   thaw_processes();
   +   } else if (data-free_bitmaps) {
   +   free_basic_memory_bitmaps();
   }
   pm_notifier_call_chain(data-mode == O_RDONLY ?
   PM_POST_HIBERNATION : PM_POST_RESTORE);
   @@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
   break;
   pm_restore_gfp_mask();
   free_basic_memory_bitmaps();
   +   data-free_bitmaps = false;
   thaw_processes();
   data-frozen = 0;
   break;
  
  --
  I speak only for myself.
  Rafael J. Wysocki, Intel Open Source Technology Center.
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-30 Thread Rafael J. Wysocki
On Monday, September 30, 2013 07:45:54 AM Ronald wrote:
> Yes, works as well. Just survived twe cycles with s2disk. I'm
> surprised someone else did not report this earlier btw... Because it
> looks pretty generic (i.e. not specific to a 64bit UP system).

It is a generic bug, actually.  Well, this means the user space driven
hibernation doesn't receive much testing coverage these days ...

I'll resend the patch with a proper changelog and then push it for v3.12-rc4.

Thanks,
Rafael


> 2013/9/30 Rafael J. Wysocki :
> > On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
> >> Attached patch fixes the issue. Both methods function as they did
> >> before. Thanks for the superfast fix!
> >
> > You're welcome, it's not the final one, however.
> >
> > Can you please test the one below and report back?
> >
> > Rafael
> >
> >
> > ---
> >  kernel/power/snapshot.c |5 -
> >  kernel/power/user.c |8 
> >  2 files changed, 12 insertions(+), 1 deletion(-)
> >
> > Index: linux-pm/kernel/power/snapshot.c
> > ===
> > --- linux-pm.orig/kernel/power/snapshot.c
> > +++ linux-pm/kernel/power/snapshot.c
> > @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
> > struct memory_bitmap *bm1, *bm2;
> > int error = 0;
> >
> > -   BUG_ON(forbidden_pages_map || free_pages_map);
> > +   if (forbidden_pages_map && free_pages_map)
> > +   return 0;
> > +   else
> > +   BUG_ON(forbidden_pages_map || free_pages_map);
> >
> > bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
> > if (!bm1)
> > Index: linux-pm/kernel/power/user.c
> > ===
> > --- linux-pm.orig/kernel/power/user.c
> > +++ linux-pm/kernel/power/user.c
> > @@ -39,6 +39,7 @@ static struct snapshot_data {
> > char frozen;
> > char ready;
> > char platform_support;
> > +   bool free_bitmaps;
> >  } snapshot_state;
> >
> >  atomic_t snapshot_device_available = ATOMIC_INIT(1);
> > @@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
> > data->swap = -1;
> > data->mode = O_WRONLY;
> > error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
> > +   if (!error) {
> > +   error = create_basic_memory_bitmaps();
> > +   data->free_bitmaps = !error;
> > +   }
> > if (error)
> > pm_notifier_call_chain(PM_POST_RESTORE);
> > }
> > @@ -111,6 +116,8 @@ static int snapshot_release(struct inode
> > pm_restore_gfp_mask();
> > free_basic_memory_bitmaps();
> > thaw_processes();
> > +   } else if (data->free_bitmaps) {
> > +   free_basic_memory_bitmaps();
> > }
> > pm_notifier_call_chain(data->mode == O_RDONLY ?
> > PM_POST_HIBERNATION : PM_POST_RESTORE);
> > @@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
> > break;
> > pm_restore_gfp_mask();
> > free_basic_memory_bitmaps();
> > +   data->free_bitmaps = false;
> > thaw_processes();
> > data->frozen = 0;
> > break;
> >
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-30 Thread Rafael J. Wysocki
On Monday, September 30, 2013 07:45:54 AM Ronald wrote:
 Yes, works as well. Just survived twe cycles with s2disk. I'm
 surprised someone else did not report this earlier btw... Because it
 looks pretty generic (i.e. not specific to a 64bit UP system).

It is a generic bug, actually.  Well, this means the user space driven
hibernation doesn't receive much testing coverage these days ...

I'll resend the patch with a proper changelog and then push it for v3.12-rc4.

Thanks,
Rafael


 2013/9/30 Rafael J. Wysocki r...@rjwysocki.net:
  On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
  Attached patch fixes the issue. Both methods function as they did
  before. Thanks for the superfast fix!
 
  You're welcome, it's not the final one, however.
 
  Can you please test the one below and report back?
 
  Rafael
 
 
  ---
   kernel/power/snapshot.c |5 -
   kernel/power/user.c |8 
   2 files changed, 12 insertions(+), 1 deletion(-)
 
  Index: linux-pm/kernel/power/snapshot.c
  ===
  --- linux-pm.orig/kernel/power/snapshot.c
  +++ linux-pm/kernel/power/snapshot.c
  @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
  struct memory_bitmap *bm1, *bm2;
  int error = 0;
 
  -   BUG_ON(forbidden_pages_map || free_pages_map);
  +   if (forbidden_pages_map  free_pages_map)
  +   return 0;
  +   else
  +   BUG_ON(forbidden_pages_map || free_pages_map);
 
  bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
  if (!bm1)
  Index: linux-pm/kernel/power/user.c
  ===
  --- linux-pm.orig/kernel/power/user.c
  +++ linux-pm/kernel/power/user.c
  @@ -39,6 +39,7 @@ static struct snapshot_data {
  char frozen;
  char ready;
  char platform_support;
  +   bool free_bitmaps;
   } snapshot_state;
 
   atomic_t snapshot_device_available = ATOMIC_INIT(1);
  @@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
  data-swap = -1;
  data-mode = O_WRONLY;
  error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
  +   if (!error) {
  +   error = create_basic_memory_bitmaps();
  +   data-free_bitmaps = !error;
  +   }
  if (error)
  pm_notifier_call_chain(PM_POST_RESTORE);
  }
  @@ -111,6 +116,8 @@ static int snapshot_release(struct inode
  pm_restore_gfp_mask();
  free_basic_memory_bitmaps();
  thaw_processes();
  +   } else if (data-free_bitmaps) {
  +   free_basic_memory_bitmaps();
  }
  pm_notifier_call_chain(data-mode == O_RDONLY ?
  PM_POST_HIBERNATION : PM_POST_RESTORE);
  @@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
  break;
  pm_restore_gfp_mask();
  free_basic_memory_bitmaps();
  +   data-free_bitmaps = false;
  thaw_processes();
  data-frozen = 0;
  break;
 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-29 Thread Ronald
Yes, works as well. Just survived twe cycles with s2disk. I'm
surprised someone else did not report this earlier btw... Because it
looks pretty generic (i.e. not specific to a 64bit UP system).

Thanks again!

2013/9/30 Rafael J. Wysocki :
> On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
>> Attached patch fixes the issue. Both methods function as they did
>> before. Thanks for the superfast fix!
>
> You're welcome, it's not the final one, however.
>
> Can you please test the one below and report back?
>
> Rafael
>
>
> ---
>  kernel/power/snapshot.c |5 -
>  kernel/power/user.c |8 
>  2 files changed, 12 insertions(+), 1 deletion(-)
>
> Index: linux-pm/kernel/power/snapshot.c
> ===
> --- linux-pm.orig/kernel/power/snapshot.c
> +++ linux-pm/kernel/power/snapshot.c
> @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
> struct memory_bitmap *bm1, *bm2;
> int error = 0;
>
> -   BUG_ON(forbidden_pages_map || free_pages_map);
> +   if (forbidden_pages_map && free_pages_map)
> +   return 0;
> +   else
> +   BUG_ON(forbidden_pages_map || free_pages_map);
>
> bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
> if (!bm1)
> Index: linux-pm/kernel/power/user.c
> ===
> --- linux-pm.orig/kernel/power/user.c
> +++ linux-pm/kernel/power/user.c
> @@ -39,6 +39,7 @@ static struct snapshot_data {
> char frozen;
> char ready;
> char platform_support;
> +   bool free_bitmaps;
>  } snapshot_state;
>
>  atomic_t snapshot_device_available = ATOMIC_INIT(1);
> @@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
> data->swap = -1;
> data->mode = O_WRONLY;
> error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
> +   if (!error) {
> +   error = create_basic_memory_bitmaps();
> +   data->free_bitmaps = !error;
> +   }
> if (error)
> pm_notifier_call_chain(PM_POST_RESTORE);
> }
> @@ -111,6 +116,8 @@ static int snapshot_release(struct inode
> pm_restore_gfp_mask();
> free_basic_memory_bitmaps();
> thaw_processes();
> +   } else if (data->free_bitmaps) {
> +   free_basic_memory_bitmaps();
> }
> pm_notifier_call_chain(data->mode == O_RDONLY ?
> PM_POST_HIBERNATION : PM_POST_RESTORE);
> @@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
> break;
> pm_restore_gfp_mask();
> free_basic_memory_bitmaps();
> +   data->free_bitmaps = false;
> thaw_processes();
> data->frozen = 0;
> break;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-29 Thread Rafael J. Wysocki
On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
> Attached patch fixes the issue. Both methods function as they did
> before. Thanks for the superfast fix!

You're welcome, it's not the final one, however.

Can you please test the one below and report back?

Rafael


---
 kernel/power/snapshot.c |5 -
 kernel/power/user.c |8 
 2 files changed, 12 insertions(+), 1 deletion(-)

Index: linux-pm/kernel/power/snapshot.c
===
--- linux-pm.orig/kernel/power/snapshot.c
+++ linux-pm/kernel/power/snapshot.c
@@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
struct memory_bitmap *bm1, *bm2;
int error = 0;
 
-   BUG_ON(forbidden_pages_map || free_pages_map);
+   if (forbidden_pages_map && free_pages_map)
+   return 0;
+   else
+   BUG_ON(forbidden_pages_map || free_pages_map);
 
bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
if (!bm1)
Index: linux-pm/kernel/power/user.c
===
--- linux-pm.orig/kernel/power/user.c
+++ linux-pm/kernel/power/user.c
@@ -39,6 +39,7 @@ static struct snapshot_data {
char frozen;
char ready;
char platform_support;
+   bool free_bitmaps;
 } snapshot_state;
 
 atomic_t snapshot_device_available = ATOMIC_INIT(1);
@@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
data->swap = -1;
data->mode = O_WRONLY;
error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
+   if (!error) {
+   error = create_basic_memory_bitmaps();
+   data->free_bitmaps = !error;
+   }
if (error)
pm_notifier_call_chain(PM_POST_RESTORE);
}
@@ -111,6 +116,8 @@ static int snapshot_release(struct inode
pm_restore_gfp_mask();
free_basic_memory_bitmaps();
thaw_processes();
+   } else if (data->free_bitmaps) {
+   free_basic_memory_bitmaps();
}
pm_notifier_call_chain(data->mode == O_RDONLY ?
PM_POST_HIBERNATION : PM_POST_RESTORE);
@@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
break;
pm_restore_gfp_mask();
free_basic_memory_bitmaps();
+   data->free_bitmaps = false;
thaw_processes();
data->frozen = 0;
break;

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


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-29 Thread Ronald
Attached patch fixes the issue. Both methods function as they did
before. Thanks for the superfast fix!

2013/9/29 Rafael J. Wysocki :
> On Saturday, September 28, 2013 08:18:18 PM Ronald wrote:
>> [ resend, forgot to disable HTML (sorry!) ]
>>
>> Dear kernel developers,
>>
>> Commit 8fd37a4c9 (PM / hibernate: Create memory bitmaps after freezing
>> user space) causes resume to fail.
>>
>> Only, when using the s2disk utility (through pm-hibernate).
>>
>> Not when I do:
>>
>> echo -n "disk" > /sys/power/state
>>
>> Reverting the commit did not work.
>>
>> I am using a encrypted LUKS partition with a temporary key that is
>> functioning as the swap device used for the suspend image.
>>
>> Awaiting further orders
>
> I'm traveling now, so I can't really test things, but I think I know what the
> problem is.
>
> Can you please check if the appended patch makes any difference for you?
>
> Rafael
>
>
> ---
>  kernel/power/snapshot.c |5 -
>  kernel/power/user.c |5 +
>  2 files changed, 9 insertions(+), 1 deletion(-)
>
> Index: linux-pm/kernel/power/snapshot.c
> ===
> --- linux-pm.orig/kernel/power/snapshot.c
> +++ linux-pm/kernel/power/snapshot.c
> @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
> struct memory_bitmap *bm1, *bm2;
> int error = 0;
>
> -   BUG_ON(forbidden_pages_map || free_pages_map);
> +   if (forbidden_pages_map && free_pages_map)
> +   return 0;
> +   else
> +   BUG_ON(forbidden_pages_map || free_pages_map);
>
> bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
> if (!bm1)
> Index: linux-pm/kernel/power/user.c
> ===
> --- linux-pm.orig/kernel/power/user.c
> +++ linux-pm/kernel/power/user.c
> @@ -82,6 +82,9 @@ static int snapshot_open(struct inode *i
> data->swap = -1;
> data->mode = O_WRONLY;
> error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
> +   if (!error)
> +   error = create_basic_memory_bitmaps();
> +
> if (error)
> pm_notifier_call_chain(PM_POST_RESTORE);
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-29 Thread Ronald
Attached patch fixes the issue. Both methods function as they did
before. Thanks for the superfast fix!

2013/9/29 Rafael J. Wysocki r...@rjwysocki.net:
 On Saturday, September 28, 2013 08:18:18 PM Ronald wrote:
 [ resend, forgot to disable HTML (sorry!) ]

 Dear kernel developers,

 Commit 8fd37a4c9 (PM / hibernate: Create memory bitmaps after freezing
 user space) causes resume to fail.

 Only, when using the s2disk utility (through pm-hibernate).

 Not when I do:

 echo -n disk  /sys/power/state

 Reverting the commit did not work.

 I am using a encrypted LUKS partition with a temporary key that is
 functioning as the swap device used for the suspend image.

 Awaiting further orders

 I'm traveling now, so I can't really test things, but I think I know what the
 problem is.

 Can you please check if the appended patch makes any difference for you?

 Rafael


 ---
  kernel/power/snapshot.c |5 -
  kernel/power/user.c |5 +
  2 files changed, 9 insertions(+), 1 deletion(-)

 Index: linux-pm/kernel/power/snapshot.c
 ===
 --- linux-pm.orig/kernel/power/snapshot.c
 +++ linux-pm/kernel/power/snapshot.c
 @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
 struct memory_bitmap *bm1, *bm2;
 int error = 0;

 -   BUG_ON(forbidden_pages_map || free_pages_map);
 +   if (forbidden_pages_map  free_pages_map)
 +   return 0;
 +   else
 +   BUG_ON(forbidden_pages_map || free_pages_map);

 bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
 if (!bm1)
 Index: linux-pm/kernel/power/user.c
 ===
 --- linux-pm.orig/kernel/power/user.c
 +++ linux-pm/kernel/power/user.c
 @@ -82,6 +82,9 @@ static int snapshot_open(struct inode *i
 data-swap = -1;
 data-mode = O_WRONLY;
 error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
 +   if (!error)
 +   error = create_basic_memory_bitmaps();
 +
 if (error)
 pm_notifier_call_chain(PM_POST_RESTORE);
 }

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


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-29 Thread Rafael J. Wysocki
On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
 Attached patch fixes the issue. Both methods function as they did
 before. Thanks for the superfast fix!

You're welcome, it's not the final one, however.

Can you please test the one below and report back?

Rafael


---
 kernel/power/snapshot.c |5 -
 kernel/power/user.c |8 
 2 files changed, 12 insertions(+), 1 deletion(-)

Index: linux-pm/kernel/power/snapshot.c
===
--- linux-pm.orig/kernel/power/snapshot.c
+++ linux-pm/kernel/power/snapshot.c
@@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
struct memory_bitmap *bm1, *bm2;
int error = 0;
 
-   BUG_ON(forbidden_pages_map || free_pages_map);
+   if (forbidden_pages_map  free_pages_map)
+   return 0;
+   else
+   BUG_ON(forbidden_pages_map || free_pages_map);
 
bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
if (!bm1)
Index: linux-pm/kernel/power/user.c
===
--- linux-pm.orig/kernel/power/user.c
+++ linux-pm/kernel/power/user.c
@@ -39,6 +39,7 @@ static struct snapshot_data {
char frozen;
char ready;
char platform_support;
+   bool free_bitmaps;
 } snapshot_state;
 
 atomic_t snapshot_device_available = ATOMIC_INIT(1);
@@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
data-swap = -1;
data-mode = O_WRONLY;
error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
+   if (!error) {
+   error = create_basic_memory_bitmaps();
+   data-free_bitmaps = !error;
+   }
if (error)
pm_notifier_call_chain(PM_POST_RESTORE);
}
@@ -111,6 +116,8 @@ static int snapshot_release(struct inode
pm_restore_gfp_mask();
free_basic_memory_bitmaps();
thaw_processes();
+   } else if (data-free_bitmaps) {
+   free_basic_memory_bitmaps();
}
pm_notifier_call_chain(data-mode == O_RDONLY ?
PM_POST_HIBERNATION : PM_POST_RESTORE);
@@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
break;
pm_restore_gfp_mask();
free_basic_memory_bitmaps();
+   data-free_bitmaps = false;
thaw_processes();
data-frozen = 0;
break;

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


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-29 Thread Ronald
Yes, works as well. Just survived twe cycles with s2disk. I'm
surprised someone else did not report this earlier btw... Because it
looks pretty generic (i.e. not specific to a 64bit UP system).

Thanks again!

2013/9/30 Rafael J. Wysocki r...@rjwysocki.net:
 On Sunday, September 29, 2013 09:22:45 AM Ronald wrote:
 Attached patch fixes the issue. Both methods function as they did
 before. Thanks for the superfast fix!

 You're welcome, it's not the final one, however.

 Can you please test the one below and report back?

 Rafael


 ---
  kernel/power/snapshot.c |5 -
  kernel/power/user.c |8 
  2 files changed, 12 insertions(+), 1 deletion(-)

 Index: linux-pm/kernel/power/snapshot.c
 ===
 --- linux-pm.orig/kernel/power/snapshot.c
 +++ linux-pm/kernel/power/snapshot.c
 @@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
 struct memory_bitmap *bm1, *bm2;
 int error = 0;

 -   BUG_ON(forbidden_pages_map || free_pages_map);
 +   if (forbidden_pages_map  free_pages_map)
 +   return 0;
 +   else
 +   BUG_ON(forbidden_pages_map || free_pages_map);

 bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
 if (!bm1)
 Index: linux-pm/kernel/power/user.c
 ===
 --- linux-pm.orig/kernel/power/user.c
 +++ linux-pm/kernel/power/user.c
 @@ -39,6 +39,7 @@ static struct snapshot_data {
 char frozen;
 char ready;
 char platform_support;
 +   bool free_bitmaps;
  } snapshot_state;

  atomic_t snapshot_device_available = ATOMIC_INIT(1);
 @@ -82,6 +83,10 @@ static int snapshot_open(struct inode *i
 data-swap = -1;
 data-mode = O_WRONLY;
 error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
 +   if (!error) {
 +   error = create_basic_memory_bitmaps();
 +   data-free_bitmaps = !error;
 +   }
 if (error)
 pm_notifier_call_chain(PM_POST_RESTORE);
 }
 @@ -111,6 +116,8 @@ static int snapshot_release(struct inode
 pm_restore_gfp_mask();
 free_basic_memory_bitmaps();
 thaw_processes();
 +   } else if (data-free_bitmaps) {
 +   free_basic_memory_bitmaps();
 }
 pm_notifier_call_chain(data-mode == O_RDONLY ?
 PM_POST_HIBERNATION : PM_POST_RESTORE);
 @@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *
 break;
 pm_restore_gfp_mask();
 free_basic_memory_bitmaps();
 +   data-free_bitmaps = false;
 thaw_processes();
 data-frozen = 0;
 break;

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


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-28 Thread Rafael J. Wysocki
On Saturday, September 28, 2013 08:18:18 PM Ronald wrote:
> [ resend, forgot to disable HTML (sorry!) ]
> 
> Dear kernel developers,
> 
> Commit 8fd37a4c9 (PM / hibernate: Create memory bitmaps after freezing
> user space) causes resume to fail.
> 
> Only, when using the s2disk utility (through pm-hibernate).
> 
> Not when I do:
> 
> echo -n "disk" > /sys/power/state
> 
> Reverting the commit did not work.
> 
> I am using a encrypted LUKS partition with a temporary key that is
> functioning as the swap device used for the suspend image.
> 
> Awaiting further orders

I'm traveling now, so I can't really test things, but I think I know what the
problem is.

Can you please check if the appended patch makes any difference for you?

Rafael


---
 kernel/power/snapshot.c |5 -
 kernel/power/user.c |5 +
 2 files changed, 9 insertions(+), 1 deletion(-)

Index: linux-pm/kernel/power/snapshot.c
===
--- linux-pm.orig/kernel/power/snapshot.c
+++ linux-pm/kernel/power/snapshot.c
@@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
struct memory_bitmap *bm1, *bm2;
int error = 0;
 
-   BUG_ON(forbidden_pages_map || free_pages_map);
+   if (forbidden_pages_map && free_pages_map)
+   return 0;
+   else
+   BUG_ON(forbidden_pages_map || free_pages_map);
 
bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
if (!bm1)
Index: linux-pm/kernel/power/user.c
===
--- linux-pm.orig/kernel/power/user.c
+++ linux-pm/kernel/power/user.c
@@ -82,6 +82,9 @@ static int snapshot_open(struct inode *i
data->swap = -1;
data->mode = O_WRONLY;
error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
+   if (!error)
+   error = create_basic_memory_bitmaps();
+
if (error)
pm_notifier_call_chain(PM_POST_RESTORE);
}

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


Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-28 Thread Ronald
[ resend, forgot to disable HTML (sorry!) ]

Dear kernel developers,

Commit 8fd37a4c9 (PM / hibernate: Create memory bitmaps after freezing
user space) causes resume to fail.

Only, when using the s2disk utility (through pm-hibernate).

Not when I do:

echo -n "disk" > /sys/power/state

Reverting the commit did not work.

I am using a encrypted LUKS partition with a temporary key that is
functioning as the swap device used for the suspend image.

Awaiting further orders

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


Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-28 Thread Ronald
[ resend, forgot to disable HTML (sorry!) ]

Dear kernel developers,

Commit 8fd37a4c9 (PM / hibernate: Create memory bitmaps after freezing
user space) causes resume to fail.

Only, when using the s2disk utility (through pm-hibernate).

Not when I do:

echo -n disk  /sys/power/state

Reverting the commit did not work.

I am using a encrypted LUKS partition with a temporary key that is
functioning as the swap device used for the suspend image.

Awaiting further orders

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


Re: Fwd: [v3.12-rc1] [regression] PM / hibernate: Create memory bitmaps after freezing user space

2013-09-28 Thread Rafael J. Wysocki
On Saturday, September 28, 2013 08:18:18 PM Ronald wrote:
 [ resend, forgot to disable HTML (sorry!) ]
 
 Dear kernel developers,
 
 Commit 8fd37a4c9 (PM / hibernate: Create memory bitmaps after freezing
 user space) causes resume to fail.
 
 Only, when using the s2disk utility (through pm-hibernate).
 
 Not when I do:
 
 echo -n disk  /sys/power/state
 
 Reverting the commit did not work.
 
 I am using a encrypted LUKS partition with a temporary key that is
 functioning as the swap device used for the suspend image.
 
 Awaiting further orders

I'm traveling now, so I can't really test things, but I think I know what the
problem is.

Can you please check if the appended patch makes any difference for you?

Rafael


---
 kernel/power/snapshot.c |5 -
 kernel/power/user.c |5 +
 2 files changed, 9 insertions(+), 1 deletion(-)

Index: linux-pm/kernel/power/snapshot.c
===
--- linux-pm.orig/kernel/power/snapshot.c
+++ linux-pm/kernel/power/snapshot.c
@@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void)
struct memory_bitmap *bm1, *bm2;
int error = 0;
 
-   BUG_ON(forbidden_pages_map || free_pages_map);
+   if (forbidden_pages_map  free_pages_map)
+   return 0;
+   else
+   BUG_ON(forbidden_pages_map || free_pages_map);
 
bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
if (!bm1)
Index: linux-pm/kernel/power/user.c
===
--- linux-pm.orig/kernel/power/user.c
+++ linux-pm/kernel/power/user.c
@@ -82,6 +82,9 @@ static int snapshot_open(struct inode *i
data-swap = -1;
data-mode = O_WRONLY;
error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
+   if (!error)
+   error = create_basic_memory_bitmaps();
+
if (error)
pm_notifier_call_chain(PM_POST_RESTORE);
}

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