Received: by 10.213.65.68 with SMTP id h4csp421765imn; Tue, 20 Mar 2018 06:35:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELse9bDyXSG5tL4lwCn2C6SyG0psSAwvMNi/Vi2/1NazWEQ86O7MuEaETaykw+RP2kpoDcLQ X-Received: by 10.99.95.75 with SMTP id t72mr12116648pgb.411.1521552958057; Tue, 20 Mar 2018 06:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521552958; cv=none; d=google.com; s=arc-20160816; b=wPOUdKzPgei+7iaWQ5RyyrLL8eGOyMhOzy6Of502a18iOCtZrOYqlX6v5vxhfR9Ns1 oVwEzUJB6+BsK95+SI8Q+qa8au8j3mLvrLjKfw5Qw2mHj5H2i36J9ZPe8GQnZhYlyND5 jPJAkieLsYrEHFGyjoAuhFTpDpcgJbmiAYAOq4c458B7zTUZ1WKBxgcllzQUeI85fqeK YB/NlhllHqy/u/0G0YZjrxB+T2C3u388pOVsyQ0vHdbdH9rmig2j0AVb4PXvN6pde7ET EHbfFa9kxR+6+uWJgeJ2GLyi4nAT3rgpybkv8yyF9kR1UzIOVb69s6XCVTVUysRSL7T+ Qohg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=j6T/+ibO1tp2a1fjRPx8mPKXz+Ky/RgBW9+klG3do7Y=; b=yLREeqZG5vfGM4U+tcN+0WL38GKVKk0VR12NsRMK+OfRLDz+I3mdIL186+EpyzZCNH PoVEALIvc6i8IHV72EmuL7VMYhKZouIS3UxHpeL2tJia774/JaE0wtCH6uotZqUn9VA0 q3DskVVushpRrKK8yUwQbpcwBKIB+3PnQJpywIbHVRPBP759nsZtl8dY5uv8jRaDrn0q ZSCph3xranSne/uhPg7oja0zuqo44UY5ry72AnvxZ3+nNnSWXkDGyrNS50nv8Dz4B8hn 6PeWNvxL3A6eqMO8jGkUgS3YRSeXmYrIOcxv0m+pja8hudR3o3uuUItj9MgkKqr0NRQK UBLQ== 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 1-v6si1648487plj.247.2018.03.20.06.35.43; Tue, 20 Mar 2018 06:35:58 -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 S1753682AbeCTNdQ (ORCPT + 99 others); Tue, 20 Mar 2018 09:33:16 -0400 Received: from stargate.chelsio.com ([12.32.117.8]:10888 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753663AbeCTNdL (ORCPT ); Tue, 20 Mar 2018 09:33:11 -0400 Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id w2KDWjra021413; Tue, 20 Mar 2018 06:32:46 -0700 Date: Tue, 20 Mar 2018 19:02:07 +0530 From: Rahul Lakkireddy To: Thomas Gleixner 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" , Ganesh GR , Nirranjan Kirubaharan , Indranil Choudhury Subject: Re: [RFC PATCH 2/3] x86/io: implement 256-bit IO read and write Message-ID: <20180320133206.GB25574@chelsio.com> References: <6ec3e7e0c70e85a804933f27bb4275d5363c044b.1521469118.git.rahul.lakkireddy@chelsio.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, March 03/19/18, 2018 at 20:13:10 +0530, Thomas Gleixner wrote: > 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. > Ok. Will add boot_cpu_has(X86_FEATURE_AVX) check as well. > 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. > Sorry about that. Here are the numbers with and without this series. When reading up to 2 GB on-chip memory via MMIO, the time taken: Without Series With Series (64-bit read) (256-bit read) 52 seconds 26 seconds As can be seen, we see good improvement with doing 256-bits at a time. > 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. > On High Availability Server, the logs of the failing system must be collected as quickly as possible. So, we're concerned with the amount of time taken to collect our large on-chip memory. We see improvement in doing 256-bit reads at a time. Thanks, Rahul