From: chrishell <chris@chrishell.de>
To: kernelnewbies@kernelnewbies.org
Subject: Re: linked list within a kernel probe
Date: Thu, 12 Jan 2023 16:05:36 +0100 [thread overview]
Message-ID: <ff87be81-59a9-320b-d779-00263541ac03@chrishell.de> (raw)
In-Reply-To: <CAAMy4USSAW2w98mAOf1oXtt9gEAhe2VEXsqN00AA4_wwFpYG2w@mail.gmail.com>
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@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
prev parent reply other threads:[~2023-01-12 15:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 18:52 linked list within a kernel probe chrishell
2023-01-08 22:24 ` chrishell
2023-01-09 16:15 ` Billie Alsup (balsup)
2023-01-12 14:48 ` chrishell
2023-01-09 17:56 ` Tom Mitchell
2023-01-12 15:05 ` chrishell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ff87be81-59a9-320b-d779-00263541ac03@chrishell.de \
--to=chris@chrishell.de \
--cc=kernelnewbies@kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).