This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add memfd_create to os module
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Pedro Lacerda, ZackerySpytz, christian.heimes, davin, jdemeyer, miss-islington, pierreglaser, pitrou, vstinner
Priority: normal Keywords: patch

Created on 2016-04-24 13:56 by christian.heimes, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13567 merged ZackerySpytz, 2019-05-25 14:20
PR 13666 merged ZackerySpytz, 2019-05-29 20:25
PR 13838 merged vstinner, 2019-06-05 10:19
PR 13839 merged miss-islington, 2019-06-05 10:25
Messages (12)
msg264109 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2016-04-24 13:56
Add memfd_create() and constants MFD_ALLOW_SEALING, MFD_CLOEXEC to the os module. A glibc wrapper for memfd_create() is not available yet but the interface has been standardized.

http://man7.org/linux/man-pages/man2/memfd_create.2.html
https://dvdhrm.wordpress.com/tag/memfd/
msg268643 - (view) Author: Pedro Lacerda (Pedro Lacerda) * Date: 2016-06-16 06:00
Maybe useful at mmapmodule.c replacing

        /* SVR4 method to map anonymous memory is to open /dev/zero */
        fd = devzero = _Py_open("/dev/zero", O_RDWR);

tagname is unused at UNIX version of new_mmap_object() so if provided something like could be added for Linux only
        fd = memfd_create(tagname, O_RDWR);
msg343916 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-05-29 19:57
New changeset 43fdbd2729cb7cdbb5afb5d16352f6604859e564 by Christian Heimes (Zackery Spytz) in branch 'master':
bpo-26836: Add os.memfd_create() (#13567)
https://github.com/python/cpython/commit/43fdbd2729cb7cdbb5afb5d16352f6604859e564
msg343917 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-05-29 20:04
https://buildbot.python.org/all/#builders/99/builds/2738 is failing because some HUGE TLB constants are not defined on Gentoo.
msg343921 - (view) Author: miss-islington (miss-islington) Date: 2019-05-29 20:43
New changeset e70bfa95e6f0c98b9906f306f24d71f8b7689f87 by Miss Islington (bot) (Zackery Spytz) in branch 'master':
bpo-26836: Add ifdefs for all MFD_HUGE* constants (GH-13666)
https://github.com/python/cpython/commit/e70bfa95e6f0c98b9906f306f24d71f8b7689f87
msg343954 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-05-30 07:48
Testsuite breakage: https://bugs.python.org/issue37098
msg344033 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2019-05-31 08:26
Davin, Pierre, it looks like this could simplify lifetime management of shared memory pools, what do you think?
msg344302 - (view) Author: Pierre Glaser (pierreglaser) * Date: 2019-06-02 19:03
From a quick skim at the man page of memfd_create, this looks promising.
msg344684 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-05 08:33
It seems like this issue can now be closed, no?
msg344685 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-06-05 08:46
Yes, the feature is implemented and buildbots are green.
msg344699 - (view) Author: miss-islington (miss-islington) Date: 2019-06-05 10:24
New changeset ccf0efbb21f6bbf6efd5f8cb560fed11079ce1a2 by Miss Islington (bot) (Victor Stinner) in branch 'master':
bpo-26836: Document os.memfd_create() name parameter (GH-13838)
https://github.com/python/cpython/commit/ccf0efbb21f6bbf6efd5f8cb560fed11079ce1a2
msg344705 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-05 11:16
New changeset b496c2672131ea51a55b5a414aeda271562f18d3 by Victor Stinner (Miss Islington (bot)) in branch '3.8':
bpo-26836: Document os.memfd_create() name parameter (GH-13838) (GH-13839)
https://github.com/python/cpython/commit/b496c2672131ea51a55b5a414aeda271562f18d3
History
Date User Action Args
2022-04-11 14:58:30adminsetgithub: 71023
2019-06-05 11:16:04vstinnersetmessages: + msg344705
2019-06-05 10:25:22miss-islingtonsetpull_requests: + pull_request13717
2019-06-05 10:24:55miss-islingtonsetmessages: + msg344699
2019-06-05 10:19:25vstinnersetpull_requests: + pull_request13716
2019-06-05 08:46:01christian.heimessetstatus: open -> closed
resolution: fixed
messages: + msg344685

stage: patch review -> resolved
2019-06-05 08:33:13vstinnersetnosy: + vstinner
messages: + msg344684
2019-06-02 19:03:26pierreglasersetmessages: + msg344302
2019-05-31 08:26:56pitrousetnosy: + pitrou, pierreglaser, davin
messages: + msg344033
2019-05-30 07:48:33jdemeyersetnosy: + jdemeyer
messages: + msg343954
2019-05-29 20:43:54miss-islingtonsetnosy: + miss-islington
messages: + msg343921
2019-05-29 20:25:53ZackerySpytzsetstage: needs patch -> patch review
pull_requests: + pull_request13556
2019-05-29 20:04:23christian.heimessetmessages: + msg343917
stage: patch review -> needs patch
2019-05-29 19:57:14christian.heimessetmessages: + msg343916
2019-05-25 14:32:32ZackerySpytzsetnosy: + ZackerySpytz

versions: + Python 3.8, - Python 3.6
2019-05-25 14:20:05ZackerySpytzsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request13477
2016-06-16 06:00:59Pedro Lacerdasetnosy: + Pedro Lacerda
messages: + msg268643
2016-06-12 11:22:13christian.heimessetassignee: christian.heimes ->
2016-04-24 13:56:03christian.heimescreate