From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754478AbbJ1FDg (ORCPT ); Wed, 28 Oct 2015 01:03:36 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:47482 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750964AbbJ1FDe (ORCPT ); Wed, 28 Oct 2015 01:03:34 -0400 Date: Wed, 28 Oct 2015 06:03:14 +0100 From: Peter Zijlstra To: Paul Turner Cc: Andrew Hunter , Andy Lutomirski , Andi Kleen , Mathieu Desnoyers , Dave Watson , "Paul E. McKenney" , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Triplett , Ingo Molnar , Chris Lameter , Linus Torvalds Subject: Re: [RFC PATCH v2 2/3] restartable sequences: x86 ABI Message-ID: <20151028050314.GC11242@worktop.amr.corp.intel.com> References: <20151027235635.16059.11630.stgit@pjt-glaptop.roam.corp.google.com> <20151027235705.16059.63268.stgit@pjt-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151027235705.16059.63268.stgit@pjt-glaptop.roam.corp.google.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2015 at 04:57:05PM -0700, Paul Turner wrote: > +static void rseq_sched_out(struct preempt_notifier *pn, > + struct task_struct *next) > +{ > + set_thread_flag(TIF_NOTIFY_RESUME); > +} > > static __read_mostly struct preempt_ops rseq_preempt_ops = { > .sched_in = rseq_sched_in_nop, > - .sched_out = rseq_sched_out_nop, > + .sched_out = rseq_sched_out, > }; Since we're unconditionally setting this TIF flag for these tasks, can't we introduce something similar to the (contested) TIF_NOHZ_FULL thing which is kept on the task indefinitely. That avoids having the preempt notifiers and this atomic op in the schedule path.