Skip to contentSkip to conversation

Hibernate: Replace unnecessary evaluation of pfn_to_page()

PATCH Applied Rafael J. Wysocki 3 participants 5 messages Dec 7, 2008 – Dec 12, 2008

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

PATCH 1/1 Hibernate: Replace unnecessary evaluation of pfn_to_page()

From: Rafael J. Wysocki <[email protected]>
Subject: Hibernate: Replace unnecessary evaluation of pfn_to_page()

Replace one evaluation of pfn_to_page() in copy_data_pages() with the value of a local variable containing the right number already.

---
 kernel/power/snapshot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/snapshot.c +1 -1
Index: linux-2.6/kernel/power/snapshot.c
===================================================================
@@ -981,7 +981,7 @@ static void copy_data_page(unsigned long
 			 * data modified by kmap_atomic()
 			 */
 			safe_copy_page(buffer, s_page);
-			dst = kmap_atomic(pfn_to_page(dst_pfn), KM_USER0);
+			dst = kmap_atomic(d_page, KM_USER0);
 			memcpy(dst, buffer, PAGE_SIZE);
 			kunmap_atomic(dst, KM_USER0);
 		} else {
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>
Subject: Hibernate: Replace unnecessary evaluation of pfn_to_page()

Replace one evaluation of pfn_to_page() in copy_data_pages() with the value of a local variable containing the right number already.

Quoted 17 lines
---
 kernel/power/snapshot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/kernel/power/snapshot.c
===================================================================

kernel/power/snapshot.c +1 -1
@@ -981,7 +981,7 @@ static void copy_data_page(unsigned long
 			 * data modified by kmap_atomic()
 			 */
 			safe_copy_page(buffer, s_page);
-			dst = kmap_atomic(pfn_to_page(dst_pfn), KM_USER0);
+			dst = kmap_atomic(d_page, KM_USER0);
 			memcpy(dst, buffer, PAGE_SIZE);
 			kunmap_atomic(dst, KM_USER0);
 		} else {
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Acked-by on v1 1/1
#2 lore raw
In reply to Rafael J. Wysocki
Quoted 7 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>
Subject: Hibernate: Replace unnecessary evaluation of pfn_to_page()

Replace one evaluation of pfn_to_page() in copy_data_pages() with the value of a local variable containing the right number already.

Quoted 17 lines
---
 kernel/power/snapshot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/kernel/power/snapshot.c
===================================================================

kernel/power/snapshot.c +1 -1
@@ -981,7 +981,7 @@ static void copy_data_page(unsigned long
 			 * data modified by kmap_atomic()
 			 */
 			safe_copy_page(buffer, s_page);
-			dst = kmap_atomic(pfn_to_page(dst_pfn), KM_USER0);
+			dst = kmap_atomic(d_page, KM_USER0);
 			memcpy(dst, buffer, PAGE_SIZE);
 			kunmap_atomic(dst, KM_USER0);
 		} else {
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
reviewer Applied
#3 lore raw
Quoted 10 lines · Pavel Machek
Quoted 7 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>
Subject: Hibernate: Replace unnecessary evaluation of pfn_to_page()

Replace one evaluation of pfn_to_page() in copy_data_pages() with the value of a local variable containing the right number already.

applied to suspend branch

--
Len Brown, Intel Open Source Technology Center

reviewer Applied
#4 lore raw
In reply to Pavel Machek
Quoted 10 lines · Pavel Machek
Quoted 7 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>
Subject: Hibernate: Replace unnecessary evaluation of pfn_to_page()

Replace one evaluation of pfn_to_page() in copy_data_pages() with the value of a local variable containing the right number already.

applied to suspend branch

--
Len Brown, Intel Open Source Technology Center