Whamcloud - gitweb
LU-10964 build: armv7 client build fixes 94/32194/8
authorAndrew Perepechko <c17827@cray.com>
Sat, 28 Apr 2018 08:32:03 +0000 (11:32 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 21 May 2018 16:56:37 +0000 (16:56 +0000)
This commit is supposed to fix armv7 Lustre client
build, mostly 64-bit division related changes.

Change-Id: I93d83d577351c1a1053e39a162cb1e85fc4e8aa3
Signed-off-by: Andrew Perepechko <c17827@cray.com>
Reviewed-on: https://review.whamcloud.com/32194
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Alexander Zarochentsev <c17826@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
config/lustre-build-linux.m4
lnet/selftest/conrpc.c
lnet/selftest/console.c
lustre/ldlm/ldlm_request.c
lustre/obdclass/lprocfs_status.c
lustre/ptlrpc/import.c
lustre/ptlrpc/service.c

index 8967c01..d0e604e 100644 (file)
@@ -528,7 +528,7 @@ MODULE_LICENSE("GPL");])
 AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
 [m4_ifvaln([$1], [AC_LANG_CONFTEST([AC_LANG_SOURCE([$1])])])dnl
 rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
-SUBARCH=$(echo $target_cpu | sed -e 's/powerpc.*/powerpc/' -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/' -e 's/k1om/x86/' -e 's/aarch64.*/arm64/')
+SUBARCH=$(echo $target_cpu | sed -e 's/powerpc.*/powerpc/' -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/' -e 's/k1om/x86/' -e 's/aarch64.*/arm64/' -e 's/armv7.*/arm/')
 AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] LDFLAGS= ${LD:+LD="$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_CHECK_INCLUDE -I$LINUX/arch/$SUBARCH/include -Iinclude -Iarch/$SUBARCH/include/generated -I$LINUX/include -Iinclude2 -I$LINUX/include/uapi -Iinclude/generated -I$LINUX/arch/$SUBARCH/include/uapi -Iarch/$SUBARCH/include/generated/uapi -I$LINUX/include/uapi -Iinclude/generated/uapi ${SPL_OBJ:+-include $SPL_OBJ/spl_config.h} ${ZFS_OBJ:+-include $ZFS_OBJ/zfs_config.h} ${SPL:+-I$SPL -I$SPL/include } ${ZFS:+-I$ZFS -I$ZFS/include} -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
        [$4],
        [_AC_MSG_LOG_CONFTEST
index 56a6bde..e5d7787 100644 (file)
@@ -1252,7 +1252,8 @@ lstcon_rpc_pinger(void *arg)
                if (nd->nd_state != LST_NODE_ACTIVE)
                        continue;
 
-               intv = ktime_ms_delta(ktime_get(), nd->nd_stamp) / MSEC_PER_SEC;
+               intv = div_u64(ktime_ms_delta(ktime_get(), nd->nd_stamp),
+                              MSEC_PER_SEC);
                if (intv < nd->nd_timeout / 2)
                        continue;
 
index 45bcdfa..ee41bf3 100644 (file)
@@ -1708,7 +1708,7 @@ lstcon_new_session_id(struct lst_sid *sid)
 
        LNetGetId(1, &id);
        sid->ses_nid = id.nid;
-       sid->ses_stamp = ktime_get_ns() / NSEC_PER_MSEC;
+       sid->ses_stamp = div_u64(ktime_get_ns(), NSEC_PER_MSEC);
 }
 
 int
index 55b395c..014b67a 100644 (file)
@@ -1650,7 +1650,8 @@ static enum ldlm_policy_res ldlm_cancel_lrur_policy(struct ldlm_namespace *ns,
 
        slv = ldlm_pool_get_slv(pl);
        lvf = ldlm_pool_get_lvf(pl);
-       la = ktime_to_ns(ktime_sub(cur, lock->l_last_used)) / NSEC_PER_SEC;
+       la = div_u64(ktime_to_ns(ktime_sub(cur, lock->l_last_used)),
+                    NSEC_PER_SEC);
        lv = lvf * la * unused;
 
        /* Inform pool about current CLV to see it via debugfs. */
index 7a0003d..7a202e2 100644 (file)
@@ -2053,7 +2053,7 @@ static int str_to_u64_parse(char *buffer, unsigned long count,
        }
 
        /* the multiplier limits how large the value can be */
-       wrap_indicator /=  mult;
+       wrap_indicator = div64_u64(wrap_indicator, mult);
 
        if (strwhole) {
                rc = kstrtoull(strwhole, base, &whole);
index 3ecc4dc..363cf2d 100644 (file)
@@ -305,16 +305,16 @@ void ptlrpc_invalidate_import(struct obd_import *imp)
                  * out. Use obd_timeout if calculated value is smaller
                 * than it.
                 */
-                if (!OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK)) {
-                        timeout = ptlrpc_inflight_timeout(imp);
-                        timeout += timeout / 3;
+               if (!OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK)) {
+                       timeout = ptlrpc_inflight_timeout(imp);
+                       timeout += div_u64(timeout, 3);
 
-                        if (timeout == 0)
-                                timeout = obd_timeout;
-                } else {
-                        /* decrease the interval to increase race condition */
-                        timeout = 1;
-                }
+                       if (timeout == 0)
+                               timeout = obd_timeout;
+               } else {
+                       /* decrease the interval to increase race condition */
+                       timeout = 1;
+               }
 
                CDEBUG(D_RPCTRACE, "Sleeping %llds for inflight to error out\n",
                       timeout);
index 5f2322f..9625af5 100644 (file)
@@ -2102,7 +2102,8 @@ ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt,
                if (unlikely(ptlrpc_check_req(request)))
                        goto put_conn;
                ptlrpc_update_export_timer(request->rq_export,
-                                          timediff_usecs / (USEC_PER_SEC / 2));
+                                          div_u64(timediff_usecs,
+                                                  USEC_PER_SEC / 2));
         }
 
         /* Discard requests queued for longer than the deadline.
@@ -2189,7 +2190,7 @@ put_conn:
                DEBUG_REQ(D_ADAPTTO, request,
                          "sent %d early replies before finishing in %llds",
                          request->rq_early_count,
-                         arrived_usecs / USEC_PER_SEC);
+                         div_u64(arrived_usecs, USEC_PER_SEC));
        }
 
        ptlrpc_server_finish_active_request(svcpt, request);