Browse Source

Kernel+Userland: Remove unused "effective priority" from threads

This has been merged with the regular Thread::priority field after
the recent changes to the scheduler.
Andreas Kling 4 năm trước cách đây
mục cha
commit
b72f067f0d

+ 0 - 1
Kernel/FileSystem/ProcFS.cpp

@@ -795,7 +795,6 @@ static bool procfs$all(InodeIdentifier, KBufferBuilder& builder)
             thread_object.add("state", thread.state_string());
             thread_object.add("cpu", thread.cpu());
             thread_object.add("priority", thread.priority());
-            thread_object.add("effective_priority", thread.effective_priority());
             thread_object.add("syscall_count", thread.syscall_count());
             thread_object.add("inode_faults", thread.inode_faults());
             thread_object.add("zero_faults", thread.zero_faults());

+ 2 - 3
Kernel/Scheduler.cpp

@@ -161,7 +161,7 @@ void Scheduler::queue_runnable_thread(Thread& thread)
     ASSERT(g_scheduler_lock.own_lock());
     if (&thread == Processor::current().idle_thread())
         return;
-    auto priority = thread_priority_to_priority_index(thread.effective_priority());
+    auto priority = thread_priority_to_priority_index(thread.priority());
 
     ScopedSpinLock lock(g_ready_queues_lock);
     ASSERT(thread.m_runnable_priority < 0);
@@ -260,8 +260,7 @@ bool Scheduler::pick_next()
 
         dbgln("Scheduler[{}j]: Runnables:", Processor::id());
         Scheduler::for_each_runnable([](Thread& thread) -> IterationDecision {
-            dbgln("  {:3}/{:2} {:12} @ {:04x}:{:08x}",
-                thread.effective_priority(),
+            dbgln("  {:2} {:12} @ {:04x}:{:08x}",
                 thread.priority(),
                 thread.state_string(),
                 thread.tss().cs,

+ 0 - 2
Kernel/Thread.h

@@ -105,8 +105,6 @@ public:
     void set_priority(u32 p) { m_priority = p; }
     u32 priority() const { return m_priority; }
 
-    u32 effective_priority() const { return m_priority; }
-
     void detach()
     {
         ScopedSpinLock lock(m_lock);

+ 0 - 8
Userland/Applications/SystemMonitor/ProcessModel.cpp

@@ -102,8 +102,6 @@ String ProcessModel::column_name(int column) const
         return "User";
     case Column::Priority:
         return "Pr";
-    case Column::EffectivePriority:
-        return "EPr";
     case Column::Virtual:
         return "Virtual";
     case Column::Physical:
@@ -175,7 +173,6 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
         case Column::PGID:
         case Column::SID:
         case Column::Priority:
-        case Column::EffectivePriority:
         case Column::Virtual:
         case Column::Physical:
         case Column::DirtyPrivate:
@@ -223,8 +220,6 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
             return thread.current_state.user;
         case Column::Priority:
             return thread.current_state.priority;
-        case Column::EffectivePriority:
-            return thread.current_state.effective_priority;
         case Column::Virtual:
             return (int)thread.current_state.amount_virtual;
         case Column::Physical:
@@ -296,8 +291,6 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
             return thread.current_state.user;
         case Column::Priority:
             return thread.current_state.priority;
-        case Column::EffectivePriority:
-            return thread.current_state.effective_priority;
         case Column::Virtual:
             return pretty_byte_size(thread.current_state.amount_virtual);
         case Column::Physical:
@@ -398,7 +391,6 @@ void ProcessModel::update()
                 state.cpu = thread.cpu;
                 state.cpu_percent = 0;
                 state.priority = thread.priority;
-                state.effective_priority = thread.effective_priority;
                 state.state = thread.state;
                 sum_ticks_scheduled += thread.ticks_user + thread.ticks_kernel;
                 sum_ticks_scheduled_kernel += thread.ticks_kernel;

+ 0 - 2
Userland/Applications/SystemMonitor/ProcessModel.h

@@ -53,7 +53,6 @@ public:
         Processor,
         State,
         Priority,
-        EffectivePriority,
         User,
         PID,
         TID,
@@ -127,7 +126,6 @@ private:
         String veil;
         u32 cpu;
         u32 priority;
-        u32 effective_priority;
         size_t amount_virtual;
         size_t amount_resident;
         size_t amount_dirty_private;

+ 0 - 1
Userland/Libraries/LibCore/ProcessStatisticsReader.cpp

@@ -97,7 +97,6 @@ Optional<HashMap<pid_t, Core::ProcessStatistics>> ProcessStatisticsReader::get_a
             thread.ticks_kernel = thread_object.get("ticks_kernel").to_u32();
             thread.cpu = thread_object.get("cpu").to_u32();
             thread.priority = thread_object.get("priority").to_u32();
-            thread.effective_priority = thread_object.get("effective_priority").to_u32();
             thread.syscall_count = thread_object.get("syscall_count").to_u32();
             thread.inode_faults = thread_object.get("inode_faults").to_u32();
             thread.zero_faults = thread_object.get("zero_faults").to_u32();

+ 0 - 1
Userland/Libraries/LibCore/ProcessStatisticsReader.h

@@ -51,7 +51,6 @@ struct ThreadStatistics {
     String state;
     u32 cpu;
     u32 priority;
-    u32 effective_priority;
     String name;
 };
 

+ 6 - 0
Userland/Libraries/LibWeb/DOM/Node.cpp

@@ -183,6 +183,12 @@ RefPtr<Node> Node::append_child(NonnullRefPtr<Node> node, bool notify)
     return node;
 }
 
+RefPtr<Node> Node::remove_child(NonnullRefPtr<Node> node)
+{
+    TreeNode<Node>::remove_child(node);
+    return node;
+}
+
 RefPtr<Node> Node::insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool notify)
 {
     if (!child)

+ 1 - 0
Userland/Libraries/LibWeb/DOM/Node.h

@@ -82,6 +82,7 @@ public:
 
     RefPtr<Node> append_child(NonnullRefPtr<Node>, bool notify = true);
     RefPtr<Node> insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool notify = true);
+    RefPtr<Node> remove_child(NonnullRefPtr<Node>);
 
     virtual RefPtr<Layout::Node> create_layout_node();
 

+ 1 - 1
Userland/Libraries/LibWeb/DOM/Node.idl

@@ -11,6 +11,6 @@ interface Node : EventTarget {
 
     Node appendChild(Node node);
     Node insertBefore(Node node, Node? child);
-
+    Node removeChild(Node child);
 };