Received: by 10.213.65.68 with SMTP id h4csp16666imn; Wed, 21 Mar 2018 11:17:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELsYUhpgkzHVs0tDBn6xqOYscqGmBt2uWXF83ELGsqO3/0PsRcSaDJx+JcTi/MjRix8GiRrD X-Received: by 10.101.82.195 with SMTP id z3mr15934393pgp.308.1521656221923; Wed, 21 Mar 2018 11:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521656221; cv=none; d=google.com; s=arc-20160816; b=kfmvpo3moDgkzWxlQ91Vf5I6AA71urtpPwYu/G6tqhs9Vln5fU775nXBuBzX5w8VTX fPNdtS76zSabZ5fqPKEZiJtb3ob8bRoRGZiaWIZjFj/fySWZUVtIc6+pDJivK6ZhoCUA UYapV5zH5mMvmov9DyuCppm7aRUWY09/cdUBy6YvP4pgLCIdbbr0tZRsh2xsIOLLPDZF 0Cj1Zf387GB10Fa3vnuaYTdq8vIb06qaaB7GEdYmJT+4MDYgTrJk5JayTTN/tw/GgNnX J+Gwyi40kl0NixxhZtxxjyfUijxMLwmikB4pW9s2mwNuMazb9qc63ouonwD4I+ePg2+1 LbFA== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=lyp+VgN/0mBxVU8UW2miOnejqw8ht5hYx3X335UvtfU=; b=bwmEHPenoiiynL1RvEc79XqgPVUC4SCCF93v4WCLiE+tMDERorZszUB6TOlgBA26vg aUTHSTpwzA5TZEyviSWq0QLvaM0F/vzIEoc6KNkIx5YdOuTJXYl81+Nzm9mQKhc0zPeR 6WPub0yuAB5rODZ1R8M8iPotS5noPR/3F19P+tN8qiQudZrchKThx+GGgtN85aohdTXW ESvnDRYvOC2gR7mhIJqGzvgYmC1T7uLqvOQ8fZtukGwo7zZekG8juu/bLdvtFQw+DJ48 HSLyvNfwLnQyVwUBVAfK+HehjRu1Oy9FNj1RAnnmNtO+oU1CqWYlR3KlDQnijea1bk8p L9MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=geLV3tAe; dkim=fail header.i=@linux-foundation.org header.s=google header.b=F2ApNVq1; 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 9-v6si4424119plb.140.2018.03.21.11.16.46; Wed, 21 Mar 2018 11:17:01 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=geLV3tAe; dkim=fail header.i=@linux-foundation.org header.s=google header.b=F2ApNVq1; 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 S1752616AbeCUSPh (ORCPT + 99 others); Wed, 21 Mar 2018 14:15:37 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:38133 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbeCUSPe (ORCPT ); Wed, 21 Mar 2018 14:15:34 -0400 Received: by mail-io0-f196.google.com with SMTP id b20so7771460iof.5; Wed, 21 Mar 2018 11:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lyp+VgN/0mBxVU8UW2miOnejqw8ht5hYx3X335UvtfU=; b=geLV3tAeT7VO4YYryKMpUfs+6+l/jlMkUt0h02Bj5f4/dR6MIFs8sCmk+t+lugS0Vr mwYbvoGeoHvOeGOsKOsrMZEEgUhsKwmhV+/9CGPyNWdO5C/fhPDasVXyWByUNW1Fbf0h LcpMzpsbmXquoCUkULCLqFQcL1erdqBCHf7pnbc0oWYWgDGwqxRLgbJ+5VeJjroaPLou R7Q1jQzka7MDNR75z7cl8Vm5PIdJmgxpao3rSFssrwsc9LjhZkzu0yrUfW8aQbjshfxB Xrqo2263fJPaHhaN/5SZkl+NNEr93cqrugo7bxUz3t3cgQw23eSRhwZyKbUzLX8kBRJK m8OQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lyp+VgN/0mBxVU8UW2miOnejqw8ht5hYx3X335UvtfU=; b=F2ApNVq1mghmmL0rAxex/DAoRzay150qtqQ5rxde1a4eYRm0JT7D8IBj5OSQ5o+isr KZPjkiE3pmkjArOny2PPFtq71cCJ+J8bX8vbk0iZe86vIbHnFz+rIywYep2YWi5iU+7x hNW36uDQNF7xS14p8s6etnd3NuqZu+4RVzYrU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=lyp+VgN/0mBxVU8UW2miOnejqw8ht5hYx3X335UvtfU=; b=of4iygUo6QbRCbnxeCrHKqMl3SA/UCMOpHp+qTCg1o1BFrdepXjZ5r/rhsAyhxaqiB HOJwwiKneEdkWFXxGML0QiQrBf0S4uyQsfxZlj8nr9Ep758gv0OFBjA0I/AQvsrg6tTB ooRo8VZDqQ906hjZnXmIvF4zoLXS9puUU0gl2vMJlt+GIyEx0v8ghaz+cQpmd7JqOOWp eFWYsx3UmGXGM4Mt9Lo5ul3LUUsvPXjj9JSmasvlpqnm+g4jgqnOkyJDQ+6rfyJCQXkd neowZJXRAIC+GyYM/TD5IONZRqqbVZbGV///FmwT0HLndZUaq1l/G1XcXxloeFNGCvIH jUeA== X-Gm-Message-State: AElRT7EdGsdVdBBwP9EC3ARBxxy7tn1M7/gyT67Nfue25HX5b204kH2B fu2U121/zwoDQnSHEVPgGox2JxboZ6hT/txOVTY= X-Received: by 10.107.12.201 with SMTP id 70mr22009872iom.48.1521656133052; Wed, 21 Mar 2018 11:15:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.95.15 with HTTP; Wed, 21 Mar 2018 11:15:32 -0700 (PDT) In-Reply-To: <20180321074634.dzpyjz3ia46snodh@gmail.com> References: <7f0ddb3678814c7bab180714437795e0@AcuMS.aculab.com> <7f8d811e79284a78a763f4852984eb3f@AcuMS.aculab.com> <20180320082651.jmxvvii2xvmpyr2s@gmail.com> <20180321074634.dzpyjz3ia46snodh@gmail.com> From: Linus Torvalds Date: Wed, 21 Mar 2018 11:15:32 -0700 X-Google-Sender-Auth: Sq0edLDRaZQ8jmfOFGtImab0SOA Message-ID: Subject: Re: [RFC PATCH 0/3] kernel: add support for 256-bit IO access To: Ingo Molnar Cc: Thomas Gleixner , David Laight , Rahul Lakkireddy , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "mingo@redhat.com" , "hpa@zytor.com" , "davem@davemloft.net" , "akpm@linux-foundation.org" , "ganeshgr@chelsio.com" , "nirranjan@chelsio.com" , "indranil@chelsio.com" , Andy Lutomirski , Peter Zijlstra , Fenghua Yu , Eric Biggers 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 Wed, Mar 21, 2018 at 12:46 AM, Ingo Molnar wrote: > > So I added a bit of instrumentation and the current state of things is that on > 64-bit x86 every single task has an initialized FPU, every task has the exact > same, fully filled in xfeatures (XINUSE) value: Bah. Your CPU is apparently some old crud that barely has AVX. Of course all those features are enabled. > Note that this is with an AVX (128-bit) supporting CPU: That's weak even by modern standards. I have MPX bounds and MPX CSR on my old Skylake. And the real worry is things like AVX-512 etc, which is exactly when things like "save and restore one ymm register" will quite likely clear the upper bits of the zmm register. And yes, we can have some statically patched code that takes that into account, and saves the whole zmm register when AVX512 is on, but the whole *point* of the dynamic XSAVES thing is actually that Intel wants to be able enable new user-space features without having to wait for OS support. Literally. That's why and how it was designed. And saving a couple of zmm registers is actually pretty hard. They're big. Do you want to allocate 128 bytes of stack space, preferably 64-byte aligned, for a save area? No. So now it needs to be some kind of per-thread (or maybe per-CPU, if we're willing to continue to not preempt) special save area too. And even then, it doesn't solve the real worry of "maybe there will be odd interactions with future extensions that we don't even know of". All this to do a 32-byte PIO access, with absolutely zero data right now on what the win is? Yes, yes, I can find an Intel white-paper that talks about setting WC and then using xmm and ymm instructions to write a single 64-byte burst over PCIe, and I assume that is where the code and idea came from. But I don't actually see any reason why a burst of 8 regular quad-word bytes wouldn't cause a 64-byte burst write too. So right now this is for _one_ odd rdma controller, with absolutely _zero_ performance numbers, and a very high likelihood that it does not matter in the least. And if there are some atomicity concerns ("we need to guarantee a single atomic access for race conditions with the hardware"), they are probably bogus and misplaced anyway, since (a) we can't guarantee that AVX2 exists in the first place (b) we can't guarantee that %ymm register write will show up on any bus as a single write transaction anyway So as far as I can tell, there are basically *zero* upsides, and a lot of potential downsides. Linus