Not yet
As I advertised yesterday, I had a short look at hyper threading today. Well, that short look was actually a bit longer than what I hoped for - and it even still doesn't work.
While starting up the second logical processor is working almost fine - for some reason it needs some longer timeouts between the initialization commands - I get no interrupts anymore, when both processors are running. Have I said none? Not true, as the inter-CPU messages (which are interrupt based) are still working. But even the APIC timers don't trigger an interrupt anymore (the timer interrupt is what makes the CPU switch to another thread from time to time).
So both processors are running the thread they were given at some point. Sometimes they went through until the disk manager is trying to read something from a disk (as you need interrupts for that), sometimes they hang before - probably depending on which CPU gets which thread. The page daemon for example, isn't likely to get us that far :-)
Anyway, the APICs are correctly initialized and enabled - the only thing that I still don't touch is the I/O APIC which is responsible for dispatching interrupts to the local CPU APICs. But since it's working fine in a uni-processor environment, it should also just work with both CPUs running.
So even though Hyper Threading seems to be popular, I am postponing it a bit - it would definitely take some more time to get right. I'll probably tackle it again when the system doesn't use the virtual wire mode anymore for SMP (in a few weeks, I'd guess). Also, to really configure the system correctly, we should look at ACPI which isn't available in the boot loader right now.
If you want to give it a try yourself, Hyper Threading is currently disabled: to enable it, you'd have to uncomment lines 228 to 231 in src/system/boot/platform/bios_ia32/smp.cpp. But don't get your hopes up too much :-)
Now, it's app_server time.
10 Comments:
First time I read chinese written in ascii and I actually nejoy it. (ahah).
Oh well, maybe later. At least it's good to know what's going on and get an inside picture of the Haiku system.
blaha fred is just too funny.
*cough* spam *cough*
Anyway getting back to Haiku, great work Axel keep it up. I just wish the project had some more money so you could keep going :(
Hi Fred, I find it quite refreshing to occasionally read a reply like yours with a familiar topic such as douchebaggery. It's not was I was searching for but somehow adds to ones list of lifes experiences in a negative way.
I have a death wish for sites and blogs related to custom web design and/or sites that have a central theme around custom web design type items.
I'd like to live just long enough to be there when they cut off your head and stick it on a pike as a warning to the next ten generations that some favors come with too high a price. I'd look up at your lifeless eyes and wave like this. Can you and your associates arrange it for me, Fred?
I guess fred is a bot. =) So it doesnt care. We should report it to blogger staff.
Right Said Fred ... "I'm too sexy for this site"
@Axel, you might need to implement the - Show word verification for comments on your blog.
I have already deleted several of those "spam" comments; they usually came up shortly after having written the original post.
I've now turned on the word verification as Sikosis suggested. Please send me your complaints about that :-)
If it doesn't help, I'll remove it again.
I wondered if the support of Hyper-threading may also implies the support of multi-core CPUs. I read somewhere (can't remember where) that AMD multi-core CPUs returned a bit indicating that they support Hyper-threading in order to allow applications optimized for Hyper-threading to take advantage of the second core ? Is it true and does it imply that when supporting Hyper-threading Haiku will also support multi-core CPUs. I'll buy such a system soon and it would be nice to see the second core used by Haiku :) !
If I understand right.
For dual-core, it would be better to just identify the cores themselves and use them as dual processor set up.
From what I've read, some consideration has to be taken to maximize hyper-threading performance because of the shared resources. It has a particular problem when using a spin-wait loop to get a thread. If there isn't a pause in the loop, the loop eats up the resources by running as fast as possible. This slows down the thread on the other logical processor.
This isn't a problem on dual processors or multi-core cpus.
Post a Comment
<< Home