1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 02:58:12 +00:00

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.
This commit is contained in:
Andreas Kling 2021-01-28 08:25:05 +01:00
parent aaf691c4ef
commit b72f067f0d
10 changed files with 10 additions and 19 deletions

View file

@ -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());

View file

@ -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,

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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();

View file

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

View file

@ -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)

View file

@ -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();

View file

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