Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5166390pxv; Wed, 28 Jul 2021 04:56:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSZba1QBhz48edmtSYLzgN3V8/wwPlnkFl9VFEJYTGJrLlgkw7NsJZo20n4iHxe9S19y5Q X-Received: by 2002:a92:d84a:: with SMTP id h10mr19791180ilq.55.1627473395865; Wed, 28 Jul 2021 04:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627473395; cv=none; d=google.com; s=arc-20160816; b=tyLpjAAHzQE5IvEQtWfBQJxdkzJblpCJJN4FeWKc1xevnct0dvW5vQCsZadGrGSrHC 4mL7hDcGGAPpPuvaPiR8R/ZAXSYbINCDug4IcH39NJY7LtSKuWND1UDBs1V6ysrm/Z9d kU/Ka+wg7MtMOKTACdU+8+QtF6LebEKZZg/VzO2wm8scNViNhWVVbBoXAXq6eIedaYuE okor5BS4Ph5JzCrocCQ6p6W1KrsukanEs1h/Rt0AYBqC0LVACav1+xD2wfCvmykuv4Tp UF5yBqFv41+IYr4LLNey56YpS4qWvSUs3w25BdMbHCs5N1Djp3jwhAqmPJghGLBa3+7T ZvPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=k/Q78dC9Pxjp5fkpXVNbsBhMnnXWxmv4V/EO3fwYVy8=; b=j3HOlrkOeO9s/41QCnIkELgLRBHlSHPUE99WJuFtuzwGJnyXOVaUrxFr21bnv1867Z 1zmSiiOSYo+c7hYNy3bZtEg2ZonLmpbB+J8f+JNvX9Y08sOIRwCLB3X63i4aaglRllFr DU1U8iw1spEmAydgjxSoHPIX7/Lud3pzeQdqYYv4Mg67zjEJYVJCAtwSdOEGKSr3FNfL fVfkGAYZSFIWwwsggCGgT5+Sv+Ciy6+dT+recBF7lhdnaaHlbT+qaQ/DJEO1ckPM7k59 8QbVQ1fPpdnDMXE5XJiiOR87cnFCVYm5oI4vQVuIpnCaDYI2iZmI+4nrVdx2J3RqLYzv 2vpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hiT4tr4E; 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 j8si6436855ilq.125.2021.07.28.04.56.24; Wed, 28 Jul 2021 04:56:35 -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=hiT4tr4E; 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 S235758AbhG1Lzj (ORCPT + 99 others); Wed, 28 Jul 2021 07:55:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35606 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234703AbhG1Lzi (ORCPT ); Wed, 28 Jul 2021 07:55:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627473337; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k/Q78dC9Pxjp5fkpXVNbsBhMnnXWxmv4V/EO3fwYVy8=; b=hiT4tr4Ebpx3Aj2B9EvvEqz6saPYeri9gQ8Kl26OTvw6cRVOPZNLFHsekc+TcQ9TH28vhn C4iV6hnhBq1m6Lwh/pXLT0Mh//2L8aAKtlbdwLR76dmG5Yje4CB/HscVbEs0yfOJsCdey6 W0CBq/0kkooUhQncG8qmyJ/6jCn2oAg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-EqiYNKdfO76IcIUKLLsx8A-1; Wed, 28 Jul 2021 07:55:36 -0400 X-MC-Unique: EqiYNKdfO76IcIUKLLsx8A-1 Received: by mail-wm1-f71.google.com with SMTP id f25-20020a1c6a190000b029024fa863f6b0so1347906wmc.1 for ; Wed, 28 Jul 2021 04:55:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=k/Q78dC9Pxjp5fkpXVNbsBhMnnXWxmv4V/EO3fwYVy8=; b=hMOwRKJmCEQpY5k/g+Tp5WHOpjbp6HWfw7qyAy44aNZcsiSiQFgtUrxDtd80Khjd0K LD34NnE4FCFCq+O5oqXYD8EHFnXSEMMzhC3C4ukCa8PX/MBcNFJe/4WKNRoEEscZTzxq yNEXqjWnSh+35OVIaoay7qWNycZAseEP+FfYL39Av+Zqq4p0lVQ7SOyLJDFJhBq8/VOO 0R6AiA1f081L/Sf9CRgFz4fDmtPCrZj5JV/NjPYiTauwN6Y+JJRa2W+8sWpTGE1aT/Yf DZAH5ioqrR5ImFUlrWFnSdxrdvYYvdwCPyAEnWmRW4tugyAV8y9ey5XEsqFSz0QwfWiF GUfw== X-Gm-Message-State: AOAM530OHrYcJiuSEaF6xp29dJVv4eev08b74Tt6M9YW+05tqkUjUwvO cw+mUJ7DhnQ30g4wzrOC0A2eXrh/7EqN769Wtab24cp1BoCNU1jI4cfjLHVj/NLGZeYGntFIPGy tlJ6B1r+P1dQobf5nlsJ5BQW/ X-Received: by 2002:a1c:cc12:: with SMTP id h18mr9351417wmb.12.1627473334845; Wed, 28 Jul 2021 04:55:34 -0700 (PDT) X-Received: by 2002:a1c:cc12:: with SMTP id h18mr9351408wmb.12.1627473334691; Wed, 28 Jul 2021 04:55:34 -0700 (PDT) Received: from [192.168.1.136] ([79.116.5.179]) by smtp.gmail.com with ESMTPSA id e3sm6672682wrw.51.2021.07.28.04.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 04:55:34 -0700 (PDT) Message-ID: Subject: Re: [patch 1/4] add basic task isolation prctl interface From: nsaenzju@redhat.com To: Marcelo Tosatti , Frederic Weisbecker Cc: linux-kernel@vger.kernel.org, Nitesh Lal , Christoph Lameter , Juri Lelli , Peter Zijlstra , Alex Belits , Peter Xu , Thomas Gleixner Date: Wed, 28 Jul 2021 13:55:33 +0200 In-Reply-To: <20210728093707.GA3242@fuller.cnet> References: <20210727103803.464432924@fuller.cnet> <20210727104119.551607458@fuller.cnet> <7b2d6bf91d30c007e19a7d2cbddcb2460e72d163.camel@redhat.com> <20210727110050.GA502360@fuller.cnet> <20210727130930.GB283787@lothringen> <20210727145209.GA518735@fuller.cnet> <20210727234539.GH283787@lothringen> <20210728093707.GA3242@fuller.cnet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.3 (3.40.3-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marcelo, On Wed, 2021-07-28 at 06:37 -0300, Marcelo Tosatti wrote: > On Wed, Jul 28, 2021 at 01:45:39AM +0200, Frederic Weisbecker wrote: > > On Tue, Jul 27, 2021 at 11:52:09AM -0300, Marcelo Tosatti wrote: > > > The meaning of isolated is specified as follows: > > > > > > Isolation features > > > ================== > > > > > > - prctl(PR_ISOL_GET, ISOL_SUP_FEATURES, 0, 0, 0) returns the supported > > > features as a return value. > > > > > > - prctl(PR_ISOL_SET, ISOL_FEATURES, bitmask, 0, 0) enables the features in > > > the bitmask. > > > > > > - prctl(PR_ISOL_GET, ISOL_FEATURES, 0, 0, 0) returns the currently > > > enabled features. > > > > So what are the ISOL_FEATURES here? A mode that we enter such as flush > > vmstat _everytime_ we resume to userpace after (and including) this prctl() ? > > ISOL_FEATURES is just the "command" type (which you can get and set). > > The bitmask would include ISOL_F_QUIESCE_ON_URET, so: > > - bitmask = ISOL_F_QUIESCE_ON_URET; > - prctl(PR_ISOL_SET, ISOL_FEATURES, bitmask, 0, 0) enables the features in > the bitmask. > > - quiesce_bitmap = prctl(PR_ISOL_GET, PR_ISOL_SUP_QUIESCE_CFG, 0, 0, 0) > (1) > > (returns the supported actions to be quiesced). > > - prctl(PR_ISOL_SET, PR_ISOL_QUIESCE_CFG, quiesce_bitmask, 0, 0) _sets_ > the actions to be quiesced (2) > > If an application does not modify "quiesce_bitmask" between > points (1) and (2) above, it will enable quiescing of all > "features" the kernel supports. I think this pattern of enabling all by default might be prone to subtly breaking things. For example, let's say we introduce ISOL_F_QUIESCE_DEFER_TLB_FLUSH, this will defer relatively short IPIs on isolated CPUs in exchange for a longer flush whenever we enter the kernel (syscall, IRQs, NMI, etc...). A latency sensitive application might be OK with the former but not with the latter. -- Nicolás Sáenz