Re: linked list within a kernel probe

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

 



Hi Tom, thank you for your support.
in my example, I used a spin_lock(&sl) for blocking traversing the list, despite this function does nothing but reading or traversing the linked list. No adding or removing is done within the kprobe function. The other function called _kprobe_setup_cache_elements, which creates the linked list, is called from the _init function, only once.

So I think there is no concurrency in this situation?


BR Christian

Hint.
Inside the kernel always address the issue of concurrency.
Adding and removing from lists commonly needs a protective mutual
exclusive lock.
Look for like data structures and use the macro/standard tools to get
it ALL correct including cache coherency.

There are two strategies -- a data lock or a code monitor.
https://www.geeksforgeeks.org/deadlock-starvation-and-livelock/



_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux