Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp429582pxj; Fri, 7 May 2021 11:45:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6UHYtBZWgWLIwk4DqQYSE04sdWd5eqDzGjh1k4ppwk7FwbG+vsXRbCnTF0CVLISnT4SNE X-Received: by 2002:a17:907:1b19:: with SMTP id mp25mr11327969ejc.154.1620413136787; Fri, 07 May 2021 11:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620413136; cv=none; d=google.com; s=arc-20160816; b=WfV8Ee9fo4rPJ2SYwO5a8Vp/MHefRF93W8HJbWM+j/U8+E5aN2c++x/bBN/NSxZ1Fr Slo6oOcm3ZayR494xSHLvyIuAK6zBXSCLobiNDSIyS8JWncbPnkUmEvGocbc22rCokoo wtL35hNc3yJtPD9eYS5GYQ/ZuBPSSMALnpBQW2lDBRg9t3VxFaxE72m2gYWyk7KtQwkV w+GQBULo9vc9iShnDw8OeMSSY0J0SlShO5p5+kzRvKEsAAQYMCgQrGulG6ZpWuwi95J7 VGxVzFRuYopG7BBCLHDZS2yoOc66CjwjhJ8bvQeZ2TWdj9nqi7MjyLmVT/YcrKM2F2lf /qCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=n7rJ0dlFmG2nBfHC2MLUNYWbqEOUVFlJXYjrKpA8y4U=; b=tNmZazzzTrS873MNOyCiNZx2JHrUPfCyrUA1N11fYouoMSh7jgX9TLL9vo58D4anQt nwiOX0nkG98d21CvoSdrFJpTXjwlu7x3QUsABee4lGE0Qm6r7QsfSW/XYAEFGGucO7vh VSQBSKu3fkDJdvbCYDJBJ5pwXN1WI6swdYoj5ibIQwO2NQy3Hq8Zbqv00FGwnC2yF5P7 68tCyPYt2XnOLcDEW5k41gcxYWA0R0TiuKybb8gtx4m8PH/t1SNrCpkaD82zCDL0PHOJ XzrHHaVq3NwHqunHZRPVLN/ekOheA0PWvt4ELqFfmfipW1CKtWYJ0waMc55bn8cWl/eQ QwJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ERXnZvWf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si5693251ejb.4.2021.05.07.11.45.11; Fri, 07 May 2021 11:45:36 -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=@linutronix.de header.s=2020 header.b=ERXnZvWf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229488AbhEGSpH (ORCPT + 99 others); Fri, 7 May 2021 14:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbhEGSpG (ORCPT ); Fri, 7 May 2021 14:45:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8280AC061574; Fri, 7 May 2021 11:44:06 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1620413042; 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=n7rJ0dlFmG2nBfHC2MLUNYWbqEOUVFlJXYjrKpA8y4U=; b=ERXnZvWfiwqAMqFp6VAA1kNnf+uuuYuSr+8nEiIcCK13DKl8wnHmpA6HzRHMCMvJCWvVyZ WjOCCNlSx4bMEpEXx3i+KyNMKMtSsDPmbrSGutRNcOkCmNASVxTl778jtVA1PxWywvkcVs 8236SBDHXrN/2jNOEnZV6aC5g7MWZAM15NZyw1JbdLGs7egeG6AkjfBLVL+2ZqUcmj753g 3/PRmdZIMKygWfTg9nyriqKSGkm6OOq7eURrtQ3wx6+FwgDu+mBWAY9Q66++tFOIBZMSgp S4NgF1Oyxg5UM36Ce9/rExtoFsFQtHbUoD92frrrsgBQBWAmDQO2vpzUHpMvSQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1620413042; 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=n7rJ0dlFmG2nBfHC2MLUNYWbqEOUVFlJXYjrKpA8y4U=; b=+3YcQRLt0Hifq5eZj4aSejW5/SSBEi1Gr3EAqhWloe7lXnBWPI8zsit6up03b/va7agqdI 02kHDiNiezLmd4Dg== To: Dave Hansen , Florian Weimer , Len Brown Cc: Borislav Petkov , Willy Tarreau , Andy Lutomirski , "Bae\, Chang Seok" , X86 ML , LKML , linux-abi@vger.kernel.org, "libc-alpha\@sourceware.org" , Rich Felker , Kyle Huey , Keno Fischer Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features In-Reply-To: <5d3d513b-77d6-e2e2-779e-ff3ea33deba3@intel.com> References: <20210415044258.GA6318@zn.tnic> <20210415052938.GA2325@1wt.eu> <20210415054713.GB6318@zn.tnic> <20210419141454.GE9093@zn.tnic> <20210419191539.GH9093@zn.tnic> <20210419215809.GJ9093@zn.tnic> <87bl9s8kfb.fsf@oldenburg.str.redhat.com> <5d3d513b-77d6-e2e2-779e-ff3ea33deba3@intel.com> Date: Fri, 07 May 2021 20:44:02 +0200 Message-ID: <87o8dmmljh.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 03 2021 at 06:43, Dave Hansen wrote: > On 5/2/21 10:18 PM, Florian Weimer wrote: >>> 5. If the feature is enabled in XCR0, the user happily uses it. >>> >>> For AMX, Linux implements "transparent first use" >>> so that it doesn't have to allocate 8KB context switch >>> buffers for tasks that don't actually use AMX. >>> It does this by arming XFD for all tasks, and taking a #NM >>> to allocate a context switch buffer only for those tasks >>> that actually execute AMX instructions. >> What happens if the kernel cannot allocate that additional context >> switch buffer? > > Well, it's vmalloc()'d and currently smaller that the kernel stack, > which is also vmalloc()'d. While it can theoretically fail, if it > happens you have bigger problems on your hands. Such a buffer allocation might also exceed a per process/cgroup limitation. Anything else which is accounted happens in syscall context which then returns an error on which the application can react. So what's the consequence when the allocation fails? Kill it right away from #NM? Kill it on the first signal? Do nothing and see what happens? Thanks, tglx