|
|
Subscribe / Log in / New account

Sharing page tables with msharefs

Sharing page tables with msharefs

Posted Jul 15, 2022 19:55 UTC (Fri) by josh (subscriber, #17465)
In reply to: Sharing page tables with msharefs by willy
Parent article: Sharing page tables with msharefs

What makes it lower performance when using threads? Lock contention on the process mm? Something else?


to post comments

Sharing page tables with msharefs

Posted Jul 15, 2022 20:52 UTC (Fri) by bartoc (guest, #124262) [Link]

Perhaps they want to COW some regions of memory while sharing others. This is quite difficult to do without fork/clone because as far as I can tell there's no other good way to create a COW mapping of another COW mapping. (On windows this is completely impossible, which is why you can't easily do things like forking game saves without implementing COW as part of your application's data structures). I'm not 100% sure how to do this on linux (without using fork/clone), maybe you can reflink tempfs files together or something.

Sharing page tables with msharefs

Posted Jul 15, 2022 22:59 UTC (Fri) by nickodell (subscriber, #125165) [Link]

Yes, exactly. From the May 17 article about this patchset:

> That raises an obvious question, he said: why not just use threads? The answer was that "mmap_lock sucks". It is also not possible to change the existing behavior of MAP_SHARED, since that would break programs, so there would need to be, at a minimum, a new mmap() flag if not a new system call. Aziz said that the separate system call makes the page-table sharing explicit rather than it just being a side effect. That makes the decision to opt into this behavior explicit as well.

https://lwn.net/Articles/895217/


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds