Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp121933lqb; Tue, 28 May 2024 10:26:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8f1XkDa0rdufSRtLwZ4SyD2ukQmX17kVEMrwfojceGwmJdRp+yUt3hKPQTn8bGzstYVuhgIyIEMwTdRFnbfjydByCYhdyU4Aj8BIt9w== X-Google-Smtp-Source: AGHT+IHv1OTdT0igrm96F2C+BAeZ+aTLmu8/blpjvEeCpi2gVSspoM+SP671v+Znx+MIa/8RhLdV X-Received: by 2002:a17:902:e750:b0:1f4:7d47:b889 with SMTP id d9443c01a7336-1f47d47bd5emr101177905ad.30.1716917200501; Tue, 28 May 2024 10:26:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716917200; cv=pass; d=google.com; s=arc-20160816; b=dqmt752HYR2PeW9nQzvhs0vOZeV42jSKFrpUortv/2PMlfw8YDuTUh0o64UTXWEXE1 qx0tcYEOFnSYgZTLtXOEcQ2Yi3jN710WlI/Do3Y4/Cjyigpp8eOhF36sbD0b1yYYYtb2 50yhOa3Y7aO9YfdO0ABql7I8EC1KerLGv+GSOwEdQDVUlifCO39auPCGH8q1+1Y3UGtk ZJTQJ0N+p8Ekf7n16IfrZjfPSfmmzGHvpGDWlBqj1tsEl5wNtnp/S1T4PZcQlos5eQ2u AdYo9qF+bcQpalnrENyxcQ2MyXhD9dE6Y2Og3oPwxA1eGmBNMBy35z0iP5cBCBH4IHUO AHlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=g9mito6xvD+dhaYJ6IPUwATO98QSzshKvXNpGy6GRMQ=; fh=PEpTR6vu/VYvJU+FLN3w+hN5mMASnIZvqg79kiyAaKA=; b=m6oVrZK/OqKyGjxH619kB7+eDoMEZfyQ6Jlg/m1GgwqiZfuiaxWdGqO/diwLe/+8jt mdsxF//nKnhMlFh79zzM4/LRKKERH6/RHrzZLn7y9o/NrmevhRoTlh5nKNLJcMimewhQ DVyC7QfZJVrW3OWA0n+K/fqb9IS3ysNoNnnvYxf1RDm4fDu9QJpBs2gDn2c4o6Dosf2A UBryk85Ctr+jGThaqylllhPOIirDxjIJbTnVBIfSTaOVlL7nxFqECJhpFSqljNBNsa3f uaXZxhIdHzrcauSauB0kBQSCARfAOOviuL35ez/ZMYBm8RmXDXafG3idalh+SrY231D3 sW1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=St328rec; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-192730-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192730-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c9e7e20si83154635ad.569.2024.05.28.10.26.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 10:26:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192730-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=St328rec; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-192730-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192730-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6F5972821E7 for ; Tue, 28 May 2024 16:12:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EC4C172767; Tue, 28 May 2024 16:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="St328rec" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 777C832C60 for ; Tue, 28 May 2024 16:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716912760; cv=none; b=lsPiekqfLkQ6J0DmhNPWFj3/OKrwOZORUhvzVxKemQMNtefCd6mFzOLA/P0XPD/cr/msPTDT2jda9i4qHIBxmg4KDtQtsxoOOiZ0BR6hFl+bFAUBFBzcdR+rmg/IytCiFgxSIfp6HvdghxnWhBzQqieFeWlH8mNLctk/4jf9NNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716912760; c=relaxed/simple; bh=gQDaCc1TaJ0vEa9tQkxi/WzhJi3IevxHcvvqqCvnO+4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l+032wC1iK2p9h1H/jGBA26VFXu6qmcgnIcOvlxTQtiQ3ckKaVfo2qemabWjOnQQl5oIh2YqnEZ9XyJCxaupj97kqcNcf6rNf5pJC/XYGBfan+k19yFQM3P73Dgfq6i/drCQnvMTRpH7dR5rpulKMpgiA78DF44YqgXZXUYiGDA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=St328rec; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=g9mito6xvD+dhaYJ6IPUwATO98QSzshKvXNpGy6GRMQ=; b=St328recDzOi7dXNBaqbRlh3R2 /pedsYfD1JqYVLdPpAT8SeB2lr4J48VRm5ZQSS8mQviwNEzKcZCNZcCDCVguTu7WGGayqbhAPyKGt 4M5Qil4VqUnaW6wY8qFoBNrhjZ/oMhmmWhxLr/Bt1WTZExw2BYL/NtgGo7UzzhHbu0gCRO5EGK5Wa bahw6LTMDT2rPdso07WuRytqrhXz9NnsFQ345MfJR7NfRIqX87z5B18M7Nc9K4JMxAfTxF1L0Egox Tz9C+mEMlYABn4g0HeTv/x14YaatExwYVruw5c1OS5vky95d+hKebElo5K+TjjVHoCDqRslr9oCpc KLqWfaqg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBzRA-00000008oIV-1NR1; Tue, 28 May 2024 16:12:32 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id EF5E230058E; Tue, 28 May 2024 18:12:31 +0200 (CEST) Date: Tue, 28 May 2024 18:12:31 +0200 From: Peter Zijlstra To: Ankur Arora Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, paulmck@kernel.org, rostedt@goodmis.org, mark.rutland@arm.com, juri.lelli@redhat.com, joel@joelfernandes.org, raghavendra.kt@amd.com, sshegde@linux.ibm.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, Andy Lutomirski Subject: Re: [PATCH v2 08/35] entry: handle lazy rescheduling at user-exit Message-ID: <20240528161231.GD26599@noisy.programming.kicks-ass.net> References: <20240528003521.979836-1-ankur.a.arora@oracle.com> <20240528003521.979836-9-ankur.a.arora@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240528003521.979836-9-ankur.a.arora@oracle.com> On Mon, May 27, 2024 at 05:34:54PM -0700, Ankur Arora wrote: > The scheduling policy for TIF_NEED_RESCHED_LAZY is to allow the > running task to voluntarily schedule out, running it to completion. > > For archs with GENERIC_ENTRY, do this by adding a check in > exit_to_user_mode_loop(). > > Cc: Peter Zijlstra > Cc: Andy Lutomirski > Originally-by: Thomas Gleixner > Link: https://lore.kernel.org/lkml/87jzshhexi.ffs@tglx/ > Signed-off-by: Ankur Arora > --- > include/linux/entry-common.h | 2 +- > kernel/entry/common.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h > index b0fb775a600d..f5bb19369973 100644 > --- a/include/linux/entry-common.h > +++ b/include/linux/entry-common.h > @@ -65,7 +65,7 @@ > #define EXIT_TO_USER_MODE_WORK \ > (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ > _TIF_NEED_RESCHED | _TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL | \ > - ARCH_EXIT_TO_USER_MODE_WORK) > + _TIF_NEED_RESCHED_LAZY | ARCH_EXIT_TO_USER_MODE_WORK) Should we be wanting both TIF_NEED_RESCHED flags side-by-side?