Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1568232ybh; Mon, 20 Jul 2020 01:22:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnrgg+Grc7+qLAsRbs3hsg8uR0s3HnpRO56nHoBSmygTBoAE93LZs9dg9yNuSOSmkoDC5A X-Received: by 2002:a17:906:6446:: with SMTP id l6mr20675676ejn.184.1595233331666; Mon, 20 Jul 2020 01:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595233331; cv=none; d=google.com; s=arc-20160816; b=P56wrQIz6mlKOTtEGBJDXOjsddxkb5nd+wjr6ckN1wJNh82+YwGUcZV42b1eB3QBSM XWZ14DFpYHzm485AR0amp6gLTsy4e/1uevlnp6GG4psl1sw6Vp6sDs7nLXBVE5IWyR3w dE7J2nb1VCyuCMAnQOl47wQRuNP/g9r3lLQUF88RPwKMt566hSb4v20ytTneHnhGgNOp nRdeF3H5wYIDycJmhJnsR/WOlxyj56EN9vhGzXAePTc3ym2es76bOx4dCg0U5Z0o+Q7c d7D6KEtpoE9kqbiC9Nf3qz1ga43mYI0D+n8PGQnPauqjJwXkMIYlnu7mFIzRcrFqr38v El2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=uV35zE6Qu7KCAMZlz46iC3uSUkXeF78C2Fgm6xYGxv4=; b=E4Tq8qOeFC28BMzgwuLlCDh4wpPyXvdl30DmytJvBP0tkk2YW/XedcwXhaX87RgvQf PE3gGjLquGf+r+JlwhxvLVphJbzFa3BbPPTQRG0Abx9CWHtY+/ay4jkl0PYFaHIVixQz KoLjCldxxdfjRuvPiNoy/yy/btJMfFkv36QZMpaE8kRpjuStGTOrQ8MrjF2Qat4uwv2+ 10PogyghH+qXqta1TaXePmlR5UI+AFQFMeumRG+JdmggmiRoa6bEUKSDrHgI0ONgCTWJ cou/q8rLQu/tmD8oZ6qFK2A3dbfg9ywNcleim/j7hT21DsiD+pT8AdHab7EbeyVNFalZ pqWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LBAuFIAt; 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 q12si10235641edn.472.2020.07.20.01.21.48; Mon, 20 Jul 2020 01:22: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=@linutronix.de header.s=2020 header.b=LBAuFIAt; 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 S1727026AbgGTIUt (ORCPT + 99 others); Mon, 20 Jul 2020 04:20:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbgGTIUt (ORCPT ); Mon, 20 Jul 2020 04:20:49 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DEFEC061794 for ; Mon, 20 Jul 2020 01:20:49 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595233247; 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=uV35zE6Qu7KCAMZlz46iC3uSUkXeF78C2Fgm6xYGxv4=; b=LBAuFIAtcHGfriAPEwgGKrOg+VTbpmBWLGiTQD1jJSdqSqwiFrueczjk3ckuoH+XbVeICE 05ui2+THBxoLgXciGrEEPuTyLw/AJXrwdDBcuFYLmeV5avgUhXR0dGIntMLHFxdn1o9Jxz OKg1D/DGEySEsbCmsFqrVGGAXJziHwMJ10+hh5vvK5ICQb9H+bdJARTukybLSNqzl1TJkW e5DAJrNXGZkda428/2+miL9byh1KXUbss/hUsDE4Ta0K5J6nz+wLGfn2kETtF+eIUmhIAt oxgonFotei+R0f9XplvDcQ8kNtp859g63NOlWPvEfQQTWJ+iAi/fL/5dGPXknQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595233247; 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=uV35zE6Qu7KCAMZlz46iC3uSUkXeF78C2Fgm6xYGxv4=; b=tvNQHsAmSaK96tu7ExPVT8bJjlQIVZKAswyi3T0rBdci/PoEA2AKUZH20tRdtaBiwlSl/Q NhMBQzEKonVrPwDg== To: Joel Fernandes Cc: Vineeth Remanan Pillai , Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , mingo@kernel.org, pjt@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, subhra.mazumdar@oracle.com, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Aaron Lu , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , vineethrp@gmail.com, Chen Yu , Christian Brauner , Aubrey Li , Tim Chen , "Paul E . McKenney" Subject: Re: [RFC PATCH 14/16] irq: Add support for core-wide protection of IRQ and softirq In-Reply-To: <20200720035359.GA4187092@google.com> References: <871rl9r9xr.fsf@nanos.tec.linutronix.de> <20200720035359.GA4187092@google.com> Date: Mon, 20 Jul 2020 10:20:46 +0200 Message-ID: <877duyoaw1.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joel, Joel Fernandes writes: > On Sat, Jul 18, 2020 at 01:36:16AM +0200, Thomas Gleixner wrote: >> >> The entry case condition wants to have a TIF bit as well, i.e. >> >> if (thread_test_bit(TIF_CORE_SCHED_REQUIRED) { >> sched_ipi_dance() { >> if (other_sibling_in_user_or_guest()) >> send_IPI(); >> } >> } > > I did not understand this bit. Could you explain more about it? Are you > talking about the IPIs sent from the schedule() loop in this series? Nah, let me try again. If two tasks are out in user space (or guest mode) and they fall under the isolation rule that they either are both in user space or both in the kernel then you tag both with TIF_CORE_SCHED_REQUIRED or whatever bit is appropriate. So in entry from user you do: if (thread_test_bit(TIF_CORE_SCHED_REQUIRED)) sched_orchestrate_entry(); void sched_orchestrate_entry(void) { if (other_sibling_in_user_or_guest()) send_IPI_to_sibling(); } That IPI brings the sibling out of user or guest mode. On the way back to user/guest you do: if (thread_test_bit(TIF_CORE_SCHED_REQUIRED)) sched_orchestrate_exit(); void sched_orchestrate_exit(void) { while (other_sibling_in_kernel()) twiddle_thumbs(); } Hope that clarifies it. Thanks, tglx