Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp283931pxv; Wed, 30 Jun 2021 05:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWluD/Ze0YEr9PjrbORH1y5pG4+uMp3tdde3/zosp40WXfdodQLlr17OtGsFqnF70G72xF X-Received: by 2002:a92:6e07:: with SMTP id j7mr25380605ilc.296.1625056999392; Wed, 30 Jun 2021 05:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625056999; cv=none; d=google.com; s=arc-20160816; b=Pokq1wi4bOB2hqvctFTEnF5/EQQPMH9LNBJplQEOVGLKHBU7r/kvz9+pNpaxjO46nx +1AUUX+WNwhrQrpT/LJGAI18P64KWg35BdhGShcO6b+9SSJ1PUP1yx592D1hO8tEg4VP nUW5eBKK7ShK6YxP4sG1Vi85w9D3qCksju56tqw0zjLfVagv/yWSyf0KZivDMSkVG8V7 LqhMGd0KUDwioic2CJ90S2TFO5azErozPuCwLrbn1slhMU4Cdo0TRTp5vEgwkGo0B1tG RaxZwBLyM5JbzTGdKHpMpws2f35i0vAEzQKMEilj4Me/D4nPAg/FZZrR71zaUZx/WyqD 5edA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=GmNRbsLxsFMv7uTaZH5CyyCjYgPn0oHhltKQ2yewcaA=; b=U4BuJ+ra096jWVO3QPduGlrQkrloo4Ey0DHZYvDPRlZlqSVRqcuL3x42b2dxZpOvNr N3XzgcJlo0+/NFAMvUqlImsxOcSPiZTWyHVY/7u+8f3U1MgKOzBM4NIRQRdBQSyJFFkw U1QrAVcvhemibMcOieisC1MI/7/oxyPzAE8EuWtuDreWdSYoM4UQ0HyBEfpR+vjyVV32 R4XwU8DpETo7uC9EFA7614EzuexCvgevlu4HXy+GUIN2SnvsPoHCgN+ynuciRHzWlbku dj/fs+Z9BS1NhKp/DPpQT6yBhRaXJZ2nV1hO9dtsvqi6KkpypXFfpk0eYPJvX5SidJ4h P81w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d26si17423938iod.62.2021.06.30.05.43.07; Wed, 30 Jun 2021 05:43:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234624AbhF3MpA (ORCPT + 99 others); Wed, 30 Jun 2021 08:45:00 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:57169 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234455AbhF3Mo7 (ORCPT ); Wed, 30 Jun 2021 08:44:59 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 15UCfBAA024028; Wed, 30 Jun 2021 14:41:11 +0200 Date: Wed, 30 Jun 2021 14:41:11 +0200 From: Willy Tarreau To: "Enrico Weigelt, metux IT consult" Cc: Florian Weimer , Len Brown , Peter Zijlstra , Dave Hansen via Libc-alpha , Dave Hansen , Rich Felker , Linux API , "Bae, Chang Seok" , X86 ML , LKML , Kyle Huey , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Keno Fischer , Arjan van de Ven Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features Message-ID: <20210630124111.GC23648@1wt.eu> References: <37833625-3e6b-5d93-cc4d-26164d06a0c6@intel.com> <9c8138eb-3956-e897-ed4e-426bf6663c11@intel.com> <87pmxk87th.fsf@oldenburg.str.redhat.com> <87wnqkzklg.fsf@oldenburg.str.redhat.com> <93e3b500-5992-a674-18e6-445d1db7b1f0@metux.net> <87tulirw5y.fsf@oldenburg.str.redhat.com> <84be3cfd-e825-ae75-bbae-2bbd3360daa7@metux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84be3cfd-e825-ae75-bbae-2bbd3360daa7@metux.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 02:22:19PM +0200, Enrico Weigelt, metux IT consult wrote: > Ah, now I'm beginning to get it: > > * this feature needs to be initialized first, before it can be used > * on first use (when not initialized yet), it traps into the kernel > * we don't want to always initialize it at boot > > Correct ? Not exactly. It's available but comes with a huge context-switch cost for each task using it. > What I'm wondering: why shall the process explicitly ask for it and > why isn't the initialization be done either on bootup or on first use ? The whole discussion about the pros and cons is archived here: https://lore.kernel.org/lkml/CALCETrW2QHa2TLvnUuVxAAheqcbSZ-5_WRXtDSAGcbG8N+gtdQ@mail.gmail.com/ > I'm still claiming already this old model is a horrible misdesign and > (most of) the extensions made over the decades are anything but well > designed - there had been many changes to do it much, much better. > For example there would have been ways to introduce new opcodes in a way > that they can be easily emulated in kernel or userland, w/o going > through a full trap. It's not a matter of opcodes but of context switch cost which not everyone wants to inflict to every single task that opportunistically uses these instructions without realizing what this subsequently implies for the rest of their life. All this is discussed in the thread above. I don't remember seeing anybody criticize the choice of instruction encoding hence it's irrelevant to this discussion. Hoping this helps, Willy