]> git.feebdaed.xyz Git - linuxyz.git/commitdiff
rcu namechange
authorseantywork <seantywork@gmail.com>
Sun, 21 Sep 2025 04:10:53 +0000 (04:10 +0000)
committerseantywork <seantywork@gmail.com>
Sun, 21 Sep 2025 04:10:53 +0000 (04:10 +0000)
krcu-cmap/Makefile [new file with mode: 0644]
krcu-cmap/README.md [new file with mode: 0644]
krcu-cmap/rcucmap.c [new file with mode: 0644]
krcu-deadly/rcudeadly.c [deleted file]
kthread-rcu/Makefile [deleted file]
kthread-rcu/README.md [deleted file]
kthread-rcu/threadrcu.c [deleted file]

diff --git a/krcu-cmap/Makefile b/krcu-cmap/Makefile
new file mode 100644 (file)
index 0000000..5c8d899
--- /dev/null
@@ -0,0 +1,6 @@
+obj-m := rcucmap.o
+
+all:
+       make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
+clean:
+       make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean
\ No newline at end of file
diff --git a/krcu-cmap/README.md b/krcu-cmap/README.md
new file mode 100644 (file)
index 0000000..22b3f5d
--- /dev/null
@@ -0,0 +1,5 @@
+# krcu-cmap
+
+- source: [linuxyz/krcu-cmap](https://github.com/seantywork/linuxyz/tree/main/krcu-cmap)
+- date: 2509-
+
diff --git a/krcu-cmap/rcucmap.c b/krcu-cmap/rcucmap.c
new file mode 100644 (file)
index 0000000..7f9dd1a
--- /dev/null
@@ -0,0 +1,86 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/list.h>
+#include <linux/rculist.h>
+#include <linux/spinlock.h>
+#include <linux/preempt.h>
+#include <linux/kthread.h>
+#include <linux/sched/task.h>
+#include <linux/delay.h>
+
+#define OP_COUNT 10
+
+struct myelement {
+  
+       struct list_head node;
+       struct rcu_head rcu;
+};
+
+static LIST_HEAD(myelements);
+static spinlock_t myelements_lock;
+
+static struct task_struct *task_write;
+static struct task_struct *task_read;
+static int w = 10;
+static int r = 11;
+
+static int task_writer(void *arg){
+
+    int v = *(int *)arg;
+
+    for(int i = 0; i < OP_COUNT; i++){
+        printk(KERN_INFO "rcucmap: v: %d: w: %d\n", v, i);
+        mdelay(1000);
+    }
+
+    return 0;
+}
+
+static int task_reader(void *arg){
+
+    int v = *(int *)arg;
+
+    for(int i = 0; i < OP_COUNT; i++){
+        printk(KERN_INFO "rcucmap: v: %d: r: %d\n", v, i);
+        mdelay(1000);
+    }
+
+    return 0;
+}
+
+
+static int __init rcu_cmap_init(void){
+
+    spin_lock_init(&myelements_lock);
+
+    task_write = kthread_run(task_writer, (void*)&w, "tw/%d", w);
+    if(IS_ERR(task_write)){
+        printk(KERN_ERR "rcucmap: failed to create task_write thread\n");
+        return -1;
+    }
+    task_read = kthread_run(task_reader, (void*)&r, "tr/%d", r);
+    if(IS_ERR(task_read)){
+        printk(KERN_ERR "rcucmap: failed to create task_read thread\n");
+        return -1;
+    }
+    get_task_struct(task_write);
+    get_task_struct(task_read);
+
+    printk(KERN_INFO "rcucmap: loaded\n");
+
+    return 0;
+}
+
+static void __exit rcu_cmap_exit(void){
+    kthread_stop(task_write);
+    kthread_stop(task_read);
+
+    printk(KERN_INFO "rcucmap: unloaded\n");
+
+}
+
+module_init(rcu_cmap_init);
+module_exit(rcu_cmap_exit);
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("seantywork");
\ No newline at end of file
diff --git a/krcu-deadly/rcudeadly.c b/krcu-deadly/rcudeadly.c
deleted file mode 100644 (file)
index faa1225..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/list.h>
-#include <linux/rculist.h>
-#include <linux/spinlock.h>
-#include <linux/preempt.h>
-#include <linux/kthread.h>
-#include <linux/sched/task.h>
-#include <linux/delay.h>
-
-#define OP_COUNT 10
-
-struct 
-
-static LIST_HEAD();
-static spinlock_t 
-
-static struct task_struct *task_write;
-static struct task_struct *task_read;
-static int w = 10;
-static int r = 11;
-
-static int task_writer(void *arg){
-
-    int v = *(int *)arg;
-
-    for(int i = 0; i < OP_COUNT; i++){
-        printk(KERN_INFO "rcudeadly: v: %d: w: %d\n", v, i);
-        mdelay(1000);
-    }
-
-    return 0;
-}
-
-static int task_reader(void *arg){
-
-    int v = *(int *)arg;
-
-    for(int i = 0; i < OP_COUNT; i++){
-        printk(KERN_INFO "rcudeadly: v: %d: r: %d\n", v, i);
-        mdelay(1000);
-    }
-
-    return 0;
-}
-
-
-static int __init rcu_deadly_init(void){
-
-    task_write = kthread_run(task_writer, (void*)&w, "tw/%d", w);
-    if(IS_ERR(task_write)){
-        printk(KERN_ERR "rcudeadly: failed to create task_write thread\n");
-        return -1;
-    }
-    task_read = kthread_run(task_reader, (void*)&r, "tr/%d", r);
-    if(IS_ERR(task_read)){
-        printk(KERN_ERR "rcudeadly: failed to create task_read thread\n");
-        return -1;
-    }
-    get_task_struct(task_write);
-    get_task_struct(task_read);
-
-    printk(KERN_INFO "rcudeadly: loaded\n");
-
-    return 0;
-}
-
-static void __exit rcu_deadly_exit(void){
-    kthread_stop(task_write);
-    kthread_stop(task_read);
-
-    printk(KERN_INFO "rcudeadly: unloaded\n");
-
-}
-
-module_init(rcu_deadly_init);
-module_exit(rcu_deadly_exit);
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("seantywork");
\ No newline at end of file
diff --git a/kthread-rcu/Makefile b/kthread-rcu/Makefile
deleted file mode 100644 (file)
index 37a38c4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-obj-m := threadrcu.o
-
-all:
-       make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
-clean:
-       make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean
\ No newline at end of file
diff --git a/kthread-rcu/README.md b/kthread-rcu/README.md
deleted file mode 100644 (file)
index c7848a2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# kernel-thread-rcu
-
-- source: [linuxyz/kthread-rcu](https://github.com/seantywork/linuxyz/tree/main/kthread-rcu)
-- date: 2509-
-
diff --git a/kthread-rcu/threadrcu.c b/kthread-rcu/threadrcu.c
deleted file mode 100644 (file)
index 2173ac8..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/list.h>
-#include <linux/rculist.h>
-#include <linux/spinlock.h>
-#include <linux/preempt.h>
-#include <linux/kthread.h>
-#include <linux/sched/task.h>
-#include <linux/delay.h>
-
-#define OP_COUNT 10
-
-struct myelement {
-  
-       struct list_head node;
-       struct rcu_head rcu;
-};
-
-static LIST_HEAD(myelements);
-static spinlock_t myelements_lock;
-
-static struct task_struct *task_write;
-static struct task_struct *task_read;
-static int w = 10;
-static int r = 11;
-
-static int task_writer(void *arg){
-
-    int v = *(int *)arg;
-
-    for(int i = 0; i < OP_COUNT; i++){
-        printk(KERN_INFO "rcudeadly: v: %d: w: %d\n", v, i);
-        mdelay(1000);
-    }
-
-    return 0;
-}
-
-static int task_reader(void *arg){
-
-    int v = *(int *)arg;
-
-    for(int i = 0; i < OP_COUNT; i++){
-        printk(KERN_INFO "rcudeadly: v: %d: r: %d\n", v, i);
-        mdelay(1000);
-    }
-
-    return 0;
-}
-
-
-static int __init rcu_deadly_init(void){
-
-    spin_lock_init(&myelements_lock);
-
-    task_write = kthread_run(task_writer, (void*)&w, "tw/%d", w);
-    if(IS_ERR(task_write)){
-        printk(KERN_ERR "rcudeadly: failed to create task_write thread\n");
-        return -1;
-    }
-    task_read = kthread_run(task_reader, (void*)&r, "tr/%d", r);
-    if(IS_ERR(task_read)){
-        printk(KERN_ERR "rcudeadly: failed to create task_read thread\n");
-        return -1;
-    }
-    get_task_struct(task_write);
-    get_task_struct(task_read);
-
-    printk(KERN_INFO "rcudeadly: loaded\n");
-
-    return 0;
-}
-
-static void __exit rcu_deadly_exit(void){
-    kthread_stop(task_write);
-    kthread_stop(task_read);
-
-    printk(KERN_INFO "rcudeadly: unloaded\n");
-
-}
-
-module_init(rcu_deadly_init);
-module_exit(rcu_deadly_exit);
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("seantywork");
\ No newline at end of file