Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched_ext: Drop "ops" from scx_ops_exit(), scx_ops_error() and friends

The tag "ops" is used for two different purposes. First, to indicate that
the entity is directly related to the operations such as flags carried in
sched_ext_ops. Second, to indicate that the entity applies to something
global such as enable or bypass states. The second usage is historical and
causes confusion rather than clarifying anything. For example,
scx_ops_enable_state enums are named SCX_OPS_* and thus conflict with
scx_ops_flags. Let's drop the second usages.

Drop "ops" from scx_ops_exit(), scx_ops_error() and friends.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Andrea Righi <arighi@nvidia.com>

+93 -102
+83 -92
kernel/sched/ext.c
··· 44 44 }; 45 45 46 46 /* 47 - * An exit code can be specified when exiting with scx_bpf_exit() or 48 - * scx_ops_exit(), corresponding to exit_kind UNREG_BPF and UNREG_KERN 49 - * respectively. The codes are 64bit of the format: 47 + * An exit code can be specified when exiting with scx_bpf_exit() or scx_exit(), 48 + * corresponding to exit_kind UNREG_BPF and UNREG_KERN respectively. The codes 49 + * are 64bit of the format: 50 50 * 51 51 * Bits: [63 .. 48 47 .. 32 31 .. 0] 52 52 * [ SYS ACT ] [ SYS RSN ] [ USR ] ··· 947 947 /* 948 948 * The maximum amount of time in jiffies that a task may be runnable without 949 949 * being scheduled on a CPU. If this timeout is exceeded, it will trigger 950 - * scx_ops_error(). 950 + * scx_error(). 951 951 */ 952 952 static unsigned long scx_watchdog_timeout; 953 953 ··· 1043 1043 1044 1044 static void process_ddsp_deferred_locals(struct rq *rq); 1045 1045 static void scx_bpf_kick_cpu(s32 cpu, u64 flags); 1046 - static __printf(3, 4) void scx_ops_exit_kind(enum scx_exit_kind kind, 1047 - s64 exit_code, 1048 - const char *fmt, ...); 1046 + static __printf(3, 4) void __scx_exit(enum scx_exit_kind kind, s64 exit_code, 1047 + const char *fmt, ...); 1049 1048 1050 - #define scx_ops_error_kind(err, fmt, args...) \ 1051 - scx_ops_exit_kind((err), 0, fmt, ##args) 1049 + #define __scx_error(err, fmt, args...) \ 1050 + __scx_exit((err), 0, fmt, ##args) 1052 1051 1053 - #define scx_ops_exit(code, fmt, args...) \ 1054 - scx_ops_exit_kind(SCX_EXIT_UNREG_KERN, (code), fmt, ##args) 1052 + #define scx_exit(code, fmt, args...) \ 1053 + __scx_exit(SCX_EXIT_UNREG_KERN, (code), fmt, ##args) 1055 1054 1056 - #define scx_ops_error(fmt, args...) \ 1057 - scx_ops_error_kind(SCX_EXIT_ERROR, fmt, ##args) 1055 + #define scx_error(fmt, args...) \ 1056 + __scx_error(SCX_EXIT_ERROR, fmt, ##args) 1058 1057 1059 1058 #define SCX_HAS_OP(op) static_branch_likely(&scx_has_op[SCX_OP_IDX(op)]) 1060 1059 ··· 1186 1187 static __always_inline bool scx_kf_allowed(u32 mask) 1187 1188 { 1188 1189 if (unlikely(!(current->scx.kf_mask & mask))) { 1189 - scx_ops_error("kfunc with mask 0x%x called from an operation only allowing 0x%x", 1190 - mask, current->scx.kf_mask); 1190 + scx_error("kfunc with mask 0x%x called from an operation only allowing 0x%x", 1191 + mask, current->scx.kf_mask); 1191 1192 return false; 1192 1193 } 1193 1194 ··· 1200 1201 */ 1201 1202 if (unlikely(highest_bit(mask) == SCX_KF_CPU_RELEASE && 1202 1203 (current->scx.kf_mask & higher_bits(SCX_KF_CPU_RELEASE)))) { 1203 - scx_ops_error("cpu_release kfunc called from a nested operation"); 1204 + scx_error("cpu_release kfunc called from a nested operation"); 1204 1205 return false; 1205 1206 } 1206 1207 1207 1208 if (unlikely(highest_bit(mask) == SCX_KF_DISPATCH && 1208 1209 (current->scx.kf_mask & higher_bits(SCX_KF_DISPATCH)))) { 1209 - scx_ops_error("dispatch kfunc called from a nested operation"); 1210 + scx_error("dispatch kfunc called from a nested operation"); 1210 1211 return false; 1211 1212 } 1212 1213 ··· 1222 1223 1223 1224 if (unlikely((p != current->scx.kf_tasks[0] && 1224 1225 p != current->scx.kf_tasks[1]))) { 1225 - scx_ops_error("called on a task not being operated on"); 1226 + scx_error("called on a task not being operated on"); 1226 1227 return false; 1227 1228 } 1228 1229 ··· 1645 1646 if (likely(cpu >= 0 && cpu < nr_cpu_ids && cpu_possible(cpu))) { 1646 1647 return true; 1647 1648 } else { 1648 - scx_ops_error("invalid CPU %d%s%s", cpu, 1649 - where ? " " : "", where ?: ""); 1649 + scx_error("invalid CPU %d%s%s", cpu, where ? " " : "", where ?: ""); 1650 1650 return false; 1651 1651 } 1652 1652 } ··· 1655 1657 * @ops_name: operation to blame on failure 1656 1658 * @err: -errno value to sanitize 1657 1659 * 1658 - * Verify @err is a valid -errno. If not, trigger scx_ops_error() and return 1660 + * Verify @err is a valid -errno. If not, trigger scx_error() and return 1659 1661 * -%EPROTO. This is necessary because returning a rogue -errno up the chain can 1660 1662 * cause misbehaviors. For an example, a large negative return from 1661 1663 * ops.init_task() triggers an oops when passed up the call chain because the ··· 1667 1669 if (err < 0 && err >= -MAX_ERRNO) 1668 1670 return err; 1669 1671 1670 - scx_ops_error("ops.%s() returned an invalid errno %d", ops_name, err); 1672 + scx_error("ops.%s() returned an invalid errno %d", ops_name, err); 1671 1673 return -EPROTO; 1672 1674 } 1673 1675 ··· 1824 1826 if (!is_local) { 1825 1827 raw_spin_lock(&dsq->lock); 1826 1828 if (unlikely(dsq->id == SCX_DSQ_INVALID)) { 1827 - scx_ops_error("attempting to dispatch to a destroyed dsq"); 1829 + scx_error("attempting to dispatch to a destroyed dsq"); 1828 1830 /* fall back to the global dsq */ 1829 1831 raw_spin_unlock(&dsq->lock); 1830 1832 dsq = find_global_dsq(p); ··· 1841 1843 * disallow any internal DSQ from doing vtime ordering of 1842 1844 * tasks. 1843 1845 */ 1844 - scx_ops_error("cannot use vtime ordering for built-in DSQs"); 1846 + scx_error("cannot use vtime ordering for built-in DSQs"); 1845 1847 enq_flags &= ~SCX_ENQ_DSQ_PRIQ; 1846 1848 } 1847 1849 ··· 1855 1857 */ 1856 1858 if (unlikely(RB_EMPTY_ROOT(&dsq->priq) && 1857 1859 nldsq_next_task(dsq, NULL, false))) 1858 - scx_ops_error("DSQ ID 0x%016llx already had FIFO-enqueued tasks", 1859 - dsq->id); 1860 + scx_error("DSQ ID 0x%016llx already had FIFO-enqueued tasks", 1861 + dsq->id); 1860 1862 1861 1863 p->scx.dsq_flags |= SCX_TASK_DSQ_ON_PRIQ; 1862 1864 rb_add(&p->scx.dsq_priq, &dsq->priq, scx_dsq_priq_less); ··· 1877 1879 } else { 1878 1880 /* a FIFO DSQ shouldn't be using PRIQ enqueuing */ 1879 1881 if (unlikely(!RB_EMPTY_ROOT(&dsq->priq))) 1880 - scx_ops_error("DSQ ID 0x%016llx already had PRIQ-enqueued tasks", 1881 - dsq->id); 1882 + scx_error("DSQ ID 0x%016llx already had PRIQ-enqueued tasks", 1883 + dsq->id); 1882 1884 1883 1885 if (enq_flags & (SCX_ENQ_HEAD | SCX_ENQ_PREEMPT)) 1884 1886 list_add(&p->scx.dsq_list.node, &dsq->list); ··· 2016 2018 dsq = find_user_dsq(dsq_id); 2017 2019 2018 2020 if (unlikely(!dsq)) { 2019 - scx_ops_error("non-existent DSQ 0x%llx for %s[%d]", 2020 - dsq_id, p->comm, p->pid); 2021 + scx_error("non-existent DSQ 0x%llx for %s[%d]", 2022 + dsq_id, p->comm, p->pid); 2021 2023 return find_global_dsq(p); 2022 2024 } 2023 2025 ··· 2038 2040 /* @p must match the task on the enqueue path */ 2039 2041 if (unlikely(p != ddsp_task)) { 2040 2042 if (IS_ERR(ddsp_task)) 2041 - scx_ops_error("%s[%d] already direct-dispatched", 2042 - p->comm, p->pid); 2043 + scx_error("%s[%d] already direct-dispatched", 2044 + p->comm, p->pid); 2043 2045 else 2044 - scx_ops_error("scheduling for %s[%d] but trying to direct-dispatch %s[%d]", 2045 - ddsp_task->comm, ddsp_task->pid, 2046 - p->comm, p->pid); 2046 + scx_error("scheduling for %s[%d] but trying to direct-dispatch %s[%d]", 2047 + ddsp_task->comm, ddsp_task->pid, 2048 + p->comm, p->pid); 2047 2049 return; 2048 2050 } 2049 2051 ··· 2485 2487 */ 2486 2488 if (unlikely(is_migration_disabled(p))) { 2487 2489 if (enforce) 2488 - scx_ops_error("SCX_DSQ_LOCAL[_ON] cannot move migration disabled %s[%d] from CPU %d to %d", 2489 - p->comm, p->pid, task_cpu(p), cpu); 2490 + scx_error("SCX_DSQ_LOCAL[_ON] cannot move migration disabled %s[%d] from CPU %d to %d", 2491 + p->comm, p->pid, task_cpu(p), cpu); 2490 2492 return false; 2491 2493 } 2492 2494 ··· 2498 2500 */ 2499 2501 if (!task_allowed_on_cpu(p, cpu)) { 2500 2502 if (enforce) 2501 - scx_ops_error("SCX_DSQ_LOCAL[_ON] target CPU %d not allowed for %s[%d]", 2502 - cpu, p->comm, p->pid); 2503 + scx_error("SCX_DSQ_LOCAL[_ON] target CPU %d not allowed for %s[%d]", 2504 + cpu, p->comm, p->pid); 2503 2505 return false; 2504 2506 } 2505 2507 ··· 3445 3447 else if (!online && SCX_HAS_OP(cpu_offline)) 3446 3448 SCX_CALL_OP(SCX_KF_UNLOCKED, cpu_offline, cpu); 3447 3449 else 3448 - scx_ops_exit(SCX_ECODE_ACT_RESTART | SCX_ECODE_RSN_HOTPLUG, 3449 - "cpu %d going %s, exiting scheduler", cpu, 3450 - online ? "online" : "offline"); 3450 + scx_exit(SCX_ECODE_ACT_RESTART | SCX_ECODE_RSN_HOTPLUG, 3451 + "cpu %d going %s, exiting scheduler", cpu, 3452 + online ? "online" : "offline"); 3451 3453 } 3452 3454 3453 3455 void scx_rq_activate(struct rq *rq) ··· 3486 3488 last_runnable + scx_watchdog_timeout))) { 3487 3489 u32 dur_ms = jiffies_to_msecs(jiffies - last_runnable); 3488 3490 3489 - scx_ops_error_kind(SCX_EXIT_ERROR_STALL, 3490 - "%s[%d] failed to run for %u.%03us", 3491 - p->comm, p->pid, 3492 - dur_ms / 1000, dur_ms % 1000); 3491 + __scx_error(SCX_EXIT_ERROR_STALL, 3492 + "%s[%d] failed to run for %u.%03us", 3493 + p->comm, p->pid, dur_ms / 1000, dur_ms % 1000); 3493 3494 timed_out = true; 3494 3495 break; 3495 3496 } ··· 3526 3529 last_check + READ_ONCE(scx_watchdog_timeout)))) { 3527 3530 u32 dur_ms = jiffies_to_msecs(jiffies - last_check); 3528 3531 3529 - scx_ops_error_kind(SCX_EXIT_ERROR_STALL, 3530 - "watchdog failed to check in for %u.%03us", 3531 - dur_ms / 1000, dur_ms % 1000); 3532 + __scx_error(SCX_EXIT_ERROR_STALL, 3533 + "watchdog failed to check in for %u.%03us", 3534 + dur_ms / 1000, dur_ms % 1000); 3532 3535 } 3533 3536 3534 3537 update_other_load_avgs(rq); ··· 3653 3656 3654 3657 task_rq_unlock(rq, p, &rf); 3655 3658 } else if (p->policy == SCHED_EXT) { 3656 - scx_ops_error("ops.init_task() set task->scx.disallow for %s[%d] during fork", 3657 - p->comm, p->pid); 3659 + scx_error("ops.init_task() set task->scx.disallow for %s[%d] during fork", 3660 + p->comm, p->pid); 3658 3661 } 3659 3662 } 3660 3663 ··· 4200 4203 raw_spin_lock_irqsave(&dsq->lock, flags); 4201 4204 4202 4205 if (dsq->nr) { 4203 - scx_ops_error("attempting to destroy in-use dsq 0x%016llx (nr=%u)", 4204 - dsq->id, dsq->nr); 4206 + scx_error("attempting to destroy in-use dsq 0x%016llx (nr=%u)", 4207 + dsq->id, dsq->nr); 4205 4208 goto out_unlock_dsq; 4206 4209 } 4207 4210 ··· 4299 4302 css->cgroup, &args); 4300 4303 if (ret) { 4301 4304 css_put(css); 4302 - scx_ops_error("ops.cgroup_init() failed (%d)", ret); 4305 + scx_error("ops.cgroup_init() failed (%d)", ret); 4303 4306 return ret; 4304 4307 } 4305 4308 tg->scx_flags |= SCX_TG_INITED; ··· 4483 4486 */ 4484 4487 atomic_inc(&scx_breather_depth); 4485 4488 4486 - scx_ops_error("soft lockup - CPU#%d stuck for %us", 4487 - smp_processor_id(), dur_s); 4489 + scx_error("soft lockup - CPU#%d stuck for %us", smp_processor_id(), dur_s); 4488 4490 } 4489 4491 4490 4492 static void scx_clear_softlockup(void) ··· 5149 5153 spin_unlock_irqrestore(&dump_lock, flags); 5150 5154 } 5151 5155 5152 - static void scx_ops_error_irq_workfn(struct irq_work *irq_work) 5156 + static void scx_error_irq_workfn(struct irq_work *irq_work) 5153 5157 { 5154 5158 struct scx_exit_info *ei = scx_exit_info; 5155 5159 ··· 5159 5163 schedule_scx_ops_disable_work(); 5160 5164 } 5161 5165 5162 - static DEFINE_IRQ_WORK(scx_ops_error_irq_work, scx_ops_error_irq_workfn); 5166 + static DEFINE_IRQ_WORK(scx_error_irq_work, scx_error_irq_workfn); 5163 5167 5164 - static __printf(3, 4) void scx_ops_exit_kind(enum scx_exit_kind kind, 5165 - s64 exit_code, 5166 - const char *fmt, ...) 5168 + static __printf(3, 4) void __scx_exit(enum scx_exit_kind kind, s64 exit_code, 5169 + const char *fmt, ...) 5167 5170 { 5168 5171 struct scx_exit_info *ei = scx_exit_info; 5169 5172 int none = SCX_EXIT_NONE; ··· 5187 5192 ei->kind = kind; 5188 5193 ei->reason = scx_exit_reason(ei->kind); 5189 5194 5190 - irq_work_queue(&scx_ops_error_irq_work); 5195 + irq_work_queue(&scx_error_irq_work); 5191 5196 } 5192 5197 5193 5198 static struct kthread_worker *scx_create_rt_helper(const char *name) ··· 5212 5217 if (ops->hotplug_seq) { 5213 5218 global_hotplug_seq = atomic_long_read(&scx_hotplug_seq); 5214 5219 if (ops->hotplug_seq != global_hotplug_seq) { 5215 - scx_ops_exit(SCX_ECODE_ACT_RESTART | SCX_ECODE_RSN_HOTPLUG, 5216 - "expected hotplug seq %llu did not match actual %llu", 5217 - ops->hotplug_seq, global_hotplug_seq); 5220 + scx_exit(SCX_ECODE_ACT_RESTART | SCX_ECODE_RSN_HOTPLUG, 5221 + "expected hotplug seq %llu did not match actual %llu", 5222 + ops->hotplug_seq, global_hotplug_seq); 5218 5223 } 5219 5224 } 5220 5225 } ··· 5226 5231 * ops.enqueue() callback isn't implemented. 5227 5232 */ 5228 5233 if ((ops->flags & SCX_OPS_ENQ_LAST) && !ops->enqueue) { 5229 - scx_ops_error("SCX_OPS_ENQ_LAST requires ops.enqueue() to be implemented"); 5234 + scx_error("SCX_OPS_ENQ_LAST requires ops.enqueue() to be implemented"); 5230 5235 return -EINVAL; 5231 5236 } 5232 5237 ··· 5236 5241 */ 5237 5242 if ((ops->flags & SCX_OPS_BUILTIN_IDLE_PER_NODE) && 5238 5243 (ops->update_idle && !(ops->flags & SCX_OPS_KEEP_BUILTIN_IDLE))) { 5239 - scx_ops_error("SCX_OPS_BUILTIN_IDLE_PER_NODE requires CPU idle selection enabled"); 5244 + scx_error("SCX_OPS_BUILTIN_IDLE_PER_NODE requires CPU idle selection enabled"); 5240 5245 return -EINVAL; 5241 5246 } 5242 5247 ··· 5354 5359 if (ret) { 5355 5360 ret = ops_sanitize_err("init", ret); 5356 5361 cpus_read_unlock(); 5357 - scx_ops_error("ops.init() failed (%d)", ret); 5362 + scx_error("ops.init() failed (%d)", ret); 5358 5363 goto err_disable; 5359 5364 } 5360 5365 } ··· 5459 5464 put_task_struct(p); 5460 5465 scx_task_iter_relock(&sti); 5461 5466 scx_task_iter_stop(&sti); 5462 - scx_ops_error("ops.init_task() failed (%d) for %s[%d]", 5463 - ret, p->comm, p->pid); 5467 + scx_error("ops.init_task() failed (%d) for %s[%d]", 5468 + ret, p->comm, p->pid); 5464 5469 goto err_disable_unlock_all; 5465 5470 } 5466 5471 ··· 5549 5554 mutex_unlock(&scx_enable_mutex); 5550 5555 /* 5551 5556 * Returning an error code here would not pass all the error information 5552 - * to userspace. Record errno using scx_ops_error() for cases 5553 - * scx_ops_error() wasn't already invoked and exit indicating success so 5554 - * that the error is notified through ops.exit() with all the details. 5557 + * to userspace. Record errno using scx_error() for cases scx_error() 5558 + * wasn't already invoked and exit indicating success so that the error 5559 + * is notified through ops.exit() with all the details. 5555 5560 * 5556 5561 * Flush scx_ops_disable_work to ensure that error is reported before 5557 5562 * init completion. 5558 5563 */ 5559 - scx_ops_error("scx_ops_enable() failed (%d)", ret); 5564 + scx_error("scx_ops_enable() failed (%d)", ret); 5560 5565 kthread_flush_work(&scx_ops_disable_work); 5561 5566 return 0; 5562 5567 } ··· 6095 6100 lockdep_assert_irqs_disabled(); 6096 6101 6097 6102 if (unlikely(!p)) { 6098 - scx_ops_error("called with NULL task"); 6103 + scx_error("called with NULL task"); 6099 6104 return false; 6100 6105 } 6101 6106 6102 6107 if (unlikely(enq_flags & __SCX_ENQ_INTERNAL_MASK)) { 6103 - scx_ops_error("invalid enq_flags 0x%llx", enq_flags); 6108 + scx_error("invalid enq_flags 0x%llx", enq_flags); 6104 6109 return false; 6105 6110 } 6106 6111 ··· 6120 6125 } 6121 6126 6122 6127 if (unlikely(dspc->cursor >= scx_dsp_max_batch)) { 6123 - scx_ops_error("dispatch buffer overflow"); 6128 + scx_error("dispatch buffer overflow"); 6124 6129 return; 6125 6130 } 6126 6131 ··· 6365 6370 if (dspc->cursor > 0) 6366 6371 dspc->cursor--; 6367 6372 else 6368 - scx_ops_error("dispatch buffer underflow"); 6373 + scx_error("dispatch buffer underflow"); 6369 6374 } 6370 6375 6371 6376 /** ··· 6394 6399 6395 6400 dsq = find_user_dsq(dsq_id); 6396 6401 if (unlikely(!dsq)) { 6397 - scx_ops_error("invalid DSQ ID 0x%016llx", dsq_id); 6402 + scx_error("invalid DSQ ID 0x%016llx", dsq_id); 6398 6403 return false; 6399 6404 } 6400 6405 ··· 6718 6723 struct rq *target_rq = cpu_rq(cpu); 6719 6724 6720 6725 if (unlikely(flags & (SCX_KICK_PREEMPT | SCX_KICK_WAIT))) 6721 - scx_ops_error("PREEMPT/WAIT cannot be used with SCX_KICK_IDLE"); 6726 + scx_error("PREEMPT/WAIT cannot be used with SCX_KICK_IDLE"); 6722 6727 6723 6728 if (raw_spin_rq_trylock(target_rq)) { 6724 6729 if (can_skip_idle_kick(target_rq)) { ··· 6906 6911 6907 6912 if (data__sz % 8 || data__sz > MAX_BPRINTF_VARARGS * 8 || 6908 6913 (data__sz && !data)) { 6909 - scx_ops_error("invalid data=%p and data__sz=%u", 6910 - (void *)data, data__sz); 6914 + scx_error("invalid data=%p and data__sz=%u", (void *)data, data__sz); 6911 6915 return -EINVAL; 6912 6916 } 6913 6917 6914 6918 ret = copy_from_kernel_nofault(data_buf, data, data__sz); 6915 6919 if (ret < 0) { 6916 - scx_ops_error("failed to read data fields (%d)", ret); 6920 + scx_error("failed to read data fields (%d)", ret); 6917 6921 return ret; 6918 6922 } 6919 6923 6920 6924 ret = bpf_bprintf_prepare(fmt, UINT_MAX, data_buf, data__sz / 8, 6921 6925 &bprintf_data); 6922 6926 if (ret < 0) { 6923 - scx_ops_error("format preparation failed (%d)", ret); 6927 + scx_error("format preparation failed (%d)", ret); 6924 6928 return ret; 6925 6929 } 6926 6930 ··· 6927 6933 bprintf_data.bin_args); 6928 6934 bpf_bprintf_cleanup(&bprintf_data); 6929 6935 if (ret < 0) { 6930 - scx_ops_error("(\"%s\", %p, %u) failed to format", 6931 - fmt, data, data__sz); 6936 + scx_error("(\"%s\", %p, %u) failed to format", fmt, data, data__sz); 6932 6937 return ret; 6933 6938 } 6934 6939 ··· 6960 6967 6961 6968 raw_spin_lock_irqsave(&scx_exit_bstr_buf_lock, flags); 6962 6969 if (bstr_format(&scx_exit_bstr_buf, fmt, data, data__sz) >= 0) 6963 - scx_ops_exit_kind(SCX_EXIT_UNREG_BPF, exit_code, "%s", 6964 - scx_exit_bstr_buf.line); 6970 + __scx_exit(SCX_EXIT_UNREG_BPF, exit_code, "%s", scx_exit_bstr_buf.line); 6965 6971 raw_spin_unlock_irqrestore(&scx_exit_bstr_buf_lock, flags); 6966 6972 } 6967 6973 ··· 6980 6988 6981 6989 raw_spin_lock_irqsave(&scx_exit_bstr_buf_lock, flags); 6982 6990 if (bstr_format(&scx_exit_bstr_buf, fmt, data, data__sz) >= 0) 6983 - scx_ops_exit_kind(SCX_EXIT_ERROR_BPF, 0, "%s", 6984 - scx_exit_bstr_buf.line); 6991 + __scx_exit(SCX_EXIT_ERROR_BPF, 0, "%s", scx_exit_bstr_buf.line); 6985 6992 raw_spin_unlock_irqrestore(&scx_exit_bstr_buf_lock, flags); 6986 6993 } 6987 6994 ··· 7004 7013 s32 ret; 7005 7014 7006 7015 if (raw_smp_processor_id() != dd->cpu) { 7007 - scx_ops_error("scx_bpf_dump() must only be called from ops.dump() and friends"); 7016 + scx_error("scx_bpf_dump() must only be called from ops.dump() and friends"); 7008 7017 return; 7009 7018 } 7010 7019 ··· 7090 7099 __bpf_kfunc void scx_bpf_cpuperf_set(s32 cpu, u32 perf) 7091 7100 { 7092 7101 if (unlikely(perf > SCX_CPUPERF_ONE)) { 7093 - scx_ops_error("Invalid cpuperf target %u for CPU %d", perf, cpu); 7102 + scx_error("Invalid cpuperf target %u for CPU %d", perf, cpu); 7094 7103 return; 7095 7104 } 7096 7105
+10 -10
kernel/sched/ext_idle.c
··· 748 748 static int validate_node(int node) 749 749 { 750 750 if (!static_branch_likely(&scx_builtin_idle_per_node)) { 751 - scx_ops_error("per-node idle tracking is disabled"); 751 + scx_error("per-node idle tracking is disabled"); 752 752 return -EOPNOTSUPP; 753 753 } 754 754 ··· 758 758 759 759 /* Make sure node is in a valid range */ 760 760 if (node < 0 || node >= nr_node_ids) { 761 - scx_ops_error("invalid node %d", node); 761 + scx_error("invalid node %d", node); 762 762 return -EINVAL; 763 763 } 764 764 765 765 /* Make sure the node is part of the set of possible nodes */ 766 766 if (!node_possible(node)) { 767 - scx_ops_error("unavailable node %d", node); 767 + scx_error("unavailable node %d", node); 768 768 return -EINVAL; 769 769 } 770 770 ··· 778 778 if (static_branch_likely(&scx_builtin_idle_enabled)) 779 779 return true; 780 780 781 - scx_ops_error("built-in idle tracking is disabled"); 781 + scx_error("built-in idle tracking is disabled"); 782 782 return false; 783 783 } 784 784 ··· 848 848 * 849 849 * Returns an empty cpumask if idle tracking is not enabled, if @node is 850 850 * not valid, or running on a UP kernel. In this case the actual error will 851 - * be reported to the BPF scheduler via scx_ops_error(). 851 + * be reported to the BPF scheduler via scx_error(). 852 852 */ 853 853 __bpf_kfunc const struct cpumask *scx_bpf_get_idle_cpumask_node(int node) 854 854 { ··· 873 873 __bpf_kfunc const struct cpumask *scx_bpf_get_idle_cpumask(void) 874 874 { 875 875 if (static_branch_unlikely(&scx_builtin_idle_per_node)) { 876 - scx_ops_error("SCX_OPS_BUILTIN_IDLE_PER_NODE enabled"); 876 + scx_error("SCX_OPS_BUILTIN_IDLE_PER_NODE enabled"); 877 877 return cpu_none_mask; 878 878 } 879 879 ··· 895 895 * 896 896 * Returns an empty cpumask if idle tracking is not enabled, if @node is 897 897 * not valid, or running on a UP kernel. In this case the actual error will 898 - * be reported to the BPF scheduler via scx_ops_error(). 898 + * be reported to the BPF scheduler via scx_error(). 899 899 */ 900 900 __bpf_kfunc const struct cpumask *scx_bpf_get_idle_smtmask_node(int node) 901 901 { ··· 924 924 __bpf_kfunc const struct cpumask *scx_bpf_get_idle_smtmask(void) 925 925 { 926 926 if (static_branch_unlikely(&scx_builtin_idle_per_node)) { 927 - scx_ops_error("SCX_OPS_BUILTIN_IDLE_PER_NODE enabled"); 927 + scx_error("SCX_OPS_BUILTIN_IDLE_PER_NODE enabled"); 928 928 return cpu_none_mask; 929 929 } 930 930 ··· 1032 1032 u64 flags) 1033 1033 { 1034 1034 if (static_branch_maybe(CONFIG_NUMA, &scx_builtin_idle_per_node)) { 1035 - scx_ops_error("per-node idle tracking is enabled"); 1035 + scx_error("per-node idle tracking is enabled"); 1036 1036 return -EBUSY; 1037 1037 } 1038 1038 ··· 1109 1109 s32 cpu; 1110 1110 1111 1111 if (static_branch_maybe(CONFIG_NUMA, &scx_builtin_idle_per_node)) { 1112 - scx_ops_error("per-node idle tracking is enabled"); 1112 + scx_error("per-node idle tracking is enabled"); 1113 1113 return -EBUSY; 1114 1114 } 1115 1115