Skip to contentSkip to conversation

swsusp cleanups

PATCH In review Rafael J. Wysocki 4 participants 18 messages Nov 18, 2006 – Nov 22, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover swsusp cleanups

Hi,

The following series of patches cleans up some suspend-related code.

Greetings,
Rafael

Signature · 2 lines
You never change things by fighting the existing reality.
		R. Buckminster Fuller
#1 lore raw

PATCH 1/4 swsusp: Untangle thaw_processes

Move the loop from thaw_processes() to a separate function and call it independently for kernel threads and user space processes so that the order of thawing tasks is clearly visible.

Drop thaw_kernel_threads() which is never used.

---
 include/linux/freezer.h |    6 -----
 kernel/power/process.c  |   55 +++++++++++++++++++++++++++---------------------
 2 files changed, 33 insertions(+), 28 deletions(-)
include/linux/freezer.h +1 -5
Index: linux-2.6.19-rc5-mm2/include/linux/freezer.h
===================================================================
@@ -1,8 +1,5 @@
 /* Freezer declarations */
 
-#define FREEZER_KERNEL_THREADS 0
-#define FREEZER_ALL_THREADS 1
-
 #ifdef CONFIG_PM
 /*
  * Check if a process has been frozen
@@ -60,8 +57,7 @@ static inline void frozen_process(struct
 
 extern void refrigerator(void);
 extern int freeze_processes(void);
-#define thaw_processes() do { thaw_some_processes(FREEZER_ALL_THREADS); } while(0)
-#define thaw_kernel_threads() do { thaw_some_processes(FREEZER_KERNEL_THREADS); } while(0)
+extern void thaw_processes(void);
 
 static inline int try_to_freeze(void)
 {
kernel/power/process.c +32 -23

85 lines not on this page · raw message

#2 lore raw

Re: [PATCH 1/4] swsusp: Untangle thaw_processes

Hi.

Quoted 7 lines · Rafael J. Wysocki

Move the loop from thaw_processes() to a separate function and call it independently for kernel threads and user space processes so that the order of thawing tasks is clearly visible.

Drop thaw_kernel_threads() which is never used.

Ack.

Nigel

#3 lore raw

Re: [PATCH 1/4] swsusp: Untangle thaw_processes

In reply to Rafael J. Wysocki

Hi!

Quoted 40 lines

Move the loop from thaw_processes() to a separate function and call it independently for kernel threads and user space processes so that the order of thawing tasks is clearly visible.

Drop thaw_kernel_threads() which is never used.

---
 include/linux/freezer.h |    6 -----
 kernel/power/process.c  |   55 +++++++++++++++++++++++++++---------------------
 2 files changed, 33 insertions(+), 28 deletions(-)

Index: linux-2.6.19-rc5-mm2/include/linux/freezer.h
===================================================================

include/linux/freezer.h +1 -5
@@ -1,8 +1,5 @@
 /* Freezer declarations */
 
-#define FREEZER_KERNEL_THREADS 0
-#define FREEZER_ALL_THREADS 1
-
 #ifdef CONFIG_PM
 /*
  * Check if a process has been frozen
@@ -60,8 +57,7 @@ static inline void frozen_process(struct
 
 extern void refrigerator(void);
 extern int freeze_processes(void);
-#define thaw_processes() do { thaw_some_processes(FREEZER_ALL_THREADS); } while(0)
-#define thaw_kernel_threads() do { thaw_some_processes(FREEZER_KERNEL_THREADS); } while(0)
+extern void thaw_processes(void);
 
 static inline int try_to_freeze(void)
 {

Index: linux-2.6.19-rc5-mm2/kernel/power/process.c
===================================================================

kernel/power/process.c line 24

Quoted 5 lines
kernel/power/process.c +2 -0
@@ -20,6 +20,8 @@
  */
 #define TIMEOUT	(20 * HZ)
 
+#define FREEZER_KERNEL_THREADS 0
+#define FREEZER_USER_SPACE 1

The variable is named "is_user_space"... so maybe the defines are not strictly needed?

kernel/power/process.c int freeze_processes(void) · line 179

Quoted 11 lines
kernel/power/process.c +10 -0
+	do_each_thread(g, p) {
+		if (!freezeable(p))
+			continue;
 
+		if (is_user_space(p)) {
+			if (!thaw_user_space)
+				continue;
+		} else {
+			if (thaw_user_space)
+				continue;
+		}

if (is_user_space(p) != thaw_user_space)

	continue;

?

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw

Re: [PATCH 1/4] swsusp: Untangle thaw_processes

Hi,

Quoted 45 lines · Pavel Machek

Hi!

Quoted 43 lines

Move the loop from thaw_processes() to a separate function and call it independently for kernel threads and user space processes so that the order of thawing tasks is clearly visible.

Drop thaw_kernel_threads() which is never used.

---
 include/linux/freezer.h |    6 -----
 kernel/power/process.c  |   55 +++++++++++++++++++++++++++---------------------
 2 files changed, 33 insertions(+), 28 deletions(-)

Index: linux-2.6.19-rc5-mm2/include/linux/freezer.h
===================================================================

include/linux/freezer.h +1 -5
@@ -1,8 +1,5 @@
 /* Freezer declarations */
 
-#define FREEZER_KERNEL_THREADS 0
-#define FREEZER_ALL_THREADS 1
-
 #ifdef CONFIG_PM
 /*
  * Check if a process has been frozen
@@ -60,8 +57,7 @@ static inline void frozen_process(struct
 
 extern void refrigerator(void);
 extern int freeze_processes(void);
-#define thaw_processes() do { thaw_some_processes(FREEZER_ALL_THREADS); } while(0)
-#define thaw_kernel_threads() do { thaw_some_processes(FREEZER_KERNEL_THREADS); } while(0)
+extern void thaw_processes(void);
 
 static inline int try_to_freeze(void)
 {

Index: linux-2.6.19-rc5-mm2/kernel/power/process.c
===================================================================

kernel/power/process.c +0 -0
@@ -20,6 +20,8 @@
  */
 #define TIMEOUT	(20 * HZ)
 
Quoted 5 lines

kernel/power/process.c line 24

Quoted 2 lines
kernel/power/process.c +2 -0
+#define FREEZER_KERNEL_THREADS 0
+#define FREEZER_USER_SPACE 1

The variable is named "is_user_space"... so maybe the defines are not strictly needed?

Not strlctly, but if I see

	thaw_tasks(FREEZER_KERNEL_THREADS);
	thaw_tasks(FREEZER_USER_SPACE);

I can figure out what's going on even without looking at thaw_tasks().

Quoted 13 lines

kernel/power/process.c

Quoted 11 lines
kernel/power/process.c +10 -0
+	do_each_thread(g, p) {
+		if (!freezeable(p))
+			continue;
 
+		if (is_user_space(p)) {
+			if (!thaw_user_space)
+				continue;
+		} else {
+			if (thaw_user_space)
+				continue;
+		}

if (is_user_space(p) != thaw_user_space)

Quoted 1 line
	continue;

Ah, good idea. In fact I prefer if (is_user_space(p) == !thaw_user_space), because it will work even if thaw_user_space is different to 1 and 0.

Revised patch follows.

---
Move the loop from thaw_processes() to a separate function and call it independently for kernel threads and user space processes so that the order of thawing tasks is clearly visible.

Drop thaw_kernel_threads() which is never used.

---
 include/linux/freezer.h |    6 -----
 kernel/power/process.c  |   53 ++++++++++++++++++++++++++----------------------
 2 files changed, 30 insertions(+), 29 deletions(-)
include/linux/freezer.h +1 -5
Index: linux-2.6.19-rc5-mm2/include/linux/freezer.h
===================================================================
@@ -1,8 +1,5 @@
 /* Freezer declarations */
 
-#define FREEZER_KERNEL_THREADS 0
-#define FREEZER_ALL_THREADS 1
-
 #ifdef CONFIG_PM
 /*
  * Check if a process has been frozen
@@ -60,8 +57,7 @@ static inline void frozen_process(struct
 
 extern void refrigerator(void);
 extern int freeze_processes(void);
-#define thaw_processes() do { thaw_some_processes(FREEZER_ALL_THREADS); } while(0)
-#define thaw_kernel_threads() do { thaw_some_processes(FREEZER_KERNEL_THREADS); } while(0)
+extern void thaw_processes(void);
 
 static inline int try_to_freeze(void)
 {
kernel/power/process.c +29 -24

82 lines not on this page · raw message

#5 lore raw

Re: [PATCH 1/4] swsusp: Untangle thaw_processes

Hi!

Quoted 11 lines

Ah, good idea. In fact I prefer if (is_user_space(p) == !thaw_user_space), because it will work even if thaw_user_space is different to 1 and 0.

Revised patch follows.

---
Move the loop from thaw_processes() to a separate function and call it independently for kernel threads and user space processes so that the order of thawing tasks is clearly visible.

Drop thaw_kernel_threads() which is never used.

ACK.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw

PATCH 2/4 swsusp: Untangle freeze_processes

In reply to Rafael J. Wysocki

Move the loop from freeze_processes() to a separate function and call it independently for user space processes and kernel threads so that the order of freezing tasks is clearly visible.

---
 kernel/power/process.c |   88 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 58 insertions(+), 30 deletions(-)
kernel/power/process.c +58 -30
Index: linux-2.6.19-rc5-mm2/kernel/power/process.c
===================================================================
@@ -86,24 +86,23 @@ static inline int is_user_space(struct t
 	return p->mm && !(p->flags & PF_BORROWED_MM);
 }
 
-/* 0 = success, else # of processes that we failed to stop */
-int freeze_processes(void)
+static unsigned int try_to_freeze_tasks(int freeze_user_space)
 {
-	int todo, nr_user, user_frozen;
-	unsigned long start_time;
 	struct task_struct *g, *p;
+	unsigned long end_time;
+	unsigned int todo;
 
-	printk("Stopping tasks... ");
-	start_time = jiffies;
-	user_frozen = 0;
+	end_time = jiffies + TIMEOUT;
 	do {
-		nr_user = todo = 0;
+		todo = 0;
 		read_lock(&tasklist_lock);
 		do_each_thread(g, p) {
 			if (!freezeable(p))
 				continue;
+
 			if (frozen(p))
 				continue;
+
 			if (p->state == TASK_TRACED &&
 			    (frozen(p->parent) ||
 			     p->parent->state == TASK_STOPPED)) {
@@ -111,51 +110,80 @@ int freeze_processes(void)
 				continue;
 			}
 			if (is_user_space(p)) {
+				if (!freeze_user_space)
+					continue;
+
 				/* Freeze the task unless there is a vfork
 				 * completion pending
 				 */
 				if (!p->vfork_done)
 					freeze_process(p);
-				nr_user++;
 			} else {
-				/* Freeze only if the user space is frozen */
-				if (user_frozen)
-					freeze_process(p);
-				todo++;
+				if (freeze_user_space)
+					continue;
+
+				freeze_process(p);
 			}
+			todo++;
 		} while_each_thread(g, p);
 		read_unlock(&tasklist_lock);
-		todo += nr_user;
-		if (!user_frozen && !nr_user) {
-			sys_sync();
-			start_time = jiffies;
-		}
-		user_frozen = !nr_user;
 		yield();			/* Yield is okay here */
-		if (todo && time_after(jiffies, start_time + TIMEOUT))
+		if (todo && time_after(jiffies, end_time))
 			break;
-	} while(todo);
+	} while (todo);
 
-	/* This does not unfreeze processes that are already frozen
-	 * (we have slightly ugly calling convention in that respect,
-	 * and caller must call thaw_processes() if something fails),
-	 * but it cleans up leftover PF_FREEZE requests.
-	 */
 	if (todo) {
+		/* This does not unfreeze processes that are already frozen
+		 * (we have slightly ugly calling convention in that respect,
+		 * and caller must call thaw_processes() if something fails),
+		 * but it cleans up leftover PF_FREEZE requests.
+		 */
 		printk("\n");
-		printk(KERN_ERR "Stopping tasks timed out "
-			"after %d seconds (%d tasks remaining):\n",
-			TIMEOUT / HZ, todo);
+		printk(KERN_ERR "Stopping %s timed out after %d seconds "
+				"(%d tasks refusing to freeze):\n",
+				freeze_user_space ? "user space processes" :
+					"kernel threads",
+				TIMEOUT / HZ, todo);
 		read_lock(&tasklist_lock);
 		do_each_thread(g, p) {
+			if (is_user_space(p)) {
+				if(!freeze_user_space)
+					continue;
+			} else {
+				if(freeze_user_space)
+					continue;
+			}
 			if (freezeable(p) && !frozen(p))
 				printk(KERN_ERR " %s\n", p->comm);
+
 			cancel_freezing(p);
 		} while_each_thread(g, p);
 		read_unlock(&tasklist_lock);
-		return todo;
 	}
 
+	return todo;
+}
+
+/**
+ *	freeze_processes - tell processes to enter the refrigerator
+ *
+ *	Returns 0 on success, or the number of processes that didn't freeze,
+ *	although they were told to.
+ */
+int freeze_processes(void)
+{
+	unsigned int nr_unfrozen;
+
+	printk("Stopping tasks ... ");
+	nr_unfrozen = try_to_freeze_tasks(FREEZER_USER_SPACE);
+	if (nr_unfrozen)
+		return nr_unfrozen;
+
+	sys_sync();
+	nr_unfrozen = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
+	if (nr_unfrozen)
+		return nr_unfrozen;
+
 	printk("done.\n");
 	BUG_ON(in_atomic());
 	return 0;
#7 lore raw

Re: [PATCH 2/4] swsusp: Untangle freeze_processes

Hi!

Quoted 10 lines

Move the loop from freeze_processes() to a separate function and call it independently for user space processes and kernel threads so that the order of freezing tasks is clearly visible.

---
 kernel/power/process.c |   88 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 58 insertions(+), 30 deletions(-)

kernel/power/process.c int freeze_processes(void) · line 155

Quoted 8 lines
kernel/power/process.c +7 -0
 		do_each_thread(g, p) {
+			if (is_user_space(p)) {
+				if(!freeze_user_space)
+					continue;
+			} else {
+				if(freeze_user_space)
+					continue;
+			}

Needs space between if and (, but lets use if (is_user_space() != freeze_user_space) trick here, too.

Quoted 6 lines

+/**
+ * freeze_processes - tell processes to enter the refrigerator
+ *
+ * Returns 0 on success, or the number of processes that didn't freeze,
+ * although they were told to.
+ */

Above you point out to the broken calling convention. Perhaps this is great time to fix it, too? Hmm, or maybe not. Patch looks good, otherwise.

Pavel

Quoted 17 lines
kernel/power/process.c +14 -0
+int freeze_processes(void)
+{
+	unsigned int nr_unfrozen;
+
+	printk("Stopping tasks ... ");
+	nr_unfrozen = try_to_freeze_tasks(FREEZER_USER_SPACE);
+	if (nr_unfrozen)
+		return nr_unfrozen;
+
+	sys_sync();
+	nr_unfrozen = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
+	if (nr_unfrozen)
+		return nr_unfrozen;
+
 	printk("done.\n");
 	BUG_ON(in_atomic());
 	return 0;
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#8 lore raw

Re: [PATCH 2/4] swsusp: Untangle freeze_processes

Hi,

Quoted 12 lines · Pavel Machek

Hi!

Quoted 9 lines

Move the loop from freeze_processes() to a separate function and call it independently for user space processes and kernel threads so that the order of freezing tasks is clearly visible.

---
 kernel/power/process.c |   88 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 58 insertions(+), 30 deletions(-)
Quoted 11 lines

Review

Quoted 8 lines
(quoted diff) +7 -0
 		do_each_thread(g, p) {
+			if (is_user_space(p)) {
+				if(!freeze_user_space)
+					continue;
+			} else {
+				if(freeze_user_space)
+					continue;
+			}

Needs space between if and (, but lets use if (is_user_space() != freeze_user_space) trick here, too.

OK

New version of the patch follows.

---
Move the loop from freeze_processes() to a separate function and call it independently for user space processes and kernel threads so that the order of freezing tasks is clearly visible.

---
 kernel/power/process.c |   84 +++++++++++++++++++++++++++++++------------------
 1 file changed, 54 insertions(+), 30 deletions(-)
kernel/power/process.c +54 -30
Index: linux-2.6.19-rc5-mm2/kernel/power/process.c
===================================================================
@@ -86,24 +86,23 @@ static inline int is_user_space(struct t
 	return p->mm && !(p->flags & PF_BORROWED_MM);
 }
 
-/* 0 = success, else # of processes that we failed to stop */
-int freeze_processes(void)
+static unsigned int try_to_freeze_tasks(int freeze_user_space)
 {
-	int todo, nr_user, user_frozen;
-	unsigned long start_time;
 	struct task_struct *g, *p;
+	unsigned long end_time;
+	unsigned int todo;
 
-	printk("Stopping tasks... ");
-	start_time = jiffies;
-	user_frozen = 0;
+	end_time = jiffies + TIMEOUT;
 	do {
-		nr_user = todo = 0;
+		todo = 0;
 		read_lock(&tasklist_lock);
 		do_each_thread(g, p) {
 			if (!freezeable(p))
 				continue;
+
 			if (frozen(p))
 				continue;
+
 			if (p->state == TASK_TRACED &&
 			    (frozen(p->parent) ||
 			     p->parent->state == TASK_STOPPED)) {
@@ -111,51 +110,76 @@ int freeze_processes(void)
 				continue;
 			}
 			if (is_user_space(p)) {
+				if (!freeze_user_space)
+					continue;
+
 				/* Freeze the task unless there is a vfork
 				 * completion pending
 				 */
 				if (!p->vfork_done)
 					freeze_process(p);
-				nr_user++;
 			} else {
-				/* Freeze only if the user space is frozen */
-				if (user_frozen)
-					freeze_process(p);
-				todo++;
+				if (freeze_user_space)
+					continue;
+
+				freeze_process(p);
 			}
+			todo++;
 		} while_each_thread(g, p);
 		read_unlock(&tasklist_lock);
-		todo += nr_user;
-		if (!user_frozen && !nr_user) {
-			sys_sync();
-			start_time = jiffies;
-		}
-		user_frozen = !nr_user;
 		yield();			/* Yield is okay here */
-		if (todo && time_after(jiffies, start_time + TIMEOUT))
+		if (todo && time_after(jiffies, end_time))
 			break;
-	} while(todo);
+	} while (todo);
 
-	/* This does not unfreeze processes that are already frozen
-	 * (we have slightly ugly calling convention in that respect,
-	 * and caller must call thaw_processes() if something fails),
-	 * but it cleans up leftover PF_FREEZE requests.
-	 */
 	if (todo) {
+		/* This does not unfreeze processes that are already frozen
+		 * (we have slightly ugly calling convention in that respect,
+		 * and caller must call thaw_processes() if something fails),
+		 * but it cleans up leftover PF_FREEZE requests.
+		 */
 		printk("\n");
-		printk(KERN_ERR "Stopping tasks timed out "
-			"after %d seconds (%d tasks remaining):\n",
-			TIMEOUT / HZ, todo);
+		printk(KERN_ERR "Stopping %s timed out after %d seconds "
+				"(%d tasks refusing to freeze):\n",
+				freeze_user_space ? "user space processes" :
+					"kernel threads",
+				TIMEOUT / HZ, todo);
 		read_lock(&tasklist_lock);
 		do_each_thread(g, p) {
+			if (is_user_space(p) == !freeze_user_space)
+				continue;
+
 			if (freezeable(p) && !frozen(p))
 				printk(KERN_ERR " %s\n", p->comm);
+
 			cancel_freezing(p);
 		} while_each_thread(g, p);
 		read_unlock(&tasklist_lock);
-		return todo;
 	}
 
+	return todo;
+}
+
+/**
+ *	freeze_processes - tell processes to enter the refrigerator
+ *
+ *	Returns 0 on success, or the number of processes that didn't freeze,
+ *	although they were told to.
+ */
+int freeze_processes(void)
+{
+	unsigned int nr_unfrozen;
+
+	printk("Stopping tasks ... ");
+	nr_unfrozen = try_to_freeze_tasks(FREEZER_USER_SPACE);
+	if (nr_unfrozen)
+		return nr_unfrozen;
+
+	sys_sync();
+	nr_unfrozen = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
+	if (nr_unfrozen)
+		return nr_unfrozen;
+
 	printk("done.\n");
 	BUG_ON(in_atomic());
 	return 0;
#9 lore raw

Re: [PATCH 2/4] swsusp: Untangle freeze_processes

Hi!

Quoted 11 lines
Quoted 2 lines

Needs space between if and (, but lets use if (is_user_space() != freeze_user_space) trick here, too.

OK

New version of the patch follows.

---
Move the loop from freeze_processes() to a separate function and call it independently for user space processes and kernel threads so that the order of freezing tasks is clearly visible.

ACK.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#10 lore raw

PATCH 3/4 swsusp: Fix coding style in suspend.c

In reply to Rafael J. Wysocki

Fix coding style in suspend.c.

---
 kernel/power/snapshot.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/power/snapshot.c +2 -1
Index: linux-2.6.19-rc5-mm2/kernel/power/snapshot.c
===================================================================
@@ -85,7 +85,8 @@ unsigned long get_safe_page(gfp_t gfp_ma
 	return (unsigned long)get_image_page(gfp_mask, PG_SAFE);
 }
 
-static struct page *alloc_image_page(gfp_t gfp_mask) {
+static struct page *alloc_image_page(gfp_t gfp_mask)
+{
 	struct page *page;
 
 	page = alloc_page(gfp_mask);
#11 lore raw

Re: [PATCH 3/4] swsusp: Fix coding style in suspend.c

Quoted 1 line · Rafael J. Wysocki

Fix coding style in suspend.c.

ACK.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#12 lore raw

PATCH 4/4 swsusp: Fix labels

In reply to Rafael J. Wysocki

Move all labels in the swsusp code to the second column, so that they won't fool diff -p.

---
 kernel/power/disk.c     |    6 +++---
 kernel/power/snapshot.c |    8 ++++----
 kernel/power/swap.c     |    4 ++--
 kernel/power/swsusp.c   |    2 +-
 kernel/power/user.c     |    2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)
kernel/power/disk.c +3 -3
Index: linux-2.6.19-rc5-mm2/kernel/power/disk.c
===================================================================
@@ -119,9 +119,9 @@ static int prepare_processes(void)
 		return 0;
 
 	platform_finish();
-thaw:
+ thaw:
 	thaw_processes();
-enable_cpus:
+ enable_cpus:
 	enable_nonboot_cpus();
 	pm_restore_console();
 	return error;
@@ -394,7 +394,7 @@ static ssize_t resume_store(struct subsy
 	noresume = 0;
 	software_resume();
 	ret = n;
-out:
+ out:
 	return ret;
 }
 
kernel/power/snapshot.c +4 -4
Index: linux-2.6.19-rc5-mm2/kernel/power/snapshot.c
===================================================================
@@ -411,7 +411,7 @@ memory_bm_create(struct memory_bitmap *b
 	memory_bm_position_reset(bm);
 	return 0;
 
-Free:
+ Free:
 	bm->p_list = ca.chain;
 	memory_bm_free(bm, PG_UNSAFE_CLEAR);
 	return -ENOMEM;
@@ -557,7 +557,7 @@ static unsigned long memory_bm_next_pfn(
 	memory_bm_position_reset(bm);
 	return BM_END_OF_MAP;
 
-Return_pfn:
+ Return_pfn:
 	bm->cur.chunk = chunk;
 	bm->cur.bit = bit;
 	return bb->start_pfn + chunk * BM_BITS_PER_CHUNK + bit;
@@ -964,7 +964,7 @@ swsusp_alloc(struct memory_bitmap *orig_
 	}
 	return 0;
 
-Free:
+ Free:
 	swsusp_free();
 	return -ENOMEM;
 }
@@ -1540,7 +1540,7 @@ prepare_image(struct memory_bitmap *new_
 	}
 	return 0;
 
-Free:
+ Free:
 	swsusp_free();
 	return error;
 }
kernel/power/swsusp.c +1 -1
Index: linux-2.6.19-rc5-mm2/kernel/power/swsusp.c
===================================================================
@@ -288,7 +288,7 @@ int swsusp_suspend(void)
 	 * that suspended with irqs off ... no overall powerup.
 	 */
 	device_power_up();
-Enable_irqs:
+ Enable_irqs:
 	local_irq_enable();
 	return error;
 }
kernel/power/user.c +1 -1
Index: linux-2.6.19-rc5-mm2/kernel/power/user.c
===================================================================
@@ -313,7 +313,7 @@ static int snapshot_ioctl(struct inode *
 		if (pm_ops->finish)
 			pm_ops->finish(PM_SUSPEND_MEM);
 
-OutS3:
+ OutS3:
 		up(&pm_sem);
 		break;
 
kernel/power/swap.c +2 -2
Index: linux-2.6.19-rc5-mm2/kernel/power/swap.c
===================================================================
@@ -301,7 +301,7 @@ static int swap_write_page(struct swap_m
 		handle->cur_swap = offset;
 		handle->k = 0;
 	}
-out:
+ out:
 	return error;
 }
 
@@ -429,7 +429,7 @@ int swsusp_write(void)
 	if (error)
 		free_all_swap_pages(root_swap, handle.bitmap);
 	release_swap_writer(&handle);
-out:
+ out:
 	swsusp_close();
 	return error;
 }
#13 lore raw

Re: [PATCH 4/4] swsusp: Fix labels

Hi.

Quoted 2 lines · Rafael J. Wysocki

Move all labels in the swsusp code to the second column, so that they won't fool diff -p.

This sounds like working around brokenness in diff -p. Should/could a patch be submitted to the diff maintainer instead?

Regards,

Nigel

#14 lore raw

Re: [PATCH 4/4] swsusp: Fix labels

Quoted 8 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Rafael J. Wysocki

Move all labels in the swsusp code to the second column, so that they won't fool diff -p.

This sounds like working around brokenness in diff -p. Should/could a patch be submitted to the diff maintainer instead?

No. This feature of diff is actually documented.

There was a discussion on LKML about it some time ago and the patch follows the conclusion.

Greetings,
Rafael

Signature · 2 lines
You never change things by fighting the existing reality.
		R. Buckminster Fuller
#15 lore raw

Re: [PATCH 4/4] swsusp: Fix labels

Quoted 7 lines · On Sun, 19 Nov 2006 00:25:06 +0100 Rafael J. Wysocki wrote:
Quoted 6 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Rafael J. Wysocki

Move all labels in the swsusp code to the second column, so that they won't fool diff -p.

Quoted 7 lines
Quoted 2 lines

This sounds like working around brokenness in diff -p. Should/could a patch be submitted to the diff maintainer instead?

No. This feature of diff is actually documented.

There was a discussion on LKML about it some time ago and the patch follows the conclusion.

There was discussion, and then both Jesper and I tried to reproduce the problem with diff and could not do so. Maybe it has already been fixed. (?)

---
~Randy

#16 lore raw

Re: [PATCH 4/4] swsusp: Fix labels

Quoted 12 lines · Randy Dunlap
Quoted 10 lines · On Sun, 19 Nov 2006 00:25:06 +0100 Rafael J. Wysocki wrote:
Quoted 8 lines · Nigel Cunningham

Hi.

Quoted 2 lines · Rafael J. Wysocki

Move all labels in the swsusp code to the second column, so that they won't fool diff -p.

This sounds like working around brokenness in diff -p. Should/could a patch be submitted to the diff maintainer instead?

Quoted 8 lines
Quoted 4 lines

No. This feature of diff is actually documented.

There was a discussion on LKML about it some time ago and the patch follows the conclusion.

There was discussion, and then both Jesper and I tried to reproduce the problem with diff and could not do so. Maybe it has already been fixed. (?)

Well, I'm not sure.

Greetings,
Rafael

Signature · 2 lines
You never change things by fighting the existing reality.
		R. Buckminster Fuller
#17 lore raw

Re: [PATCH 4/4] swsusp: Fix labels

In reply to Rafael J. Wysocki
Quoted 4 lines · Rafael J. Wysocki

Move all labels in the swsusp code to the second column, so that they won't fool diff -p.

ACK.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html