Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2889442pxj; Sun, 23 May 2021 14:32:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzFn6CCuu7cUeCb//6+bbI5l/m4Zsn5esjDIhjIqchohccyqTmeb1wSAgGIWEkuzZz13zo X-Received: by 2002:a05:6602:221a:: with SMTP id n26mr11129015ion.205.1621805531632; Sun, 23 May 2021 14:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621805531; cv=none; d=google.com; s=arc-20160816; b=YqBzsRuN2UgGUFv/u1U6JlL8s/v0Zwo8f4l0EiadgB9xsqzG3H/e9L1Zyh4t2LVP7q 0F0HHQF6YEge9VFabVss2o/Av25fujgZX6CUn0LfNH6zfavxue8xiDHreJSXx2KGZh3V gKAoV8h5mTUHS5zsWTzo0aOI4YmHTxIfid98+YzIrwYC63iK24StsJ2uY6eGSZI4/ys1 SMGG11mcyd3U4CEUUoBeGjuzKiGUjkS2jbGTLe00y2NDb18zQcsURP0hHBtweXPNMGjC RUVFp5qxu/2sVIcwQnuw+F/WmhvfYLCnTPiqZENQim8E6/wWotHXN+fCBgYdEQEBYRA6 HX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=pdBoqu1wu9kO7ZxSY8dv0BC1MQy+YgvrCZ8i9I2seF0=; b=zhYwv00p8O5cPTCt7psthv14OjiOCJZU2wUdt+zTXzOlGYVBfSK1Bg1MQ0yd96Crcv dMzrUC1vUcMf4OEaLuI6pE5lS/1e4kErZPCav/uJGu6L5O28zpLDaBl5gaR0U8unopkp 4FaaQoSImTNaWcsJ5kevRscT2d0pvC9JSpyTjWxLqaHrgTBEctNR4tPsNlrE4KDOlPE5 axm4hXPwy+nUhs7IshnkkI7mJMnrmpds2Z8FT8RCqzMSMuAc2k99mGa1me+SJN2ZQXZ6 gAQ3jalzQwVFEaR9Xwmr5FJFwFUZerSyAsKdcNVUTbWsKsprLeiYQ8/thxgLzfoF/l4v 5sSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=oC80I33s; 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 g5si12120120jan.100.2021.05.23.14.31.58; Sun, 23 May 2021 14:32: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=@infradead.org header.s=bombadil.20210309 header.b=oC80I33s; 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 S231964AbhEWVcq (ORCPT + 99 others); Sun, 23 May 2021 17:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231956AbhEWVco (ORCPT ); Sun, 23 May 2021 17:32:44 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40E56C061574 for ; Sun, 23 May 2021 14:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=pdBoqu1wu9kO7ZxSY8dv0BC1MQy+YgvrCZ8i9I2seF0=; b=oC80I33s6SRE2O1x1a0qV+AaoI Q7ci5M+ot3u6lLoT0+2xllK2UNaeI1l2WF5AYaXO63jn/qPslPs76XR6gqD7CXly0GE/kGaeDMp+/ Hr1MEyaT8c2qHlThxBS17nuFJ6prXYpYp2Drbcjt2mNyVFBHxXseISN9V0zF9GgVjOoFObQSGJFhQ NqtmneZtolNndfKtzw1Epl6VleSy3GUNihJEkZGTkBxcAvga0b08EneCFjtwlbuq39xWBcQpWjnGy H1boqnxu/aMIQfaLq4uGszBZMMlmh/W6nJSxOOKboPK/Qf1h2zXO570XiwDnKW+7z3rQlGUFDxmO0 FkQXyxfg==; Received: from [2601:1c0:6280:3f0::7376] by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lkvgo-000ZzD-VP; Sun, 23 May 2021 21:31:15 +0000 Subject: Re: config SCHED_CORE To: Hugh Dickins , Peter Zijlstra Cc: Joel Fernandes , LKML References: From: Randy Dunlap Message-ID: <6193be11-a92d-23a9-e999-ae785ffa73bb@infradead.org> Date: Sun, 23 May 2021 14:31:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/23/21 1:30 PM, Hugh Dickins wrote: > On Sun, 23 May 2021, Peter Zijlstra wrote: >> 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? > > Much more helpful, thanks. And I agree that you have to keep it fairly > brief here: I think you've struck the right balance. Some nits below. > >> >> --- >> 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 > > Maybe s/scheduling/Scheduling/ to match the title? > > I think I got the picture once I reached the end, but was confused here > by the stages of enablement. s/This option enables/This option permits/ > would be clearer, I think. > I like all of Hugh's suggestions... > >> + selection across SMT siblings. When enabled -- see >> + prctl(PR_SCHED_CORE) -- task selection will ensure all SMT siblings > > s/will ensure/ensures that/ (it felt like too many "will"s before) especially that one. ^^^ >> + 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 > > "SCHED_CORE is default enabled when SCHED_SMT is enabled - when unused there" > would be better. > >> + should be no impact on performance. thanks. -- ~Randy