[haiku-commits] BRANCH pdziepak-github.scheduler [6b20e52] in src/system/kernel: scheduler vm arch/x86

  • From: pdziepak-github.scheduler <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 20 Dec 2013 06:00:33 +0100 (CET)

added 3 changesets to branch 'refs/remotes/pdziepak-github/scheduler'
old head: 2c51320a3c22507f2bbb79be51cb4bc3b58df4fb
new head: 6b20e521d5144c08c4f1fdae61379ce89d5e5cf4
overview: https://github.com/pdziepak/Haiku/compare/2c51320...6b20e52

----------------------------------------------------------------------------

ae3bced: kernel/vm: Fix unsigned/signed comparison warning

3b78c45: x86: Remove debug message

6b20e52: scheduler: Allow calling UpdatePriority() for disabled CPU

                                    [ Pawel Dziepak <pdziepak@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

4 files changed, 9 insertions(+), 8 deletions(-)
src/system/kernel/arch/x86/arch_int.cpp       |  1 -
src/system/kernel/scheduler/scheduler.cpp     | 11 +++++------
src/system/kernel/scheduler/scheduler_cpu.cpp |  3 +++
src/system/kernel/vm/vm_page.cpp              |  2 +-

############################################################################

Commit:      ae3bced647ea7ff7a0d30ad3f054a9e80e8ddc66
Author:      Pawel Dziepak <pdziepak@xxxxxxxxxxx>
Date:        Fri Dec 20 04:01:13 2013 UTC
Committer:   Pawel Dziepak <pdziepak@nyarlathotep>
Commit-Date: Fri Dec 20 04:40:59 2013 UTC

kernel/vm: Fix unsigned/signed comparison warning

----------------------------------------------------------------------------

diff --git a/src/system/kernel/vm/vm_page.cpp b/src/system/kernel/vm/vm_page.cpp
index 0087827..4c01f1f 100644
--- a/src/system/kernel/vm/vm_page.cpp
+++ b/src/system/kernel/vm/vm_page.cpp
@@ -4077,7 +4077,7 @@ vm_page_get_stats(system_info *info)
        //      active + inactive + unused + wired + modified + cached + free + 
clear
        // So taking out the cached (including modified non-temporary), free and
        // clear ones leaves us with all used pages.
-       int32 subtractPages = info->cached_pages + sFreePageQueue.Count()
+       uint32 subtractPages = info->cached_pages + sFreePageQueue.Count()
                + sClearPageQueue.Count();
        info->used_pages = subtractPages > info->max_pages
                ? 0 : info->max_pages - subtractPages;

############################################################################

Commit:      3b78c45026a6e462b2eeadb5bcdaa0d9e7f2f8fb
Author:      Pawel Dziepak <pdziepak@xxxxxxxxxxx>
Date:        Fri Dec 20 04:02:23 2013 UTC
Committer:   Pawel Dziepak <pdziepak@nyarlathotep>
Commit-Date: Fri Dec 20 04:40:59 2013 UTC

x86: Remove debug message

----------------------------------------------------------------------------

diff --git a/src/system/kernel/arch/x86/arch_int.cpp 
b/src/system/kernel/arch/x86/arch_int.cpp
index 0ff467a..89b8257 100644
--- a/src/system/kernel/arch/x86/arch_int.cpp
+++ b/src/system/kernel/arch/x86/arch_int.cpp
@@ -402,7 +402,6 @@ arch_int_are_interrupts_enabled(void)
 void
 arch_int_assign_to_cpu(int32 irq, int32 cpu)
 {
-       dprintf("ASSIGN IRQ TO CPU\n");
        switch (sVectorSources[irq]) {
                case IRQ_SOURCE_IOAPIC:
                        if (sCurrentPIC->assign_interrupt_to_cpu != NULL)

############################################################################

Commit:      6b20e521d5144c08c4f1fdae61379ce89d5e5cf4
Author:      Pawel Dziepak <pdziepak@xxxxxxxxxxx>
Date:        Fri Dec 20 04:38:15 2013 UTC
Committer:   Pawel Dziepak <pdziepak@nyarlathotep>
Commit-Date: Fri Dec 20 04:40:59 2013 UTC

scheduler: Allow calling UpdatePriority() for disabled CPU

----------------------------------------------------------------------------

diff --git a/src/system/kernel/scheduler/scheduler.cpp 
b/src/system/kernel/scheduler/scheduler.cpp
index dcb0583..8046bd5 100644
--- a/src/system/kernel/scheduler/scheduler.cpp
+++ b/src/system/kernel/scheduler/scheduler.cpp
@@ -501,10 +501,9 @@ reschedule(int32 nextState)
        nextThread->state = B_THREAD_RUNNING;
 
        // update CPU heap
-       if (!gCPU[thisCPU].disabled) {
-               SpinLocker coreLocker(core->fCPULock);
-               cpu->UpdatePriority(nextThreadData->GetEffectivePriority());
-       }
+       SpinLocker coreLocker(core->fCPULock);
+       cpu->UpdatePriority(nextThreadData->GetEffectivePriority());
+       coreLocker.Unlock();
 
        // track kernel time (user time is tracked in thread_at_kernel_entry())
        update_thread_times(oldThread, nextThread);
@@ -637,8 +636,6 @@ scheduler_set_cpu_enabled(int32 cpuID, bool enabled)
 
        InterruptsBigSchedulerLocker _;
 
-       gCPU[cpuID].disabled = !enabled;
-
        gCurrentMode->set_cpu_enabled(cpuID, enabled);
 
        CPUEntry* cpu = &gCPUEntries[cpuID];
@@ -654,6 +651,8 @@ scheduler_set_cpu_enabled(int32 cpuID, bool enabled)
                core->fCPUCount--;
        }
 
+       gCPU[cpuID].disabled = !enabled;
+
        if (core->fCPUCount == 0) {
                // core has been disabled
                ASSERT(!enabled);
diff --git a/src/system/kernel/scheduler/scheduler_cpu.cpp 
b/src/system/kernel/scheduler/scheduler_cpu.cpp
index d55d03d..8c9b048 100644
--- a/src/system/kernel/scheduler/scheduler_cpu.cpp
+++ b/src/system/kernel/scheduler/scheduler_cpu.cpp
@@ -53,6 +53,9 @@ CPUEntry::CPUEntry()
 void
 CPUEntry::UpdatePriority(int32 priority)
 {
+       if (gCPU[fCPUNumber].disabled)
+               return;
+
        int32 corePriority = 
CPUPriorityHeap::GetKey(fCore->fCPUHeap.PeekMaximum());
        fCore->fCPUHeap.ModifyKey(this, priority);
 


Other related posts:

  • » [haiku-commits] BRANCH pdziepak-github.scheduler [6b20e52] in src/system/kernel: scheduler vm arch/x86 - pdziepak-github . scheduler