Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: Richard <richard_siegfried@systemli.org>
To: kernelnewbies@kernelnewbies.org
Subject: Mutex midpath question (mutex-design.rst , CONFIG_MUTEX_SPIN_ON_OWNER)
Date: Sat, 15 Oct 2022 17:59:36 +0200	[thread overview]
Message-ID: <a9dc09ed-41c2-844b-d14b-7f546d8a9267@systemli.org> (raw)

Hi all,

I have a question regarding understanding mutex-design.rst. It is about 
the feature that mutexes also have spinlocks for the case where the 
current lock is occupied but by a task that is runnning and might end 
soon (optimistic spinning).

The top of the file says:
> 
> In its most basic form it also includes a
> wait-queue and a spinlock that serializes access to it. Furthermore,
> CONFIG_MUTEX_SPIN_ON_OWNER=y systems use a spinner MCS lock (->osq), described
> below in (ii).

What is not fully clear for me here is: is the optimistic spinning 
always accessible and MCS is just an optimisation. Or is optimistic 
spinning only accessible with CONFIG_MUTEX_SPIN_ON_OWNER.

The mentioning of the first spinlock in the first sentence confuses me.

Thanks,
-- Richard

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

                 reply	other threads:[~2022-10-15 16:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=a9dc09ed-41c2-844b-d14b-7f546d8a9267@systemli.org \
    --to=richard_siegfried@systemli.org \
    --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 read-only IMAP folder(s) and NNTP newsgroup(s).