Received: by 10.213.65.68 with SMTP id h4csp888442imn; Thu, 22 Mar 2018 10:45:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELvwaVb+o59EslUjpJukp0sl3QYS/5DvFCjIOUdgFCTYCdr8BOB/Moe40beGIkckaJTpot1G X-Received: by 10.99.119.78 with SMTP id s75mr18910047pgc.238.1521740755931; Thu, 22 Mar 2018 10:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521740755; cv=none; d=google.com; s=arc-20160816; b=VGdeCb99i0xSzJKyw4bLm6NK/tzvTu9QpfTM57hJgriI3HUOYMVyD9QVpnnuVVuSCa PKi2t6IPKowwKK/eaXXhoJ/bqzgeXevC4vBNYHzZVGz7bImQvhN2COvzpqBxcqaoklv/ +IWBGRm2f5l5bbvtl5tNfXadze+tx09HS5oMnKo+Ypd3hMisbYdXyxzuJMYxQPRa32Fr oWlacxvt9UobiRCV1SrPNRHp8HGdDVb+6ZAg8mx1DK5myDAWtqvbVtn3/KztVD9WeDBP iUXLuo11yNOWNePFxbzfkM4v13UTs3EMj/tTkTw3uxpofx78bh19U16tcRJ9UYa1dMCX 14sg== 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:dmarc-filter :arc-authentication-results; bh=Lj1yKk46VPCPg1LwOYITUOzU/B1K+yuMTRAvsY3a/Qg=; b=oWMaJeAipBnYeSsNyqIGMM5PBhJ3tSz4lwWeMPp4vwhSdg9s30II5t5JFg+DVgZ3Dq DcQTFdr37HmvLo5TfwmtiwSDBTTwMKWa1eSglK9kR7pToYL+eknj2sl/TlqkvRKLW9+8 39JIwG5nbUJEe+51DRlf4wcjLXW6Fta/Gz+sT+Fk3EOPFlQV9HguroSjA4SNmWzr83f4 yh/O6OZWWS5aSoo1TTV7/M6RJ2VpI6SXjZ+uneMjkiUUvo0nsS7cvfOPQjenC1yQ0vhN TVNF1LLtHkK6IGTVlsUGye47tz685XzYpu9qmzblXgWlqMfyFonOcOY3kZHnfkipEpaC 3n+A== 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 s13-v6si6509449plp.664.2018.03.22.10.45.30; Thu, 22 Mar 2018 10:45:55 -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 S1751847AbeCVRo3 (ORCPT + 99 others); Thu, 22 Mar 2018 13:44:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:38740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbeCVRo1 (ORCPT ); Thu, 22 Mar 2018 13:44:27 -0400 Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1259D21848 for ; Thu, 22 Mar 2018 17:44:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1259D21848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-io0-f173.google.com with SMTP id m83so11965101ioi.8 for ; Thu, 22 Mar 2018 10:44:27 -0700 (PDT) X-Gm-Message-State: AElRT7ETp0+KpYfIPfGNpsierOflak3Gf7y9w89bqFngwhgm0JjjnSjD CemAp4Yc/wytkh+5I7pELpFN+3co0+Xf559oHEwpDw== X-Received: by 10.107.138.88 with SMTP id m85mr21484671iod.150.1521740666325; Thu, 22 Mar 2018 10:44:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.137.70 with HTTP; Thu, 22 Mar 2018 10:44:05 -0700 (PDT) In-Reply-To: <20180322174024.tuillc5ojh4oadf4@ast-mbp.dhcp.thefacebook.com> References: <7f0ddb3678814c7bab180714437795e0@AcuMS.aculab.com> <7f8d811e79284a78a763f4852984eb3f@AcuMS.aculab.com> <20180320082651.jmxvvii2xvmpyr2s@gmail.com> <20180321074634.dzpyjz3ia46snodh@gmail.com> <20180322093343.aatl3prhheha4dlm@gmail.com> <20180322174024.tuillc5ojh4oadf4@ast-mbp.dhcp.thefacebook.com> From: Andy Lutomirski Date: Thu, 22 Mar 2018 17:44:05 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 0/3] kernel: add support for 256-bit IO access To: Alexei Starovoitov Cc: Ingo Molnar , Linus Torvalds , 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 , Daniel Borkmann 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, Mar 22, 2018 at 5:40 PM, Alexei Starovoitov wrote: > On Thu, Mar 22, 2018 at 10:33:43AM +0100, Ingo Molnar wrote: >> >> - I think the BPF JIT, whose byte code machine languge is used by an >> increasing number of kernel subsystems, could benefit from having vector ops. >> It would possibly allow the handling of floating point types. > > this is on our todo list already. > To process certain traffic inside BPF in XDP we'd like to have access to > floating point. The current workaround is to precompute the math and do > bpf map lookup instead. > Since XDP processing of packets is batched (typically up to napi budget > of 64 packets at a time), we can, in theory, wrap the loop with > kernel_fpu_begin/end and it will be cleaner and faster, > but the work hasn't started yet. > The microbenchmark numbers you quoted for xsave/xrestore look promising, > so we probably will focus on it soon. > > Another use case for vector insns is to accelerate fib/lpm lookups > which is likely beneficial for kernel overall regardless of bpf usage. > This is a further argument for the deferred restore approach IMO. With deferred restore, kernel_fpu_begin() + kernel_fpu_end() has very low amortized cost as long as we do lots of work in the kernel before re-entering userspace. For XDP workloads, this could be a pretty big win, I imagine. Someone just needs to do the nasty x86 work.