From: dspjm1@gmail.com (Jimmy Pan)
To: kernelnewbies@lists.kernelnewbies.org
Subject: why does the kernel use mutex to protect the address_space structure
Date: Fri, 4 Nov 2011 12:44:25 +0800 [thread overview]
Message-ID: <CAAgJb5tsB529Csht-L1Che1Sr1BwwWTc7LftZpfp6pvCWY1mcw@mail.gmail.com> (raw)
In-Reply-To: <CAFLer83bXuOnNgbFfScoQaysCi11Bb-BJuEAxcFwTy=UTV_ZsA@mail.gmail.com>
On Tue, Nov 1, 2011 at 3:57 AM, Zheng Da <zhengda1936@gmail.com> wrote:
> Hello,
>
> I try to understand why the kernel uses mutex to protect the
> address_space structure. I checked the critical areas protected by
> i_mmap_mutex, and didn't see these areas use IO. I don't see why we
> can't use spin locks. Do I miss something? It seems most of critical
> areas provided by i_mmap_mutex aren't very large.
>
> Thanks,
> Da
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
In my knowledge, when you use mutex, you can go to sleep, if you use spin lock,
the thread has to busy wait, spin lock causes cpu waste, while mutex
cannot be used
under interrupt context.
Regards,
Jimmy
next prev parent reply other threads:[~2011-11-04 4:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-31 19:57 why does the kernel use mutex to protect the address_space structure Zheng Da
2011-11-04 4:44 ` Jimmy Pan [this message]
2011-11-13 20:08 ` Zheng Da
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=CAAgJb5tsB529Csht-L1Che1Sr1BwwWTc7LftZpfp6pvCWY1mcw@mail.gmail.com \
--to=dspjm1@gmail.com \
--cc=kernelnewbies@lists.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).