Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-11166

Remove all references to the /proc/fs/jbd2/*/history file

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.12.0
    • Lustre 2.11.0, Lustre 2.12.0, Lustre 2.10.4
    • None
    • 3
    • 9223372036854775807

    Description

      The /proc/fs/jbd2/*/history file was removed several years ago by Theodore Ts’o’s patch

      commit bf6993276f74d46776f35c45ddef29b981b1d1c6
      Author: Theodore Ts'o tytso@mit.edu
      AuthorDate: Wed Sep 30 00:32:06 2009 -0400
      Commit: Theodore Ts'o tytso@mit.edu
      CommitDate: Wed Sep 30 00:32:06 2009 -0400

      jbd2: Use tracepoints for history file
      The /proc/fs/jbd2//history was maintained manually; by using tracepoints, we can get all of the existing functionality of the /proc file plus extra capabilities thanks to the ftrace infrastructure. We save memory as a bonus.

      obdfilter-survey and iokit-lstat both look for the jbd history file. Since the history file no longer exists, we should stop these tests and utilities from looking for the file.

      Is there an alternate way to get the same information that was contained in /proc/fs/jbd2//history of use the information in the /proc/fs/jbd2//info file? Use tracepoints?

      From obdfilter-survey.sh, the following functions are used in tests 1b and 2b.

        93 print_jbd () {
        94         local file=$1
        95         local facet=$2
        96         local varsvc=${facet}_svc
        97         local dev=$(ldiskfs_canon "*.${!varsvc}.mntdev" $facet)
        98 
        99         # ext4: /proc/fs/jbd2/sda1:8/history
       100         # ext3: /proc/fs/jbd/sdb1/history
       101 
       102         do_facet $facet cat /proc/fs/jbd*/${dev}*/$file
       103 }
       104 
       105 check_jbd_values () {
       106         local facet=$1
       107         local thrhi=$2
       108         local rtime=$3
       109 
       110         # last two lines from history
       111         # $4: run >= 5000
       112         # $8: hndls >= thrhi * 2
       113         # display history of rtime/4 before, in case obd cleanup consumes time
       114         local tlines=$((rtime / 5 / 4 + 1))
       115         local hist=("$(print_jbd history $facet | tail -$tlines | head -n1)")
       116         echo "$hist"
       117         local run=($(echo "${hist[*]}" | awk '{print $4}'))
       118         local hndls=($(echo "${hist[*]}" | awk '{print $8}'))
       119 
       120         local rc=0
       121         for (( i=0; i<1; i++)); do
       122                 [[ ${run[i]} -lt 5000 ]] && \
       123                         error "$facet: run expected 5000, have ${run[i]}" && rc=1
       124                 [[ ${hndls[i]} -lt $((thrhi * 2)) ]] && \
       125                         error "$facet: hndls expected > $((thrhi * 2)), have ${hndls[i]}" && rc=2
       126         done
       127         return $rc
       128 }
       129 
       130 check_jbd_values_facets () {
       131         local facets=$1
       132         local thrhi=$2
       133         local rtime=$3
       134         local facet
       135         local rc=0
       136         for facet in  ${facets//,/ }; do
       137                 check_jbd_values $facet $thrhi $rtime || rc=$((rc+$?))
       138         done
       139         return $rc
       140 }
       141 
      

      In iokit-lstat, jbd_collector() cats the file

      520 function jbd_collector()
       521 {
       522         local obd=$1
       523         local uuid=$(lctl get_param -n obd.uuid 2>&1)
       524         local tmp=$(lctl get_param -n obd.mntdev 2>&1)
       525         local disk=$(basename $tmp)
       526         local file="/proc/fs/jbd/${disk}/history"
       527 
       528         echo "jbd history for ${uuid}/${disk} " $(date)
       529 
       530         if let "JBD_INTERVAL==0"; then
       531                 idle_collector
       532                 cat $file
       533         elif let "JBD_INTERVAL>0"; then
       534                 idle_collector
       535                 cat $file
       536         else
       537                 echo "Invalid JBD_INTERVAL=$JBD_INTERVAL"
       538                 idle_collector
       539         fi
       540 }
       541 
       542 function jbd_start()
       543 {
       544         if [ "$JBD_INTERVAL" == "" ]; then
       545                 return;
       546         fi
       547 
       548         # find all obdfilters and MDSs
       549         for i in $(lctl list_param obdfilter.* mds.*); do
       550                 obd=$(echo "$i" | awk -F"." '{print $2}')
       551                 if [ "$obd" == "num_refs" ]; then
       552                         continue;
       553                 fi
       554                 local tmp=$(lctl get_param -n ${i}.mntdev 2>&1)
       555                 if [ $? != 0 ]; then
       556                         continue;
       557                 fi
       558                 local disk=$(basename $tmp)
       559                 if [ ! -f /proc/fs/jbd/${disk}/history ]; then
       560                         continue;
       561                 fi
       562                 run_collector "jbd" jbd_collector ${i} &
       563         done
       564 }
      

      Attachments

        Activity

          [LU-11166] Remove all references to the /proc/fs/jbd2/*/history file
          pjones Peter Jones added a comment -

          Is this task complete with this landing?

          pjones Peter Jones added a comment - Is this task complete with this landing?

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/32858/
          Subject: LU-11166 tests: remove use of /proc/fs/jbd2/*/history file
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: dc9d71051c23d305db4430ce122e9752c3ce19dd

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/32858/ Subject: LU-11166 tests: remove use of /proc/fs/jbd2/*/history file Project: fs/lustre-release Branch: master Current Patch Set: Commit: dc9d71051c23d305db4430ce122e9752c3ce19dd

          James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/32858
          Subject: LU-11166 tests: remove use of /proc/fs/jbd2/*/history file
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: dc5ef6fea70ea581216ec0ed280b65a977bdca66

          gerrit Gerrit Updater added a comment - James Nunez (jnunez@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/32858 Subject: LU-11166 tests: remove use of /proc/fs/jbd2/*/history file Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: dc5ef6fea70ea581216ec0ed280b65a977bdca66

          People

            jamesanunez James Nunez (Inactive)
            jamesanunez James Nunez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: