Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ADDRESS_BITS to 64 for obmalloc radix tree #89689

Closed
nascheme opened this issue Oct 19, 2021 · 3 comments
Closed

Set ADDRESS_BITS to 64 for obmalloc radix tree #89689

nascheme opened this issue Oct 19, 2021 · 3 comments
Assignees
Labels
type-feature A feature request or enhancement

Comments

@nascheme
Copy link
Member

BPO 45526
Nosy @nascheme, @methane, @ambv
PRs
  • bpo-45526: obmalloc radix use 64 addr bits #29062
  • Files
  • pyperf-compare-addr-64.txt
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/methane'
    closed_at = <Date 2021-10-21.21:06:33.769>
    created_at = <Date 2021-10-19.16:48:44.889>
    labels = ['type-feature']
    title = 'Set ADDRESS_BITS to 64 for obmalloc radix tree'
    updated_at = <Date 2021-10-21.21:06:33.768>
    user = 'https://github.com/nascheme'

    bugs.python.org fields:

    activity = <Date 2021-10-21.21:06:33.768>
    actor = 'lukasz.langa'
    assignee = 'methane'
    closed = True
    closed_date = <Date 2021-10-21.21:06:33.769>
    closer = 'lukasz.langa'
    components = []
    creation = <Date 2021-10-19.16:48:44.889>
    creator = 'nascheme'
    dependencies = []
    files = ['50370']
    hgrepos = []
    issue_num = 45526
    keywords = ['patch']
    message_count = 3.0
    messages = ['404317', '404661', '404662']
    nosy_count = 3.0
    nosy_names = ['nascheme', 'methane', 'lukasz.langa']
    pr_nums = ['29062']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue45526'
    versions = []

    @nascheme
    Copy link
    Member Author

    Given this feedback:

    https://github.com/python/cpython/pull/14474/files#r725488766

    it is perhaps not so safe to assume that only the lower 48 bits of virtual addresses are significant. I had the idea that Go made similar assumptions but now I'm not sure it does. There is also a comment in this article about 5-level page tables in Linux:

    https://lwn.net/Articles/717293/
    https://lwn.net/Articles/717300/

    I.e. that Linux does not allocate virtual address space above 47-bit by default.

    Setting ADDRESS_BITS to 64 is safer and the performance impact seems small. The virtual memory size of a small Python process goes up a little. Resident set size doesn't significantly change. I think the pyperformance changes are just noise. The pyperformance attached file shows the 3.10 branch with ADDRESS_BITS set to 48 and to 64.

    @ambv
    Copy link
    Contributor

    ambv commented Oct 21, 2021

    New changeset 0224b71 by Neil Schemenauer in branch 'main':
    bpo-45526: obmalloc radix use 64 addr bits (GH-29062)
    0224b71

    @ambv
    Copy link
    Contributor

    ambv commented Oct 21, 2021

    Thanks, Neil! ✨ 🍰 ✨

    @ambv ambv closed this as completed Oct 21, 2021
    @ambv ambv added the type-feature A feature request or enhancement label Oct 21, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants