Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753575AbbBSVik (ORCPT ); Thu, 19 Feb 2015 16:38:40 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49114 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbbBSVij (ORCPT ); Thu, 19 Feb 2015 16:38:39 -0500 Date: Thu, 19 Feb 2015 22:38:37 +0100 (CET) From: Jiri Kosina To: Josh Poimboeuf cc: Vojtech Pavlik , Peter Zijlstra , Andrew Morton , Ingo Molnar , Seth Jennings , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] sched: add sched_task_call() In-Reply-To: Message-ID: References: <20150217212532.GJ11861@treble.redhat.com> <20150218152100.GZ5029@twins.programming.kicks-ass.net> <20150218171256.GA28553@treble.hsd1.ky.comcast.net> <20150219002058.GD5029@twins.programming.kicks-ass.net> <20150219041753.GA13423@treble.redhat.com> <20150219101607.GG5029@twins.programming.kicks-ass.net> <20150219162429.GA15980@treble.redhat.com> <20150219163359.GA25438@suse.cz> <20150219170353.GB15980@treble.redhat.com> <20150219171929.GA13178@suse.cz> <20150219173255.GC15980@treble.redhat.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 804 Lines: 27 On Thu, 19 Feb 2015, Jiri Kosina wrote: > > How about with a TIF_IN_USERSPACE thread flag? It could be cleared/set > > right at the border. Then for running tasks it's as simple as: > > > > if (test_tsk_thread_flag(task, TIF_IN_USERSPACE)) > > klp_switch_task_universe(task); > > That's in principle what CONTEXT_TRACKING is doing, i.e. the condition > we'd be interested in would be > > __this_cpu_read(context_tracking.state) == IN_USER Well, more precisely per_cpu(context_tracking.state, cpu) == IN_USER of course. -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/