On Saturday 10 November 2007, Maxim Sobolev wrote:
> Bruce Evans wrote:
> > Off is a good default since hyperthreading seems to be a
> > pessimization in most casts.
>
> Well, actually it all depends on workload and scheduling. I believe ULE
> is expected to improve things quite a bit in scheduling department.
> However, even with ol'good SCHED_BSD we measured noticeable performance
> increase (15-25%) in CPU intensive real-world tasks  with HTT enabled
> on 2-way SMP Xeon system. It was in 2004, both CPUs and schedules
> should have been improved since that time.

How about something along the lines of the attached?  Completely untested 
and my first time to touch sysinstall, but it seems to make sense to give 
the first time user a tiny hint/choice like that.  Would be nice to first 
check if we are even HTT-capable - how do you figure that out again?

-- 
/"\  Best regards,                      | [EMAIL PROTECTED]
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | [EMAIL PROTECTED]
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
Index: config.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/sysinstall/config.c,v
retrieving revision 1.242.2.1
diff -u -r1.242.2.1 config.c
--- config.c	1 Nov 2007 13:07:28 -0000	1.242.2.1
+++ config.c	11 Nov 2007 02:45:56 -0000
@@ -956,6 +956,27 @@
 } 
 #endif
 
+#if defined(__i386__) || defined(__amd64__)
+int
+configHTT(dialogMenuItem *self)
+{
+    FILE *ldconf;
+
+    ldconf = fopen("/boot/loader.conf", "a");
+    if (ldconf == NULL) {
+	msgConfirm("Unable to open /boot/loader.conf.  Please set\n"
+                   "machdep.hyperthreading_allowed=1 manually.\n");
+	return DITEM_FAILURE;
+    }
+
+    fprintf(ldconf, "# --- Generated by sysinstall ---\n");
+    fprintf(ldconf, "machdep.hyperthreading_allowed=1\n");
+    fclose(ldconf);
+
+    return DITEM_SUCCESS;
+} 
+#endif
+
 int
 configMTAPostfix(dialogMenuItem *self)
 {
Index: install.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/sysinstall/install.c,v
retrieving revision 1.373
diff -u -r1.373 install.c
--- install.c	25 Jun 2007 16:37:16 -0000	1.373
+++ install.c	11 Nov 2007 02:42:15 -0000
@@ -713,6 +713,14 @@
     }
 #endif
 
+#if defined(__i386__) || defined(__amd64__)
+    dialog_clear_norefresh();
+    if (!msgNoYes("Would you like to enable HyperThreading despite possible security issues?\n"
+                  "Consult 'FreeBSD-SA-05:09.htt' for details.\n")) {
+        (void)configHTT(self);
+    }
+#endif
+
     /* Now would be a good time to checkpoint the configuration data */
     configRC_conf();
     sync();
Index: sysinstall.h
===================================================================
RCS file: /home/ncvs/src/usr.sbin/sysinstall/sysinstall.h,v
retrieving revision 1.274
diff -u -r1.274 sysinstall.h
--- sysinstall.h	25 Jun 2007 16:37:16 -0000	1.274
+++ sysinstall.h	11 Nov 2007 02:46:53 -0000
@@ -560,6 +560,9 @@
 extern int	checkLoaderACPI(void);
 extern int	configLoaderACPI(int);
 #endif
+#if defined(__i386__) || defined(__amd64__)
+extern int	configHTT(dialogMenuItem *self);
+#endif
 
 /* devices.c */
 extern DMenu	*deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d),

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to