Patch "pktgen: fix misuse of BUG_ON() in pktgen_thread_worker()" has been added to the 4.4-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

    pktgen: fix misuse of BUG_ON() in pktgen_thread_worker()

to the 4.4-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:
     pktgen-fix-misuse-of-bug_on-in-pktgen_thread_worker.patch
and it can be found in the queue-4.4 subdirectory.

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



commit f3a5168bfb0abcc9e9780c49f37f48d9cbcf61eb
Author: Di Zhu <zhudi21@xxxxxxxxxx>
Date:   Mon Jan 25 20:42:29 2021 +0800

    pktgen: fix misuse of BUG_ON() in pktgen_thread_worker()
    
    [ Upstream commit 275b1e88cabb34dbcbe99756b67e9939d34a99b6 ]
    
    pktgen create threads for all online cpus and bond these threads to
    relevant cpu repecivtily. when this thread firstly be woken up, it
    will compare cpu currently running with the cpu specified at the time
    of creation and if the two cpus are not equal, BUG_ON() will take effect
    causing panic on the system.
    Notice that these threads could be migrated to other cpus before start
    running because of the cpu hotplug after these threads have created. so the
    BUG_ON() used here seems unreasonable and we can replace it with WARN_ON()
    to just printf a warning other than panic the system.
    
    Signed-off-by: Di Zhu <zhudi21@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210125124229.19334-1-zhudi21@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 4ea957c1e7ee..5d0759e2102e 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3519,7 +3519,7 @@ static int pktgen_thread_worker(void *arg)
 	struct pktgen_dev *pkt_dev = NULL;
 	int cpu = t->cpu;
 
-	BUG_ON(smp_processor_id() != cpu);
+	WARN_ON(smp_processor_id() != cpu);
 
 	init_waitqueue_head(&t->queue);
 	complete(&t->start_done);



[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