Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1737522pxj; Sat, 22 May 2021 00:19:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE+d3lRnzJi6U4OBfi3Ku4KaUmBybZu91uZiOCtODI8u10uWrT5BF3YPYIZlW9fAHAe0SE X-Received: by 2002:a6b:4e15:: with SMTP id c21mr3618703iob.116.1621667951760; Sat, 22 May 2021 00:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621667951; cv=none; d=google.com; s=arc-20160816; b=wq09KrFO+yUsP4NPBeBmUBmL66q5wNZgiZq5HTSkEJ2w/bDjXIoNGFIsp09vQg+dur yWwp3FtyerWeNMdl1wNT4PIsFfv5LuDKTb7sGdVrDVErScdMoozSCcVL31lQVude0+40 +SZyVHpgPBhP2nFqjs4bmZy9q8zo0Pe8/e4tmn9k9lgvB0JE+2cD/K321uPd/trekY2s w63jWojttCwPQvdkBXdCQ82DbgeooMZwN2KPXavqKg4XeaSe23q1OonB9DOoRy6NKUps KS5JTy2RKGd5c5pw1hpHq14SjGjlAN/22qGtXH5IM+HRV38KZKK6S6pEosSbo8fcobqb bxBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=iE5kXnU1bSfbyfhUY7SBg1/m6Gfmn7ASSYypDQN8NXc=; b=skgD2rg8SN/OhmiGdaiFv3/T8PVmJXJJ2KDRM1yVB9JGQe1u7760dVT/CxhL1pFZmW JiL1z5ZwygS/DOBM2qvF6i4HxT4j50j2DJaTrCv5aMIm1tWBf3dEaPML20kpvptXAoKf XwY0iLjRdjjijOt1pfosu5lFab6IOjRi4bmXd4g4WQWG9UIebh9wtc1cCYvbhB+1BQmX JDj+12aLNlTWh+t3DT4EjRhWrw6jW+EyoTNRh4RxYi9M4Gj3E0l/oh4JNG25kyfGe8M9 HsOdyGYTC0wESw74LK7AUrcqv5Zj9BA7LPqLSOLIU0KJbofbfSHMbXD7apjcr77CpLqF VSAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C2ZrUT5E; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si7945541iol.93.2021.05.22.00.18.41; Sat, 22 May 2021 00:19:11 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C2ZrUT5E; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229985AbhEVHSW (ORCPT + 99 others); Sat, 22 May 2021 03:18:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49225 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbhEVHSV (ORCPT ); Sat, 22 May 2021 03:18:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621667816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iE5kXnU1bSfbyfhUY7SBg1/m6Gfmn7ASSYypDQN8NXc=; b=C2ZrUT5EjjezSgmXsufb+g7D4QFFSdVNfLYGg1LQS9K8IU0kNxoSA/GvVMSlDsm9iz5YV5 AQt/KwQI8Bkk+ukod9Eo5cye6gQNVqq+D3hxOJjU/OYx5+171ZYs/XKWLgchcF6OetfB0/ SzIeLj/oTvxUZHppYhFXN2JzMon5qVI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-rDC1RYf7NDmYYJ7YCWCSsQ-1; Sat, 22 May 2021 03:16:52 -0400 X-MC-Unique: rDC1RYf7NDmYYJ7YCWCSsQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9F6F21007476; Sat, 22 May 2021 07:16:50 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-228.ams2.redhat.com [10.36.113.228]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C750B46; Sat, 22 May 2021 07:16:46 +0000 (UTC) From: Florian Weimer To: Len Brown Cc: Thomas Gleixner , Andy Lutomirski , Dave Hansen , Dave Hansen via Libc-alpha , Rich Felker , Linux API , "Bae, Chang Seok" , "the arch/x86 maintainers" , Linux Kernel Mailing List , Kyle Huey , Borislav Petkov , Keno Fischer , Arjan van de Ven , Willy Tarreau Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features References: <20210415044258.GA6318@zn.tnic> <20210419191539.GH9093@zn.tnic> <20210419215809.GJ9093@zn.tnic> <874kf11yoz.ffs@nanos.tec.linutronix.de> <87k0ntazyn.ffs@nanos.tec.linutronix.de> <37833625-3e6b-5d93-cc4d-26164d06a0c6@intel.com> <9c8138eb-3956-e897-ed4e-426bf6663c11@intel.com> <87pmxk87th.fsf@oldenburg.str.redhat.com> <939ec057-3851-d8fb-7b45-993fa07c4cb5@intel.com> <87r1i06ow2.fsf@oldenburg.str.redhat.com> <263a58a9-26d5-4e55-b3e1-3718baf1b81d@www.fastmail.com> <87k0nraonu.ffs@nanos.tec.linutronix.de> <878s47aeni.ffs@nanos.tec.linutronix.de> Date: Sat, 22 May 2021 09:16:44 +0200 In-Reply-To: (Len Brown's message of "Fri, 21 May 2021 19:31:36 -0400") Message-ID: <877djr5jc3.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Len Brown: > A. per-task. If we do it this way, then we will likely wind up > mandating a GET at the start of every routine in every library that > touches AMX, and potentially also a PUT. This is because the library > has no idea what thread called it. The plus is that this will address > the "used once and sits on a buffer for the rest of the process > lifetime' scenario. The minus is that high performance users will be > executing thousands of unnecessary system calls that have zero value. We could revive the KTLS proposal (userspace donates memory for use by the kernel & vDSO), and the thread could reserve (on-stack) buffer space for kernel use for the duration of the AMX computation. There would be a pointer to that space in the KTLS area, set upon entry of the AMX region, and cleared upon exit. It's not extremely cheap (unbounded alloca has a stack probing loop nowadays). But no system call is required. Thanks, Florian