Received: by 10.213.65.68 with SMTP id h4csp1571815imn; Mon, 19 Mar 2018 07:45:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELsP0elr6c9Na1pp7ZAVxVxL9Z3HzeHLekAU99FSdUBdwtQttNIaTFT+UNUMzcEUeSjQM6K4 X-Received: by 2002:a17:902:6589:: with SMTP id c9-v6mr8398122plk.215.1521470715486; Mon, 19 Mar 2018 07:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521470715; cv=none; d=google.com; s=arc-20160816; b=kYapFI73ZgPpsFgMwTjneSi+w35J7gewlxj7Hnxnu+bwP0PEOZ5BAmPjzxesTRlZt+ T3ZKFd07VoLmwJ5/xJ39NhVWdEf9LnbqXbKNJgtohHUSOiATy2SYYtb4uqz/2XbSz46e 2P6yrI/6LwYaC94iFk5UudQ20GoPp2ejhAc54NtIYtcCbqVIi6xpMxReVnwRImgxAHL5 zlJBL+Dpy3rKoCqAFYJdS8ykrRfNL6ZvoLl7tzS3O7+KWaf47/lhBf933M2ElrBp7pXi NuHSvwTnWTXNi+RhZ+I7RGw1D/uxsYHjQamgLBlZcVi1cKLIKN5nk22TvoRHOhDHC/04 ofPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=mieIjkA1l8kyAnzv9u6kqCcM0AOgRQ20Lk88NKCJdhs=; b=tFRkbk6oiLjdaCqaUMDngFAGtmQ5s6DcgA+Y9J8wq1Fo4uRXrY2uDmCY1dzudxCvUl L4+Uy+uUcS2kLhB8+tLzWsS795bGbCa1ZAOXN/b5kqo16oLUtnkKNCPLdNmobKQzW9Na 30sVoqWNRkvYtOyshDJfhugDPU6HcPKP5Fu30hTGfw0cro0wC+bZ1aU4S9mpBC1sbZ0Y DggT/AiushvmSWd1mojJLoWhPF0Kf7vYK+ljxxIz6yyhtkJIkECUielAGLL07KvXRoVu 1ElqRTcIJvvkemkrNp+fBoE02PsB/YHTEG3Qpp1rwn5js6uxGcISwBagxAV6VgZ/zp3m 2+gA== 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 w9-v6si99592plq.318.2018.03.19.07.45.01; Mon, 19 Mar 2018 07:45:15 -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 S933638AbeCSOnS (ORCPT + 99 others); Mon, 19 Mar 2018 10:43:18 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:60410 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755243AbeCSOnP (ORCPT ); Mon, 19 Mar 2018 10:43:15 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1exw0E-0000vW-Qz; Mon, 19 Mar 2018 15:43:11 +0100 Date: Mon, 19 Mar 2018 15:43:10 +0100 (CET) From: Thomas Gleixner To: Rahul Lakkireddy cc: 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, torvalds@linux-foundation.org, ganeshgr@chelsio.com, nirranjan@chelsio.com, indranil@chelsio.com Subject: Re: [RFC PATCH 2/3] x86/io: implement 256-bit IO read and write In-Reply-To: <6ec3e7e0c70e85a804933f27bb4275d5363c044b.1521469118.git.rahul.lakkireddy@chelsio.com> Message-ID: References: <6ec3e7e0c70e85a804933f27bb4275d5363c044b.1521469118.git.rahul.lakkireddy@chelsio.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Mar 2018, Rahul Lakkireddy wrote: > Use VMOVDQU AVX CPU instruction when available to do 256-bit > IO read and write. That's not what the patch does. See below. > Signed-off-by: Rahul Lakkireddy > Signed-off-by: Ganesh Goudar That Signed-off-by chain is wrong.... > +#ifdef CONFIG_AS_AVX > +#include > + > +static inline u256 __readqq(const volatile void __iomem *addr) > +{ > + u256 ret; > + > + kernel_fpu_begin(); > + asm volatile("vmovdqu %0, %%ymm0" : > + : "m" (*(volatile u256 __force *)addr)); > + asm volatile("vmovdqu %%ymm0, %0" : "=m" (ret)); > + kernel_fpu_end(); > + return ret; You _cannot_ assume that the instruction is available just because CONFIG_AS_AVX is set. The availability is determined by the runtime evaluated CPU feature flags, i.e. X86_FEATURE_AVX. Aside of that I very much doubt that this is faster than 4 consecutive 64bit reads/writes as you have the full overhead of kernel_fpu_begin()/end() for each access. You did not provide any numbers for this so its even harder to determine. As far as I can tell the code where you are using this is a debug facility. What's the point? Debug is hardly a performance critical problem. Thanks, tglx