Skip to content

Hunk failed on kernel/sched/fair.c of sched/0001-prjc-cachy.patch since kernel 7.2.1 #179

Description

@n0099
@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
git clone https://github.com/CachyOS/linux
git diff cachyos-7.2.{0,1}-1 kernel/sched/fair.c
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 CachyOS/linux@d286c78, but the patch didn't update:

@@ -4857,115 +4840,7 @@ static long __calc_smp_shares(struct cfs_rq *cfs_rq, long tg_shares, long shares
* case no task is runnable on a CPU MIN_SHARES=2 should be returned
* instead of 0.
*/
- return clamp_t(long, shares, MIN_SHARES, shares_max);
-}
-
-static int tg_cpus(struct task_group *tg)
-{
- int nr = num_online_cpus();
-
- if (cpusets_enabled()) {
- struct cgroup *cgrp = tg->css.cgroup;
- if (cgrp)
- nr = cpuset_num_cpus(cgrp);
- }
-
- return nr;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions