Re: why does the kernel use mutex to protect the address_space structure

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

 



On Tue, Nov 1, 2011 at 3:57 AM, Zheng Da <zhengda1936@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxx
> 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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://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