CachyOS / CachyOS/kernel-patches
Hunk failed on `kernel/sched/fair.c` of `sched/0001-prjc-cachy.patch` since kernel 7.2.1
- Dominant language
- No language data
- Stars
- 371
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
```Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/jqj2bnsrf02wxqk8w2hygjd95xk561h1-cachyos-7.2.2-1.tar.gz
source root is cachyos-7.2.2-1
setting SOURCE_DATE_EPOCH to timestamp 1787903670 of file "cachyos-7.2.2-1/virt/lib/irqbypass.c"
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
applying patch /nix/store/mnlqwys9dxznjcvq4w3s0435s9ql8qv8-bridge-stp-helper.patch
patching file net/bridge/br_private.h
Hunk #1 succeeded at 53 with fuzz 2 (offset 14 lines).
applying patch /nix/store/mbz5gln1q4swlzmqs2399br98qjif9kn-request-key-helper.patch
patching file security/keys/request_key.c
Hunk #1 succeeded at 117 (offset 3 lines).
applying patch /nix/store/hn3r9rvmw8ppw82mf7j48cml2r8v3rr7-kernel-patches-7.2-/sched/0001-prjc-cachy.patch
patching file include/linux/sched/topology.h
patching file init/Kconfig
patching file kernel/sched/ext/ext.c
patching file kernel/sched/fair.c
Hunk #3 succeeded at 8542 (offset 5 lines).
Hunk #4 succeeded at 8869 (offset 5 lines).
Hunk #5 succeeded at 8895 (offset 5 lines).
Hunk #6 succeeded at 8929 (offset 5 lines).
Hunk #7 succeeded at 8971 (offset 5 lines).
Hunk #8 succeeded at 8985 (offset 5 lines).
Hunk #9 succeeded at 8996 (offset 5 lines).
Hunk #10 succeeded at 9678 (offset 5 lines).
patching file kernel/sched/idle.c
patching file kernel/sched/poc_selector.c
patching file kernel/sched/sched.h
patching file kernel/sched/topology.c
patching file include/linux/cpuset.h
patching file include/linux/sched.h
patching file kernel/cgroup/cpuset.c
patching file kernel/sched/core.c
patching file kernel/sched/debug.c
patching file kernel/sched/fair.c
Hunk #27 FAILED at 4840.
Hunk #28 succeeded at 4972 (offset 5 lines).
Hunk #29 succeeded at 5092 (offset 5 lines).
Hunk #30 succeeded at 5117 (offset 5 lines).
Hunk #31 succeeded at 5137 (offset 5 lines).
Hunk #32 succeeded at 5552 (offset 5 lines).
Hunk #33 succeeded at 6090 (offset 5 lines).
Hunk #34 succeeded at 6097 (offset 5 lines).
Hunk #35 succeeded at 6105 (offset 5 lines).
Hunk #36 succeeded at 6165 (offset 5 lines).
Hunk #37 succeeded at 6225 (offset 5 lines).
Hunk #38 succeeded at 6260 (offset 5 lines).
Hunk #39 succeeded at 6275 (offset 5 lines).
Hunk #40 succeeded at 6294 (offset 5 lines).
Hunk #41 succeeded at 6319 (offset 5 lines).
Hunk #42 succeeded at 6352 (offset 5 lines).
Hunk #43 succeeded at 6408 (offset 5 lines).
Hunk #44 succeeded at 6424 (offset 5 lines).
Hunk #45 succeeded at 6439 (offset 5 lines).
Hunk #46 succeeded at 6456 (offset 5 lines).
Hunk #47 succeeded at 6485 (offset 5 lines).
Hunk #48 succeeded at 6521 (offset 5 lines).
Hunk #49 succeeded at 7082 (offset 5 lines).
Hunk #50 succeeded at 7417 (offset 5 lines).
Hunk #51 succeeded at 7789 (offset 5 lines).
Hunk #52 succeeded at 7889 (offset 5 lines).
Hunk #53 succeeded at 7904 (offset 5 lines).
Hunk #54 succeeded at 7925 (offset 5 lines).
Hunk #55 succeeded at 7943 (offset 5 lines).
Hunk #56 succeeded at 7958 (offset 5 lines).
Hunk #57 succeeded at 8039 (offset 5 lines).
Hunk #58 succeeded at 8149 (offset 5 lines).
Hunk #59 succeeded at 8167 (offset 5 lines).
Hunk #60 succeeded at 9766 (offset 5 lines).
Hunk #61 succeeded at 9812 (offset 5 lines).
Hunk #62 succeeded at 9843 (offset 5 lines).
Hunk #63 succeeded at 9896 (offset 5 lines).
Hunk #64 succeeded at 9933 (offset 5 lines).
Hunk #65 succeeded at 9961 (offset 5 lines).
Hunk #66 succeeded at 10006 (offset 5 lines).
Hunk #67 succeeded at 10036 (offset 5 lines).
Hunk #68 succeeded at 10099 (offset 5 lines).
Hunk #69 succeeded at 10109 (offset 5 lines).
Hunk #70 succeeded at 10128 (offset 5 lines).
Hunk #71 succeeded at 10136 (offset 5 lines).
Hunk #72 succeeded at 10178 (offset 5 lines).
Hunk #73 succeeded at 10521 (offset 5 lines).
Hunk #74 succeeded at 11312 (offset 5 lines).
Hunk #75 succeeded at 14707 (offset 5 lines).
Hunk #76 succeeded at 14916 (offset 5 lines).
Hunk #77 succeeded at 14978 (offset 5 lines).
Hunk #78 succeeded at 15022 (offset 5 lines).
Hunk #79 succeeded at 15151 (offset 5 lines).
Hunk #80 succeeded at 15290 (offset 5 lines).
1 out of 80 hunks FAILED -- saving rejects to file kernel/sched/fair.c.rej
patching file kernel/sched/pelt.c
patching file kernel/sched/sched.h
patching file Documentation/admin-guide/sysctl/kernel.rst
patching file Documentation/scheduler/sched-BMQ.txt
patching file fs/f2fs/checkpoint.c
patching file fs/proc/base.c
patching file include/linux/rseq_entry.h
patching file include/linux/sched.h
Hunk #6 succeeded at 1724 (offset 8 lines).
Hunk #7 succeeded at 2336 (offset 8 lines).
Hunk #8 succeeded at 2484 (offset 8 lines).
Hunk #9 succeeded at 2526 (offset 8 lines).
Hunk #10 succeeded at 2563 (offset 8 lines).
patching file include/linux/sched/deadline.h
patching file include/linux/sched/prio.h
patching file include/linux/sched/rt.h
patching file include/linux/sched/topology.h
patching file init/Kconfig
patching file init/init_task.c
patching file kernel/Kconfig.preempt
patching file kernel/cgroup/cpuset.c
patching file kernel/delayacct.c
patching file kernel/exit.c
patching file kernel/locking/rtmutex.c
patching file kernel/locking/ww_mutex.h
patching file kernel/sched/Makefile
patching file kernel/sched/alt_core.c
patching file kernel/sched/alt_core.h
patching file kernel/sched/alt_debug.c
patching file kernel/sched/alt_sched.h
patching file kernel/sched/alt_topology.c
patching file kernel/sched/alt_topology.h
patching file kernel/sched/bmq.h
patching file kernel/sched/build_policy.c
patching file kernel/sched/build_utility.c
patching file kernel/sched/cpufreq_schedutil.c
patching file kernel/sched/cputime.c
patching file kernel/sched/debug.c
patching file kernel/sched/idle.c
patching file kernel/sched/pds.h
patching file kernel/sched/pelt.c
patching file kernel/sched/pelt.h
patching file kernel/sched/sched.h
patching file kernel/sched/stats.c
patching file kernel/sched/stats.h
patching file kernel/sched/syscalls.c
patching file kernel/sched/topology.c
patching file kernel/sysctl.c
patching file kernel/time/posix-cpu-timers.c
patching file kernel/trace/trace_osnoise.c
patching file kernel/trace/trace_selftest.c
patching file kernel/workqueue.c
```
```sh
git clone https://github.com/CachyOS/linux
git diff cachyos-7.2.{0,1}-1 kernel/sched/fair.c
```
```diff
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c4d098bdb..adac9be87 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4871,7 +4871,12 @@ static int tg_cpus(struct task_group *tg)
nr = cpuset_num_cpus(cgrp);
}
- return nr;
+ /*
+ * An empty cpuset would propagate a 0 shares_max into
+ * __calc_smp_shares(), where clamp() yields hi when hi < lo and so
+ * defeats the MIN_SHARES floor. Match tg_tasks(), which floors at 1.
+ */
+ return max(nr, 1);
}
static inline int tg_tasks(struct task_group *tg)
```
https://github.com/CachyOS/linux/blob/bd3b950c5b0f3f388177cc9368eaae556188cfa0/kernel/sched/fair.c#L4874
https://github.com/CachyOS/linux/blob/064853d58af34207d836770692f426292a34957f/kernel/sched/fair.c#L4874-L4879
It was changed in https://github.com/CachyOS/linux/commit/d286c785c4c385e10eb1c8c440a6a0c4496a73ad, but the patch didn't update: https://github.com/CachyOS/kernel-patches/blob/a40b85abdcb9f4ba653e2e1ea89d3d1f0cf563ba/7.2/sched/0001-prjc-cachy.patch#L3256-L3273
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the patch phase for cachyos-7.2.2-1 and inspect kernel/sched/fair.c around the failed hunk. Compare that context with sched/0001-prjc-cachy.patch and the referenced CachyOS kernel change, then update the patch so the hunk applies cleanly. Done means the full patch phase completes without a reject file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100