Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2555993pxj; Sun, 23 May 2021 04:03:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCbIGEjSIXVmtXj8O6ndTXToCqecpkgQeiKLEzrpEglGQHDrmLhqJa4kcpubVcCKRi/5WZ X-Received: by 2002:aa7:ca1a:: with SMTP id y26mr19989740eds.297.1621767834930; Sun, 23 May 2021 04:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621767834; cv=none; d=google.com; s=arc-20160816; b=yr3d6myQuI6TeT2FdZpGgzsZo6PLWpJlkpzyYG+m8eoyctj2YCb46HvCrozR7mdMiu 7bI2W7E4mhHBXk3eQp9FRMcSp/vPooYv25NTisv4sLDhymH+CePN6SZU/ZeziKWoCoSW qmStbL/Ea5XCsS8H9/8Sfk4uteEKA+ug33kHtxIHt1qSn8sdmpwIR6vNCAcLpBDZ8Iln XWWJYidduLQ/kxcUDxsKylEZmbi2OxZ9HmTTHhSWm4AiAlQ7/SM9E8zDGVikE7tE6tfV vf4QNsW0sUnvnrc2dgvNjJtdQb8YBmmNqYusZpTCXqu7v/dPjABVTBYZ991w4QFbZoTc IfQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gw7rNxRfNTjuFI4Ut7DQRtrbTW37NXCrecNUqsprRRk=; b=FvnRur/Kx3fHM16oD6y7NxtA1Jyv4+WzGfejJwudTVSkK+8IaZtuyuj8TKyq6Ms/kn bspwLtE5UOKVz1a1zFKVG/6nGcTGBzXcm652ow+Xg1+PqlJ5tjJHvaHdn8JGaRAwUWsv C8dosoPCvd2nAmJTqiMk0D4h0C9wlfEAWSEd2j4mZ+yiLiZBWXsk42YIr8Ry5WXrKRgM wYrEggiPasW1BJse2vIHJeEGjm6QVA5888ZNtXXZAqP9EBrx48bdgslkWvA5ZmIbj3yH dlI+qRiTrd+SGBYAIfXTUuQwi0EBRl2pAwAZgvk3FkR76yOdRvAE3kp0qmZREwxE8DYM Uozw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=jPWyPs3X; 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 b2si9280885edw.156.2021.05.23.04.03.29; Sun, 23 May 2021 04:03:54 -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=@infradead.org header.s=desiato.20200630 header.b=jPWyPs3X; 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 S231728AbhEWK6q (ORCPT + 99 others); Sun, 23 May 2021 06:58:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231684AbhEWK6p (ORCPT ); Sun, 23 May 2021 06:58:45 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CDE7C061574 for ; Sun, 23 May 2021 03:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gw7rNxRfNTjuFI4Ut7DQRtrbTW37NXCrecNUqsprRRk=; b=jPWyPs3X1tfUhwZrI6O5BuX0zt xqL2RV0qbEWNGCCKH7qjj6yXzcZ5gO9VvAPumLBAuRCuMUPMiwEcgd3fgSgBIllnWTd5IwUJGFXPT znJUbA2LiOs5vJLMV9UDLJlSVY/uw+4sk9CO3ZRFeOXgJWDzkHO0LIT9QBdPzsQuffV40c3b9OiIX krFepAuid0yU2E8RCCl2NE+8MbdfyqS4W8AO2T8OVy637212dykyIsUW77Pqi4wMl+msXB46z2HOx HMiXqQ+5twMcWQo/U1aWv3jdqNzUpLnxmaNAsDXNEOBwV5FFLOhjfOVM1VrHJWiiyXGh5ZYx8zRtb fSR7pqMQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkln8-004HlW-1X; Sun, 23 May 2021 10:57:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 98FC1300103; Sun, 23 May 2021 12:57:04 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7268031473E79; Sun, 23 May 2021 12:57:04 +0200 (CEST) Date: Sun, 23 May 2021 12:57:04 +0200 From: Peter Zijlstra To: Joel Fernandes Cc: Hugh Dickins , LKML Subject: Re: config SCHED_CORE Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 07:57:35AM -0400, Joel Fernandes wrote: > On Fri, May 21, 2021 at 3:53 AM Peter Zijlstra wrote: > > + help > > + This option enables Core scheduling, a means of coordinated task > > + selection across SMT siblings with the express purpose of creating a > > + Core wide privilidge boundary. When enabled -- see prctl(PR_SCHED_CORE) > > + -- task selection will ensure all SMT siblings will execute a task > > + from the same 'core group', forcing idle when no matching task is found. > > + > > + This provides means of mitigation against a number of SMT side-channels; > > + but is, on its own, insufficient to mitigate all known side-channels. > > + Notable: the MDS class of attacks require more. > > + > > + Default enabled for anything that has SCHED_SMT, when unused there should > > + be no impact on performance. > > This description sort of makes it sound like security is the only > usecase. Perhaps we can also add here that core-scheduling can help > performance of workloads where hyperthreading is undesired, such as > when VM providers don't want to share hyperthreads. Something like so then? --- kernel/Kconfig.preempt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index ea1e3331c0ba..cd497fecfd43 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -104,4 +104,18 @@ config SCHED_CORE bool "Core Scheduling for SMT" default y depends on SCHED_SMT + help + This option enables Core scheduling, a means of coordinated task + selection across SMT siblings. When enabled -- see + prctl(PR_SCHED_CORE) -- task selection will ensure all SMT siblings + will execute a task from the same 'core group', forcing idle when no + matching task is found. + + Use of this feature includes: + - mitigation of some (not all) SMT side channels; + - limiting SMT interference to improve determinism and/or performance. + + Default enabled for anything that has SCHED_SMT, when unused there + should be no impact on performance. +