Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp763817pxk; Wed, 9 Sep 2020 19:35:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNW5KMDWzMxG95l0p69s5T89y3DXWezyI6ZqjnvKeL9ZwTbyfMP+7K1BKPqfgaXFTRNecB X-Received: by 2002:a17:906:8245:: with SMTP id f5mr6290559ejx.264.1599705323169; Wed, 09 Sep 2020 19:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599705323; cv=none; d=google.com; s=arc-20160816; b=Pn4z3vwli4uLRwQRSoRoK1GzyIDwLDqxXiEioq5tjfhcyZz/781uPUHRfcmc1EIBBk ySO1HzCJfegupdgisgMIDzc3Ba08iV8MK3kXP8MHkqka+7Qz8eM6TG3KDcBaZkglNBuX RT0b2V/H+48DrP4eKd2ObZIfORlDsff+yhSQhn0VW+Cbjq20G/L6alqaifQL0YBgfeEA wyRV6Etwh/oFWcUMrOCaOauqevEqTs5DlyDd1VGWveHzltS5l61U8ME8QY81iKxfBHwR qDfiBT6Y8whwxeF0Y271+xCAvNd9om3vGGHg5M+eRrMtTlQKc3asMra6ckcbUhvhNdta Tf8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Koe0kczem479tKX0OSWAPZzcGPel1n009m20c3CQ5xQ=; b=H/Z+RxkyZNviRPDz/lZ/rGndJXkZiz3zT8AfcC8C+1ANaOMmzbdBpL/GUoL4fPXFYW V7xQe6tOUXSI/H1oi2fIcJy8rNWPiIKLCgO1tKmTjlYK+LtTPeCgzPb7qRE7iEKkltYI 5efKlkHU+AwskYgSCB9LVAWPPKmzX5uLkSTurrRSjNNGdCkdg5V4SGgO/bQsT32RXzyX 2bW6PBRuB+YTSQ1K14FD+kKKOa1VtrhSQduvYxWTO1cWkxSrr6vEf+deIiM7ZQI0IgXA 36khcar8iucikwVw4KTLiiTfgp470ddBLVd0RRSbt26AEV2P4HBpokf5bPTuHudAPWaD Q3jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qWBOrgBh; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si2637760eja.274.2020.09.09.19.35.00; Wed, 09 Sep 2020 19:35:23 -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=@kernel.org header.s=default header.b=qWBOrgBh; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729129AbgIJCcR (ORCPT + 99 others); Wed, 9 Sep 2020 22:32:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:39566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730920AbgIJCZa (ORCPT ); Wed, 9 Sep 2020 22:25:30 -0400 Received: from localhost (lfbn-ncy-1-588-162.w81-51.abo.wanadoo.fr [81.51.203.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C863520C09; Wed, 9 Sep 2020 22:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599691735; bh=GitDIBjazlg2aEqgUHmiwSZ1KvMEnONcmZnbecWQMHg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qWBOrgBhJ6HySZn5zs3kJR2qeJSz9FHowfK3pRxJokck9fF7dQDomXTHwy2FSiAJl r2nuh0mLY0R75xVoBe/3vRdkWNP04KJ4e8z8/pHu2SzmMgpAy+79VLmBzEK6yT5+2h 4KYi+gJ8FApk6hC0cW3PTD13MAv7IOogBAXJAyYM= Date: Thu, 10 Sep 2020 00:48:52 +0200 From: Frederic Weisbecker To: "Paul E. McKenney" Cc: Marcelo Tosatti , Phil Auld , Peter Zijlstra , Thomas Gleixner , Joel Fernandes , linux-kernel@vger.kernel.org Subject: Re: Requirements to control kernel isolation/nohz_full at runtime Message-ID: <20200909224852.GC20541@lenoir> References: <20200901104640.GA13814@lenoir> <20200904204740.GP29330@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904204740.GP29330@paulmck-ThinkPad-P72> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 04, 2020 at 01:47:40PM -0700, Paul E. McKenney wrote: > On Tue, Sep 01, 2020 at 12:46:41PM +0200, Frederic Weisbecker wrote: > > Hi, > > > > I'm currently working on making nohz_full/nohz_idle runtime toggable > > and some other people seem to be interested as well. So I've dumped > > a few thoughts about some pre-requirements to achieve that for those > > interested. > > > > As you can see, there is a bit of hard work in the way. I'm iterating > > that in https://pad.kernel.org/p/isolation, feel free to edit: > > > > > > == RCU nocb == > > > > Currently controllable with "rcu_nocbs=" boot parameter and/or through nohz_full=/isolcpus=nohz > > We need to make it toggeable at runtime. Currently handling that: > > v1: https://lwn.net/Articles/820544/ > > v2: coming soon > > Looking forward to seeing it! So many ordering riddles I had to put on paper. But I'm getting close to something RFC-postable now. > > > == TIF_NOHZ == > > > > Need to get rid of that in order not to trigger syscall slowpath on CPUs that don't want nohz_full. > > Also we don't want to iterate all threads and clear the flag when the last nohz_full CPU exits nohz_full > > mode. Prefer static keys to call context tracking on archs. x86 does that well. > > Would it help if RCU was able to, on a per-CPU basis, distinguish between > nohz_full userspace execution on the one hand and idle-loop execution > on the other? Or do you have some other trick in mind? No it's more about context tracking. Initially it used TIF_NOHZ to enter the syscall slow path and call to context tracking on kernel entry and exit. The problem is that it forces all CPUs, including housekeepers, to run into that syscall slowpath. So we rather want the context tracking call conditional on a per cpu basis and not on a per task basis. And static keys are good for that. That's what x86 does. So RCU can't help much I fear (but hey, first time I can say that! ;-) Thanks.