Whamcloud - gitweb
LU-8926 llite: reduce jobstats race window 53/24253/5
authorPatrick Farrell <paf@cray.com>
Tue, 13 Dec 2016 15:43:34 +0000 (09:43 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 24 Jan 2017 05:23:05 +0000 (05:23 +0000)
commit8eca92b365fd3efd1541a48b1bb239926838d947
treeb088e9a409c140693f16a5578d9de8f0cae9755d
parentf1af92e7fc249fd4ce54f0c61b04388a3b0da6bb
LU-8926 llite: reduce jobstats race window

In the current code, lli_jobid is set to zero on every call
to lustre_get_jobid.  This causes problems, because it's
used asynchronously to set the job id in RPCs, and some
RPCs will falsely get no jobid set.  (For small IO sizes,
this can be up to 60% of RPCs.)

It would be very expensive to put hard synchronization
between this and every outbound RPC, and it's OK to very
rarely get an RPC without correct job stats info.

This patch only updates the lli_jobid when the job id has
changed, which leaves only a very small window for reading
an inconsistent job id.

Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I6c3a7f8683dc5f5d467940920938db18b0c20462
Reviewed-on: https://review.whamcloud.com/24253
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Chris Horn <hornc@cray.com>
lustre/llite/llite_lib.c
lustre/obdclass/class_obd.c