[LU-6775] Reduce memory footprint of ldlm_lock and ldlm_resource Created: 30/Jun/15  Updated: 30/Sep/15  Resolved: 10/Jul/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.8.0

Type: Bug Priority: Minor
Reporter: Niu Yawei (Inactive) Assignee: Niu Yawei (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-6529 Server side lock limits to avoid unne... Closed
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Following is quote from Andreas:

Another minor improvement that is possible is to shrink the size of ldlm_resource, by filling in holes in the structure. The current size is 320 bytes, with 12 bytes of holes (use "pahole lustre/ptlrpc/ptlrpc.ko" from the "dwarves" RPM to see this). Moving lr_refcount after lr_lock would remove 8 bytes of holes. Removing the unused lr_most_restr field would save another 16 bytes. That would allow 13 ldlm_resource structures to fit into a 4096-byte page instead of only 12. Making lr_itree optional (e.g. allocating it from its own slab in ldlm_extent_add_lock() only for extent locks, and making the pointer to it a union with lr_lvb_inode which is only used on the client) would reduce the size by 128 bytes, and allow 24 ldlm_resource structures per 4096-byte page, saving about 15GB on the MDS in the graph.

Shrinking ldlm_lock to fit more per slab would be a bit harder, but would be worthwhile because there are so many locks and would save many MB of space on the server. The ldlm_*callback pointers could be replaced by a single ldlm_callback_suite pointer, since these are always the same, saving 16 bytes. The l_exp_flock_hash and l_tree_node are used on different lock types, and are only used on the server. l_lru, l_conn_export, and l_lvb* only used on the client, while l_export is only used on the server. There are also a number of other fields in ldlm_lock already listed as being client- or server-only Putting these in a union could save a lot of space. This is relatively more complex to do and should be in a separate bug, and discussed with Alex.



 Comments   
Comment by Gerrit Updater [ 03/Jul/15 ]

Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/15485
Subject: LU-6775 ldlm: reduce mem footprint of ldlm_resource
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 083257246019edfc4d39691b21ec59b7883cf103

Comment by Niu Yawei (Inactive) [ 03/Jul/15 ]

Reduce mem footprint of ldlm_resource: http://review.whamcloud.com/15485

ldlm_lock reshaping work is to on the way.

Comment by Gerrit Updater [ 10/Jul/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/15485/
Subject: LU-6775 ldlm: reduce mem footprint of ldlm_resource
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 8cf860b866005c5907e8e7a0ded92cc481fdb6c3

Comment by Peter Jones [ 10/Jul/15 ]

Landed for 2.8

Generated at Sat Feb 10 02:03:08 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.