Skip to contentSkip to conversation

extable: Flip the sorting message

PATCH In review Borislav Petkov 4 participants 7 messages Apr 15, 2013 – Apr 25, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 extable: Flip the sorting message

From: Borislav Petkov <[email protected]>

Now that we do sort the __extable at build time, we actually are interested only in the case where we still do need to sort it.

---
 kernel/extable.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/extable.c +3 -3
index fe35a634bf76..67460b93b1a1 100644
@@ -41,10 +41,10 @@ u32 __initdata main_extable_sort_needed = 1;
 /* Sort the kernel's built-in exception table */
 void __init sort_main_extable(void)
 {
-	if (main_extable_sort_needed)
+	if (main_extable_sort_needed) {
+		pr_notice("Sorting __ex_table...\n");
 		sort_extable(__start___ex_table, __stop___ex_table);
-	else
-		pr_notice("__ex_table already sorted, skipping sort\n");
+	}
 }
 
 /* Given an address, look for it in the exception tables. */
Signature · 1 line
1.8.2.135.g7b592fa
#1 lore raw
extable: Flip the sorting message
Commit-ID:  bec1b9e76353ecf05fac6a87f8e4102dfb618cd2
Gitweb:     http://git.kernel.org/tip/bec1b9e76353ecf05fac6a87f8e4102dfb618cd2
Author:     Borislav Petkov <[email protected]>
AuthorDate: Mon, 15 Apr 2013 12:51:49 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 15 Apr 2013 13:25:16 +0200

extable: Flip the sorting message

Now that we do sort the __extable at build time, we actually are interested only in the case where we still do need to sort it.

---
 kernel/extable.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/extable.c +3 -3
index fe35a63..67460b9 100644
@@ -41,10 +41,10 @@ u32 __initdata main_extable_sort_needed = 1;
 /* Sort the kernel's built-in exception table */
 void __init sort_main_extable(void)
 {
-	if (main_extable_sort_needed)
+	if (main_extable_sort_needed) {
+		pr_notice("Sorting __ex_table...\n");
 		sort_extable(__start___ex_table, __stop___ex_table);
-	else
-		pr_notice("__ex_table already sorted, skipping sort\n");
+	}
 }
 
 /* Given an address, look for it in the exception tables. */
#2 lore raw
In reply to Borislav Petkov
Quoted 18 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>

Now that we do sort the __extable at build time, we actually are interested only in the case where we still do need to sort it.

---
 kernel/extable.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/extable.c +0 -0
index fe35a634bf76..67460b93b1a1 100644
@@ -41,10 +41,10 @@ u32 __initdata main_extable_sort_needed = 1;
 /* Sort the kernel's built-in exception table */
 void __init sort_main_extable(void)

kernel/extable.c u32 __initdata main_extable_sort_needed = 1; · line 49

Quoted 10 lines
kernel/extable.c +3 -3
 {
-	if (main_extable_sort_needed)
+	if (main_extable_sort_needed) {
+		pr_notice("Sorting __ex_table...\n");
 		sort_extable(__start___ex_table, __stop___ex_table);
-	else
-		pr_notice("__ex_table already sorted, skipping sort\n");
+	}
 }
 

On some architectures we sort at runtime, on others we sort at build time.

Is there any reason for a message at all here?

-hpa

#3 lore raw
Quoted 4 lines · H. Peter Anvin

On some architectures we sort at runtime, on others we sort at build time.

Is there any reason for a message at all here?

The original pr_notice was arguably a debugging aid to verify that the build-time sorting has actually happened. I flipped it because it wasn't telling us anything interesting and we know that the sorting works - we've been staring at that message for a couple of kernel releases already :-)

One possible reason for having it flipped is to encourage runtime sorting arches to convert to build time sorting.

But silencing this completely is also ok with me - I don't care all that much.

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#4 lore raw
Quoted 4 lines · Borislav Petkov

One possible reason for having it flipped is to encourage runtime sorting arches to convert to build time sorting.

This is actually somewhat valid, plus it is the point in time when something actually is *happening*. A message saying "nothing happened" isn't actually all that interesting...

-hpa

#5 lore raw
Quoted 10 lines · H. Peter Anvin
Quoted 4 lines · Borislav Petkov

One possible reason for having it flipped is to encourage runtime sorting arches to convert to build time sorting.

This is actually somewhat valid, plus it is the point in time when something actually is *happening*. A message saying "nothing happened" isn't actually all that interesting...

Good points. As the original author of the whole mess, I don't have a strong preference. Certainly printing the message, that nothing is happening, goes against one of the main reasons for doing the sort in the first place: Speeding up booting.

David Daney

#6 lore raw
Quoted 6 lines · David Daney

Good points. As the original author of the whole mess, I don't have a strong preference. Certainly printing the message, that nothing is happening, goes against one of the main reasons for doing the sort in the first place: Speeding up booting.

Yes, not to mention making early trap overrides doable.

-hpa