Skip to content

taskstats: four more tidy-ups in the genl path

Bradley Morgan lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4taskstats: use nla_put_u32() in mk_reply()kernel/taskstats.c+1 -11 reply
2/4taskstats: take the inode once in exe_add_tsk()kernel/taskstats.c+4 -31 reply
3/4taskstats: reuse na in cgroupstats_user_cmd()kernel/taskstats.c+1 -11 reply
4/4taskstats: use div_u64() for the elapsed time in tgid_stats_add_task()kernel/taskstats.c+1 -21 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchBalbir Singh
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] taskstats: four more tidy-ups in the genl path

Four small cleanups from reading kernel/taskstats.c again. No functional change in any of them.

Patch 1 uses nla_put_u32() in mk_reply() instead of open coding the u32 attribute with nla_put() and a sizeof/& pair.

Patch 2 grabs the inode once with file_inode() in exe_add_tsk(), which walks exe_file->f_inode twice today, once for the device and once for the number.

Patch 3 reads the cgroupstats fd out of na, which the function already fetched, instead of indexing info->attrs[] again for the same attribute.

Patch 4 converts the elapsed time with div_u64() in tgid_stats_add_task(), like the utime and stime lines four below it do, instead of do_div().

Balbir Singh has moved to [email protected], MAINTAINERS still lists the old gmail address.

Bradley Morgan (4):
taskstats: use nla_put_u32() in mk_reply()
taskstats: take the inode once in exe_add_tsk()
taskstats: reuse na in cgroupstats_user_cmd()
taskstats: use div_u64() for the elapsed time in tgid_stats_add_task()

 kernel/taskstats.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.53.0