Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp254478lqc; Thu, 29 Feb 2024 17:03:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW5jOBm4HT66q0WfwJuIKGpqox82YdXjQVRKB8Lfhr+3ah9KAkYnprEHYEqPnzfBlydh4Pdp70k+HZ9thhyBU/BHr+Ws+ElP0LDzNKwqw== X-Google-Smtp-Source: AGHT+IEzddlEvtfB7BznOY4T2gmueUfPtxFUCcB4QOouZVivZTVEsI8vKDiWDLUJmyp2CnjS/YPz X-Received: by 2002:a05:6a00:2d09:b0:6e5:7a06:5a19 with SMTP id fa9-20020a056a002d0900b006e57a065a19mr410375pfb.17.1709254995265; Thu, 29 Feb 2024 17:03:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709254995; cv=pass; d=google.com; s=arc-20160816; b=wbJoCKHblFbW6fQd4doG9OT4J0ppN+o+v9BHwhbbitvSwus7FBcteNtlI/g7oH2N8e TQBN3CxoIvyOxkrPK60I+NgCAG/3amkdEvMq5FFchX749beR3hXlDwxi/bA2SdGKv/G6 W6xtEW0ZWkuWrP7gAJDwQpEvqg01tB5nNlv9xCWzq1ET4tlo5vl6T+LGglrU3zgnmLqe TVLHMqE4dPowBX8MNFcOs5oNRHNCMXFAATfnriazLA4i+tf5qW30xlOCt6Q5sKmKCErc EMhvRWNnBX11r/sMDEaWsZh2TX+LlgtWJ0hFj+aaNnM5Ts8OPwSLRDvqOoj2yiZ9nxUB EC6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:references:in-reply-to :user-agent:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=05MZYy4lDluBOriklmJ4PdhytCgIptWMcjTspjOqH2I=; fh=1lmuCrZII2doxuaOIEb0qZeheqfarXfQ7kAIxJzcVjc=; b=YlrOlLcMdkREeziEaV5ZvG3U+r3A8VX0Zy3/ktvwouJRSk9c4iGzd1ir26nfE0nbuB Htiw7tCmNgYOsyQFrz03rl6uNdnLpNpNVj5KM+duSXwwZFWumjTPSJutYsxizXKmE8Mp 34Nszq5fWHWZuV12nC5vkd6voNWfAS/wk/7jYuW3fIc2LVFFGl9q4cV0piuUsy9bxehi 63dnuYI0haEElc1QSLGof8Kn8TuvNSM6RAus3mRucf+loCzrVkjlZyUWZ2UQyeOcrw2t BSDsDtfd0ABGGJjutadqFtRLPe8Udz1Kcx4bOJBOu3dICNGSVQrX/AjNPJWL5kEiWEJG KTYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@zytor.com header.s=2024021201 header.b=Q0z8rjuy; arc=pass (i=1 spf=pass spfdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-87752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87752-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a17-20020aa78e91000000b006e5736fa38asi2381645pfr.260.2024.02.29.17.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 17:03:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@zytor.com header.s=2024021201 header.b=Q0z8rjuy; arc=pass (i=1 spf=pass spfdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-87752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87752-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C1E33B21FB4 for ; Fri, 1 Mar 2024 01:03:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 357F62B9C4; Fri, 1 Mar 2024 01:03:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="Q0z8rjuy" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EEEB2AE91 for ; Fri, 1 Mar 2024 01:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709254984; cv=none; b=usggtJC8LYkQmj93ybT64xDE/zegY9h/nirpMdYw3oopM1sh4bf+hDIjN2ytQAWvTEFeYtnL0L5R6/Y7dDqJmUVlPH/f65AlZKH4Ts0EEIur1STMJgbZpTOMRRtx4yZiTlBtyjvnse0REfjMY2j2rF1qQsyFAsmbfnDHEeV7CHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709254984; c=relaxed/simple; bh=05MZYy4lDluBOriklmJ4PdhytCgIptWMcjTspjOqH2I=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=QkwAQwNDw4ritJ2u1EcEXSpGt7PBAaLoL3Qk33DZM9QZHU8+gN+sN43FNMHCRYkP4I0LSVU9wuMRNgQ2FroVosGV1owVooCg0QRQR9Z6cSOuveyCWUQxqAfSLt0YnZaphgsr2hqxyYOnY42pxuMsTuQrnFsISlbcGbvnsbJ0G+c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=fail (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=Q0z8rjuy reason="signature verification failed"; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [127.0.0.1] ([76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 42111jqq3251933 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 29 Feb 2024 17:01:47 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 42111jqq3251933 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024021201; t=1709254907; bh=05MZYy4lDluBOriklmJ4PdhytCgIptWMcjTspjOqH2I=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Q0z8rjuyYpIgo8y/BO5JvUzXwUsSMj1zmSwiHAPkj4SgseuKS3l4SNUsXOfjC0weF zKE5Dqi46WDpFtyvnAWq4D8bSkK8zikXejdRLcn/3F9DcUIWKRmjQoDbjqUQnfykE1 763vNAXyjIhGC5u4HVxTx8pfyl3ApcL8Bz5XDHMrRk/0Itx+O2fYsPaNu4iHl+fEfr hdr0CgqrK+z+ZZou9h+URYHmEZq5830ZGVKwfrEp4PSAeWx+vXR0jLA1fJq0SyZXj+ RScA04ADCRFOlx+YB9EDh2dcw9W6e2V9eUbrAqBcRymnU+P9u+fL5efyD5HNnXmpES mT3UIc3R3L7bA== Date: Thu, 29 Feb 2024 17:01:43 -0800 From: "H. Peter Anvin" To: David Laight , "'Thorsten Blum'" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "x86@kernel.org" CC: "Peter Zijlstra (Intel)" , Wei Liu , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] x86/apic: Use div64_ul() instead of do_div() User-Agent: K-9 Mail for Android In-Reply-To: <7e46123775e64898bd7c467328125ee0@AcuMS.aculab.com> References: <20240227114333.1718-2-thorsten.blum@toblux.com> <7e46123775e64898bd7c467328125ee0@AcuMS.aculab.com> Message-ID: <96394DFF-43D7-4877-AA47-FC847FD26184@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>=20 >> Change deltapm to unsigned long and replace do_div() with div64_ul() >> which doesn't implicitly cast the divisor and doesn't unnecessarily >> calculate the remainder=2E > >Eh? they are entirely different beasts=2E > >do_div() does a 64 by 32 divide that gives a 32bit quotient=2E >div64_ul() does a much more expensive 64 by 64 divide that >can generate a 64bit quotient=2E > >The remainder is pretty much free in both cases=2E >If a cpu has a divide instruction it will almost certainly >put the result in one register and the quotient in another=2E > Not on e=2Eg=2E RISC-V=2E