Patch "torture: Add a kthread-creation callback to _torture_create_kthread()" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    torture: Add a kthread-creation callback to _torture_create_kthread()

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     torture-add-a-kthread-creation-callback-to-_torture_.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fd0e51b6a7d080f459e997e927b62c0e4270454a
Author: Paul E. McKenney <paulmck@xxxxxxxxxx>
Date:   Wed Jul 19 15:50:07 2023 -0700

    torture: Add a kthread-creation callback to _torture_create_kthread()
    
    [ Upstream commit 67d5404d274376890d6d095a10e6565854918f8e ]
    
    This commit adds a kthread-creation callback to the
    _torture_create_kthread() function, which allows callers of a new
    torture_create_kthread_cb() macro to specify a function to be invoked
    after the kthread is created but before it is awakened for the first time.
    
    Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
    Cc: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
    Cc: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
    Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>
    Cc: Valentin Schneider <vschneid@xxxxxxxxxx>
    Cc: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
    Cc: kernel-team@xxxxxxxxxxx
    Reviewed-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx>
    Acked-by: John Stultz <jstultz@xxxxxxxxxx>
    Stable-dep-of: cca42bd8eb1b ("rcutorture: Fix stuttering races and other issues")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/torture.h b/include/linux/torture.h
index 7038104463e48..bb466eec01e42 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -108,12 +108,15 @@ bool torture_must_stop(void);
 bool torture_must_stop_irq(void);
 void torture_kthread_stopping(char *title);
 int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m,
-			     char *f, struct task_struct **tp);
+			     char *f, struct task_struct **tp, void (*cbf)(struct task_struct *tp));
 void _torture_stop_kthread(char *m, struct task_struct **tp);
 
 #define torture_create_kthread(n, arg, tp) \
 	_torture_create_kthread(n, (arg), #n, "Creating " #n " task", \
-				"Failed to create " #n, &(tp))
+				"Failed to create " #n, &(tp), NULL)
+#define torture_create_kthread_cb(n, arg, tp, cbf) \
+	_torture_create_kthread(n, (arg), #n, "Creating " #n " task", \
+				"Failed to create " #n, &(tp), cbf)
 #define torture_stop_kthread(n, tp) \
 	_torture_stop_kthread("Stopping " #n " task", &(tp))
 
diff --git a/kernel/torture.c b/kernel/torture.c
index 1a0519b836ac9..1da48f3816f61 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -926,7 +926,7 @@ EXPORT_SYMBOL_GPL(torture_kthread_stopping);
  * it starts, you will need to open-code your own.
  */
 int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m,
-			    char *f, struct task_struct **tp)
+			    char *f, struct task_struct **tp, void (*cbf)(struct task_struct *tp))
 {
 	int ret = 0;
 
@@ -938,6 +938,10 @@ int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m,
 		*tp = NULL;
 		return ret;
 	}
+
+	if (cbf)
+		cbf(*tp);
+
 	wake_up_process(*tp);  // Process is sleeping, so ordering provided.
 	torture_shuffle_task_register(*tp);
 	return ret;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux