{"push_id":2588622366,"size":1,"distinct_size":0,"ref":"refs/heads/openzfs-9486","head":"a26b4a9c080688614035e33339928165cca1a429","before":"75d5f6e0ab5b094d9f425c91dcd6b1026c57f17d","commits":[{"sha":"a26b4a9c080688614035e33339928165cca1a429","author":{"name":"Matthew Ahrens","email":"0962b5d2f5c1117073cf6f982c188f029b03d89e@delphix.com"},"message":"OpenZFS 9486 - reduce memory used by device...\n\nremoval on fragmented pools\n\nDevice removal allocates a new location for each allocated segment on\nthe disk that's being removed.  Each allocation results in one entry in\nthe mapping table, which maps from old location + length to new\nlocation.  When a fragmented disk is removed, this can result in a large\nnumber of mapping entries, and thus a large amount of memory consumed by\nthe mapping table.  In the worst real-world cases, we've seen around 1GB\nof RAM per 1TB of storage removed.\n\nWe can improve on this situation by allocating larger segments, which\nspan across both allocated and free regions of the device being removed.\nBy including free regions in the allocation (and thus mapping), we\nreduce the number of mapping entries.  For example, if we have a 4K\nallocation followed by 1K free and then 4K allocated, we would allocate\n4+1+4 = 9KB, and then move the entire region (including allocated and\nfree parts).  In this case we used one mapping where previously we would\nhave used two, but often the ratio is much higher (up to 20:1 in\nreal-world use).  We then need to mark the regions that were free on the\nremoving device as free in the new locations, and also obsolete in the\nmapping entry.\n\nThis method preserves the fragmentation of the removing device, rather\nthan consolidating its allocated space into a small number of chunks\nwhere possible.  But it results in drastic reduction of memory used by\nthe mapping table - around 20x in the most-fragmented cases.\n\nIn the most fragmented real-world cases, this reduces memory used by the\nmapping from ~1GB to ~50MB of RAM per 1TB of storage removed.  Less\nfragmented cases will typically also see around 50-100MB of RAM per 1TB\nof storage.\n\nPorting notes:\n\n    Add the following as module parameters:\n        zfs_condense_indirect_vdevs_enable\n        zfs_condense_max_obsolete_bytes\n\n    Document the following module parameters:\n        zfs_condense_indirect_vdevs_enable\n        zfs_condense_max_obsolete_bytes\n        zfs_condense_min_mapping_bytes\n\nExternal-issue: DLPX-57962\n\nAuthored by: Matthew Ahrens <mahrens@delphix.com>\nOpenZFS-issue: https://illumos.org/issues/9486\nOpenZFS-commit: https://github.com/ahrens/illumos/commit/07152e142e44c184e454ec073695c151572bc8f1\nOpenZFS-PR: https://github.com/openzfs/openzfs/pull/627\nPorted-by: Tim Chase <tim@chase2k.com>\nSigned-off-by: Tim Chase <tim@chase2k.com>","distinct":false,"url":"https://api.github.com/repos/dweeezil/zfs/commits/a26b4a9c080688614035e33339928165cca1a429"}]}
{"actor":{"display_login":"dweeezil"}}