summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-28 08:25:05 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-28 08:25:53 +0100
commitb72f067f0daac88ebe66e3f714e517b995b48e7b (patch)
treea7a124e831ef9ec537f71614e3957f2b580735fa
parentaaf691c4efc1e43e83f13cdf403f69d89f889d38 (diff)
downloadserenity-b72f067f0daac88ebe66e3f714e517b995b48e7b.zip
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.
-rw-r--r--Kernel/FileSystem/ProcFS.cpp1
-rw-r--r--Kernel/Scheduler.cpp5
-rw-r--r--Kernel/Thread.h2
-rw-r--r--Userland/Applications/SystemMonitor/ProcessModel.cpp8
-rw-r--r--Userland/Applications/SystemMonitor/ProcessModel.h2
-rw-r--r--Userland/Libraries/LibCore/ProcessStatisticsReader.cpp1
-rw-r--r--Userland/Libraries/LibCore/ProcessStatisticsReader.h1
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.cpp6
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.h1
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.idl2
10 files changed, 10 insertions, 19 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp
index 9e5fe17c37..2ed82dffd8 100644
--- a/Kernel/FileSystem/ProcFS.cpp
+++ b/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());
diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp
index f4823f443c..54576f40a0 100644
--- a/Kernel/Scheduler.cpp
+++ b/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,
diff --git a/Kernel/Thread.h b/Kernel/Thread.h
index 11605fe6b8..1cd6e182ba 100644
--- a/Kernel/Thread.h
+++ b/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);
diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp
index 2c2c9a2d5c..d8eb125efe 100644
--- a/Userland/Applications/SystemMonitor/ProcessModel.cpp
+++ b/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;
diff --git a/Userland/Applications/SystemMonitor/ProcessModel.h b/Userland/Applications/SystemMonitor/ProcessModel.h
index 11f39cac76..a7db7aebca 100644
--- a/Userland/Applications/SystemMonitor/ProcessModel.h
+++ b/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;
diff --git a/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp b/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp
index 566053d3af..69a723eab2 100644
--- a/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp
+++ b/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();
diff --git a/Userland/Libraries/LibCore/ProcessStatisticsReader.h b/Userland/Libraries/LibCore/ProcessStatisticsReader.h
index b6e506cd9d..9c574229c7 100644
--- a/Userland/Libraries/LibCore/ProcessStatisticsReader.h
+++ b/Userland/Libraries/LibCore/ProcessStatisticsReader.h
@@ -51,7 +51,6 @@ struct ThreadStatistics {
String state;
u32 cpu;
u32 priority;
- u32 effective_priority;
String name;
};
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp
index ea26fbd761..ce2d864514 100644
--- a/Userland/Libraries/LibWeb/DOM/Node.cpp
+++ b/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)
diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h
index d29f0a471f..a62c220fe1 100644
--- a/Userland/Libraries/LibWeb/DOM/Node.h
+++ b/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();
diff --git a/Userland/Libraries/LibWeb/DOM/Node.idl b/Userland/Libraries/LibWeb/DOM/Node.idl
index 2ba27688e6..3165b3131d 100644
--- a/Userland/Libraries/LibWeb/DOM/Node.idl
+++ b/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);
};