[LU-7334] Refactor lprocfs helpers Created: 23/Oct/15 Updated: 06/Jun/17 Resolved: 09/Jul/16 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.9.0 |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Giuseppe Di Natale (Inactive) | Assignee: | Emoly Liu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | llnl, patch | ||
| Issue Links: |
|
||||||||||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||||||||||
| Description |
|
The lprocfs helper functions for parsing __u64 and ints from strings are currently a bit messy. These should be re-written to leverage a single set of internal functions. This change will replace these helpers with a small set of new helpers that will return an __s64. Any functions calling the old helpers will be changed to accommodate their replacement. |
| Comments |
| Comment by Giuseppe Di Natale (Inactive) [ 23/Oct/15 ] |
|
I will be submitting a patch for testing this shortly. No need for code reviews yet. |
| Comment by Gerrit Updater [ 23/Oct/15 ] |
|
Giuseppe Di Natale (dinatale2@llnl.gov) uploaded a new patch: http://review.whamcloud.com/16930 |
| Comment by Peter Jones [ 26/Oct/15 ] |
|
Emoly Could you please review and look after this patch? Thanks Peter |
| Comment by Gerrit Updater [ 11/May/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/16930/ |
| Comment by Emoly Liu [ 12/May/16 ] |
|
Landed for 2.9.0. |
| Comment by Andreas Dilger [ 17/May/16 ] |
|
We've noticed some regressions with this patch, in particular LU-8139 was causing sanity failures because both this http://review.whamcloud.com/16930 patch and http://review.whamcloud.com/19368 were tested and passed independently, but caused failures when both were landed. It seems that several /proc files that previously were using lprocfs_write_u64_helper() and accepted a unit suffix have been changed to lprocfs_str_to_s64() and no longer accept units. These include: lod_stripesize_seq_write() lod_stripeoffset_seq_write() lov_stripesize_seq_write()* lov_stripeoffset_seq_write()* osc_cur_grant_bytes_seq_write() osc_obd_max_pages_per_rpc_seq_write()+ ldiskfs_osd_readcache_seq_write() [*] The "lov_stripesize_seq_*()" tunables are non-functional since 2.4.0 and should just be deleted, they were replaced by the "lod_*" equivalents. The others are just potential sources of failures that should be fixed to avoid problems with end-user configurations that are setting these parameters. |
| Comment by Giuseppe Di Natale (Inactive) [ 17/May/16 ] |
|
Does this imply that we need a version of the function which doesn't accept a default unit, but will allow for units to be present in the string? The reason I ask is because Oleg's change appears to be a work around to have a default multiplier of 1, unless of course there is a unit in the string. I really don't like the idea of passing in '%' as the work around to accomplish a default multiplier of 1. The other option is to have a new unit 'B'/'b' for bytes with a multiplier of 1, but that can clash with the hex value B. Also, if we allow the new unit, we could disallow units to be part of hex strings? It seems unlikely that a hex value would represent a quantity, but I could be wrong. |
| Comment by Andreas Dilger [ 18/May/16 ] |
|
Also, "b" is used in some cases to mean "blocks", which would be confusing. Since the default unit is passed as a separate string, using "1" for the units would work and also be clear? |
| Comment by Frank Zago (Inactive) [ 19/May/16 ] |
|
I also found the following failure: # echo 1000 > /proc/fs/lustre/mdt/lustre-MDT0000/hsm/max_requests -bash: echo: write error: Invalid argument No weird values involved. That worked fine up to that patch. |
| Comment by Giuseppe Di Natale (Inactive) [ 19/May/16 ] |
|
That's because my processing function doesn't allow a newline before the null terminator. I will fix that too. |
| Comment by Gerrit Updater [ 20/May/16 ] |
|
Giuseppe Di Natale (dinatale2@llnl.gov) uploaded a new patch: http://review.whamcloud.com/20353 |
| Comment by Giuseppe Di Natale (Inactive) [ 20/May/16 ] |
|
I'm not sure a "1" unit is the way to go either. Since using 'B/b' is appearing to be some what confusing, I'm leaning towards a version of lprocfs_str_with_units_to_s64 that has no default unit, meaning it is expecting just a number (multiplier is 1 by default) and will parse a unit if it encounters one. But even that I'm not 100% happy with. |
| Comment by Christopher Morrone [ 23/May/16 ] |
|
I like using '1' for the units better than creating a new function. |
| Comment by Giuseppe Di Natale (Inactive) [ 25/May/16 ] |
|
Andreas, when you say remove the "lov_stripesize_seq_*()" tunables, you mean removing the proc file as a whole, correct? |
| Comment by Andreas Dilger [ 25/May/16 ] |
|
Correct. These /proc tunables were replaced on the MDS with "lod_stripesize_seq_()" and the "lov_" code is now only used on the client, where these tunables are totally useless. |
| Comment by Gerrit Updater [ 25/May/16 ] |
|
Giuseppe Di Natale (dinatale2@llnl.gov) uploaded a new patch: http://review.whamcloud.com/20455 |
| Comment by Giuseppe Di Natale (Inactive) [ 26/May/16 ] |
|
Should I introduce a change to re-enable sanity test 101g? |
| Comment by Gerrit Updater [ 26/May/16 ] |
|
Giuseppe Di Natale (dinatale2@llnl.gov) uploaded a new patch: http://review.whamcloud.com/20465 |
| Comment by Andreas Dilger [ 26/May/16 ] |
|
The enabling of test 101g is being done via http://review.whamcloud.com/20281 |
| Comment by Gerrit Updater [ 14/Jun/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/20353/ |
| Comment by Gerrit Updater [ 22/Jun/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/20465/ |
| Comment by Gerrit Updater [ 01/Jul/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) uploaded a new patch: http://review.whamcloud.com/21129 |
| Comment by Giuseppe Di Natale (Inactive) [ 01/Jul/16 ] |
|
Just noticed http://review.whamcloud.com/20465/ caused some issues. Should that change be abandoned? |
| Comment by James A Simmons [ 01/Jul/16 ] |
|
I thought setting the default lov with proc was a bad idea? Patch 20465 seems to not break anything but just adds a bogus error at client mount time.Is this not true? |
| Comment by Giuseppe Di Natale (Inactive) [ 01/Jul/16 ] |
|
It was reverted. From the description in LU-8338, the error at mount time might be harmless. |
| Comment by Gerrit Updater [ 05/Jul/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/20455/ |
| Comment by Gerrit Updater [ 05/Jul/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/21129/ |
| Comment by Peter Jones [ 09/Jul/16 ] |
|
It looks like all patches have landed for 2.9 now |