Re: newly add MAP_SYNC flag to mmap

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

 



Right.  That makes sense. 

On Monday, July 16, 2018, 7:27:18 PM PDT, valdis.kletnieks@xxxxxx <valdis.kletnieks@xxxxxx> wrote:


On Tue, 17 Jul 2018 02:15:17 -0000, David Frank said:


> inking. I'm checking out if the flag does what is is said to do-- I don't have
> to call msync function, which would boost performance.


Note that this can actually *kill* performance, because this means that the
kernel has to flush to backing store every single time it notes a change,
whereas if you use msync only at those points your software needs a sync point,
it can do it at only those points....

Thought experiment:  Imagine a workflow that needs to checkpoint every 1000
changes to the shared segment (for instance, if you've mapped an array with
1000 rows, do a for() loop across it incrementing one item, and checkpoint when
they're all incremented).  msync after the loop completes is one sync, while a worst-case
using MAP_SYNC could result in a flush after every single increment (if the system
is rescheduling the process over and over - for instance, if there's also another
syscall inside the loop).

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________
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