Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11043187imu; Thu, 6 Dec 2018 10:34:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/U58Mv8K4UajQGsh0zBpguW5GmIidxC4b7Xc70Yjm8mmXgZ2qVW9Y6wlqKBszYuv8aqf9en X-Received: by 2002:a17:902:4d46:: with SMTP id o6mr27916501plh.302.1544121256916; Thu, 06 Dec 2018 10:34:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544121256; cv=none; d=google.com; s=arc-20160816; b=AqwQb2RiIo15PizovsY/RDNAObvUB3hADRODakUZ9GeTq/I1ev6eDtTeAGuBf5P7a5 UV4ZcA1YOrI/7QwMMXJ7EjUXKU7+PPAHqJ38YB8yiy7KxtpYtNqQDye6UTzoImg/sUe1 JdLIuvSaoIpC0Pz70Kv+mbIKdprr9cNwUtkaDLf13aHbTXCM5vy29sgbqs9ozwxe3QUO BhJTTP2fjoKTbD3sCFdL5bE3NdtMbbVWGA/+FychC89QGJDas7rxpsj2QiVOy6t0gP0v 1oj055o/kNoJvoqmRcg9T7Clzo2BwBmBUAJnXWUKlN9QUxSlhYMvqadLjlPIRJRffUN/ 6XcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qMDaoQejAB9ZGnzrYT/osbFoXrrFabNbm+K7/F6LbLw=; b=pw6xgHueKRyRunexy4I5T3gdG991g6+jKxoW+SsnAmCmoS5ukkbH/ztfuDQpbD/7tX lXqXJ+7ZP/jCfnpB3G8/7ekP+VyYm7lEC6tOc04XqbmV4ILB1/A0Ot5VksAcf3qmB0w1 n4u0wuuwAY+XB9dl2yLmjKvtkRNHgUtrrVo/HgsZb/tF2XpoOFOf32zp9VkXHC3H3t9W teMOTIftj1MfOLIdszkqhMIqnspl43rkfsH9vyR5TDlXNKsY7w85oZsYItcHVJZHsQ5A CtHVGA9sczqffQjUNAUNAcL/PKwQvedw1aOBzoibCxfbYSni4wjjcZ29Gx3tAP98JsGx 9XNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="Iqg84/XA"; 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 p14si812974plq.25.2018.12.06.10.34.00; Thu, 06 Dec 2018 10:34:16 -0800 (PST) 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b="Iqg84/XA"; 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 S1726028AbeLFSaw (ORCPT + 99 others); Thu, 6 Dec 2018 13:30:52 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45432 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbeLFSaw (ORCPT ); Thu, 6 Dec 2018 13:30:52 -0500 Received: by mail-lj1-f196.google.com with SMTP id s5-v6so1265222ljd.12 for ; Thu, 06 Dec 2018 10:30:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qMDaoQejAB9ZGnzrYT/osbFoXrrFabNbm+K7/F6LbLw=; b=Iqg84/XADlobWF3SZpv6o5m80DzeRc8kMD1tjHxHYPbt9m3n62jSvMqGponIBQKIrp K7/a5Dri1MlvhfVSItoW74ad9TeI1BwT3BbRqbDTvJt1YWN4Tq0Q4vhVJypozbGwBnfV bLsKx3uHlJuije//U5c1DK0EpVp33euiBlgkY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qMDaoQejAB9ZGnzrYT/osbFoXrrFabNbm+K7/F6LbLw=; b=TbdUGE8rEFqlndH9VGbpIzcmzxp2xsm1RrlHA1v/uuPeaaJTwLWCz9l5THwLR6up/J opCw5/sp4iMFRfpmxHJmbWatUTMcDaf0+oSyf1J0mHXuYi7JmKSeaLjUkr4iyZxpfg6L N/Io+78Vr1D13KkzxeufBss5imjMaRXJh3xC94FyyQXYBFpvpv+5eegBgpl5RBIIWyIr HoyRP0HyLd09s8zV2OH4mDX77qi2197YxCwwzFjBsEOLbZTvIDVhItoVk+4z4BjgAvf1 uQNNfg+nzFyTc+zzBa3aTBZXsf7Ig7b+HykILFE0yynSid63JMi3+5pse8Q8ZkOt7D5q 4+Jw== X-Gm-Message-State: AA+aEWYD5m0or8ZYKQLjV/9o7XpyrF4aVgNyIArpF8Tz5yUKC+jMgozw nUvlpY800M2606Onw0JYuSp/7xoSB44= X-Received: by 2002:a2e:20f:: with SMTP id 15-v6mr19256191ljc.172.1544121049935; Thu, 06 Dec 2018 10:30:49 -0800 (PST) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id r76-v6sm189125ljr.83.2018.12.06.10.30.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 10:30:48 -0800 (PST) Received: by mail-lj1-f172.google.com with SMTP id e5-v6so1310447lja.4 for ; Thu, 06 Dec 2018 10:30:48 -0800 (PST) X-Received: by 2002:a2e:9819:: with SMTP id a25-v6mr20873772ljj.6.1544121048107; Thu, 06 Dec 2018 10:30:48 -0800 (PST) MIME-Version: 1.0 References: <20181206153720.10702-1-hch@lst.de> In-Reply-To: From: Linus Torvalds Date: Thu, 6 Dec 2018 10:30:32 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC] avoid indirect calls for DMA direct mappings To: Christoph Hellwig Cc: iommu@lists.linux-foundation.org, brouer@redhat.com, tariqt@mellanox.com, ilias.apalodimas@linaro.org, toke@toke.dk, robin.murphy@arm.com, Linux List Kernel Mailing Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 6, 2018 at 10:28 AM Linus Torvalds wrote: > > Put another way, you made the fast case unnecessarily slow. Side note: the code seems to be a bit confused about it, because *some* cases test the fast case first, and some do it after they've already accessed the pointer for the slow case. So even aside from the performance and code generation issue (and possible future "use a special bit pattern for the fast case"), it would be good for _consistency_ to just always do the fast-case test first. Linus