Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp228350imm; Wed, 12 Sep 2018 22:04:10 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb+BYccz/V3uD6/sOt5DHTpFlMs/WjR7k+EKmsO/tN4OU8fvngG5nxi7Bb0uR6NQQRjalkm X-Received: by 2002:a62:3ac8:: with SMTP id v69-v6mr5578244pfj.164.1536815049899; Wed, 12 Sep 2018 22:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536815049; cv=none; d=google.com; s=arc-20160816; b=SVbo3G0D+fnAcDGwnCIXOEVAr3LDxDUy33Kx7gcIGJ4j7FtbKCB17gSz+loceoIWr6 NThwuVjagtYbJiAd3sbcS/Phg02pHvITrb94i24PN+LeGmNakRRUJGQyUNLP+6HQvbfc BWlrHbM8FniEM4+zXRHJhVbnx9atOZtu9VawV1ZKiJ+gWVcjLrGXYKY1xWdmSqzH6AlL pKhKlrlEyPIg6BakpOcQFrWPjlIrZjbOfg2X1JxC+fX2zaVsS/1zGhBDse6L01Nuemj3 deCi9uttjWsK8/MN0eR+B0sbCHzE/ePZe5ZsabUD+YSqeARVviZZdVmj6LFhW4P2KVOV Ktrg== 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; bh=undvJuAKg0YGtaTgvnDI6Cs3LaMA2TMg8Huk4mvm/QA=; b=xGXF7lXd75GzO8uACARVpP4H2traKr0ezLxRy/aQfB3ODwd1XjL30eNALrByKaIifc znxn8EFqfWCjwiOeugN7BC/raIMLi+58TmlJlDanuDgtLXUqBLLydcCKAfF2BQ07oJQe iv29qcLkhO9egd7tADVDreJL/Kvzl7BfHcR6982HErl/l9I6IDytkzoVpQrxXf170YDa z+HIclhfvESlVmDcrE9qYdHVOxgI0rDTWhrIcEstHHj66k8MN1yY+PcH6NpmfJnjvDzO Zu6TJdQwqeWAtcoONM+2gPLgTxLt62r7TNv6uKcIN2Z5647gGms01RbnkhkergMg2H8u c8LA== 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 a1-v6si2840445pgq.387.2018.09.12.22.03.55; Wed, 12 Sep 2018 22:04:09 -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 S1727566AbeIMKKy (ORCPT + 99 others); Thu, 13 Sep 2018 06:10:54 -0400 Received: from aws.guarana.org ([13.237.110.252]:49608 "EHLO aws.guarana.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727194AbeIMKKy (ORCPT ); Thu, 13 Sep 2018 06:10:54 -0400 Received: by aws.guarana.org (Postfix, from userid 1006) id BFD2BA146F; Thu, 13 Sep 2018 05:03:01 +0000 (UTC) Date: Thu, 13 Sep 2018 05:03:01 +0000 From: Kevin Easton To: "Jason A. Donenfeld" Cc: LKML , Netdev , David Miller , Greg Kroah-Hartman , Andrew Lutomirski , Thomas Gleixner , Samuel Neves , linux-arch@vger.kernel.org Subject: Re: [PATCH net-next v3 01/17] asm: simd context helper API Message-ID: <20180913050301.GA26367@ip-172-31-15-78> References: <20180911010838.8818-1-Jason@zx2c4.com> <20180911010838.8818-2-Jason@zx2c4.com> <20180912061433.GA8484@ip-172-31-15-78> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 12, 2018 at 08:10:41PM +0200, Jason A. Donenfeld wrote: > On Wed, Sep 12, 2018 at 8:14 AM Kevin Easton wrote: > > Given that it's always supposed to be used like that, mightn't it be > > better if simd_relax() took a pointer to the context, so the call is > > just > > > > simd_relax(&simd_context); > > > > ? > > > > The inlining means that there won't actually be a pointer dereference in > > the emitted code. > > > > If simd_put() also took a pointer then it could set the context back to > > HAVE_NO_SIMD as well? > > That's sort of a neat idea. I guess in this scheme, you'd envision: > > simd_context_t simd_context; > > simd_get(&simd_context); > simd_relax(&simd_context); > simd_put(&simd_context); > > And this way, if simd_context ever becomes a heavier struct, it can be > modified in place rather than returned by value from the function. On > the other hand, it's a little bit more annoying to type and makes it > harder to do declaration and initialization on the same line. Yes. It's also how most get/put APIs already work in the kernel, eg kref_get/put (mostly because they tend to be 'getting/putting' an already-initialized object, though). - Kevin