From patchwork Tue Jul 10 15:21:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141518 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4020638ljj; Tue, 10 Jul 2018 08:22:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfieYOO07BRTSAYYagj8teb4ZLTc0K6iO3uOuVGbsop+Nxp7KrgTaMEJUWdf0zAZjcKwoRw X-Received: by 2002:a17:902:bc8c:: with SMTP id bb12-v6mr25368783plb.84.1531236120631; Tue, 10 Jul 2018 08:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531236120; cv=none; d=google.com; s=arc-20160816; b=RpV1V321KUpc2RKOHbeEMoeq4QAArmPvwJ0AY2na+o4QiovJRxZTsv2cGLGGX8QMt4 S4nOWUjZAl7PUosMPmlxzatrqR9gHB1x8v+88a1FCHCY20kjbna2u9t7vLt+0s7K7mQu rKPVatpxzevbocldRq180JrEttuBBsuIO08uq7eJu2POAXZcYgivYRmS7Isp7UxyKr3D A4SEKeXgTQgj/uCtzfa++n4QuPeoQ6nWW3FsKhFmn8HrUjLN5nvYwdGPEsMy/A7dGAV1 SS7yFeDEK9QK+2gbcENPzerG9CAtfnU7+JImIcMsQfKTRvlIEDJf5uRfGKSeSmgH+E12 AD6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dSTb+yBYkPj+3y8KOwyhsjHb2CgGeIljMeZfOb+W8Mc=; b=VVopQvMCLn5Ds38hAAyYhorMgP6gh4p9ZMxiDl1EstCAzFDBZqG6cSspiHO4zzB3c8 q3NgGJIK/Xshz13mdjk4ZsSe00m6qUVLUHNHXiQjYrNB18+ChEdyq00qX/CRT9nTAUJP XgPQUABf2Zf6Njjm9V9edh5LN2Cy+LsMhSDjRxAg6fqaZ7z8XdtDPHCQ04Jjv7YrCje2 YSkHIQ0BOSgaTaoDYOI38FvpsX8NgkF+R2c5uCAGuVmxmE/FUntZlBK3V6yfLczhLGg9 0jWJXcFC2BBtX1iy38hny70emmGOzJR57gsLw0w6gTnO0Ql0X/3Upc4iUMuy7CRut4Zz 4DHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2-v6si16709040plp.459.2018.07.10.08.22.00; Tue, 10 Jul 2018 08:22:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934236AbeGJPV5 (ORCPT + 15 others); Tue, 10 Jul 2018 11:21:57 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:40773 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934064AbeGJPVz (ORCPT ); Tue, 10 Jul 2018 11:21:55 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0LibhV-1gDKbe2WGz-00cyuN; Tue, 10 Jul 2018 17:21:47 +0200 From: Arnd Bergmann To: Jens Axboe Cc: Arnd Bergmann , Tejun Heo , Josef Bacik , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] block: iolatency: avoid 64-bit division Date: Tue, 10 Jul 2018 17:21:34 +0200 Message-Id: <20180710152146.2371336-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:XyocjbQFefAhj3c/bBIEQ15lCKAaGoxSg9237vfr9dEN8XZkfbU WWAZf6Waok7o8dp+g/lNtmVlOs7p+HurBsmWWBfKrH2zZR49JuCxrovK7Bg5Ac7cFDsPkEY o0XbBwSKrybbDNcjo9oUolaIrUvNZwUxYoBSStaS9oM8DuB6mB7ySZObAm4tuezVgHVZVtI ell4rX/Idyevjig3J3qQQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:+9NDxLDRql0=:f1V6LWvmkqTjc91JNmh/X9 950MUw3uL5eSP/jsn+IJqmlkALQ1DEfwvLdENF9Gsf2dm0oSeXPDJ0x22K8dA+oPz3GaPtKxT KDYc97/lfqN+66RzZJICZf5xJ89v8+h9gc9pTlntxLc5d7cD6Z2fhmXGfLJ+Z2bLYOXEN8+6i fsZuOmupy8vQkqHduUqKyZRZ+4SGhW+gyMEm272mU8vWaIiWk1XMDI4qTlDg1lq+R18G749De PizaabuzHdHiF5t/nPtnEMAK2RUuR9ssP4Xk6iaUSw1uHJSNC0Dqm5w3WZACbPsq85dczmOyo Ttat7HWuQtgrbTSiRzmnugMSCI7V1bJ+freExm82theUsJixhUw5HsXLawJl7RtuUtSli53t9 cms1XY/IcV7RMn8MyrwtcW3KWLLdEYKLksPvqEAusQZ0IzmMGRBpY3+ghORaGBTOJNpJaPFfY yky9Q8bfuPMt3pB+3rMjFluZrSXU4wtNZS7nudsIcybgW6S3LezQOJXsZXySGXWIrqmXkHOnQ lToVDyKCy1ptxoBG5MrCtmksgfkpr8fyaE7Xmuq60Vhii+wZoszWS8LL22+T5rK8p7VEmquAn UZmeFwrwssQDmJjlTeqfKSLM19aZmynKIwvBLevv7+TvuntA+/m6T28R4tjvT6rZh+LDTHQqB BHJ6FDpe+2sjI2MR1XNDdMWsncDEYtKreVWviEoc40p6LJ05ZeQBxnOzi6+3w0HttiMY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 32-bit architectures, dividing a 64-bit number needs to use the do_div() function or something like it to avoid a link failure: block/blk-iolatency.o: In function `iolatency_prfill_limit': blk-iolatency.c:(.text+0x8cc): undefined reference to `__aeabi_uldivmod' Using div_u64() gives us the best output and avoids the need for an explicit cast. Fixes: d70675121546 ("block: introduce blk-iolatency io controller") Signed-off-by: Arnd Bergmann --- block/blk-iolatency.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.9.0 Reviewed-by: Josef Bacik diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index a35a1f580337..56ddb2c68752 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -798,8 +798,7 @@ static u64 iolatency_prfill_limit(struct seq_file *sf, if (!dname || !iolat->min_lat_nsec) return 0; seq_printf(sf, "%s target=%llu\n", - dname, - (unsigned long long)iolat->min_lat_nsec / NSEC_PER_USEC); + dname, div_u64(iolat->min_lat_nsec, NSEC_PER_USEC)); return 0; }