From patchwork Mon Nov 30 11:02:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 63672 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAUB54fD019937 for ; Mon, 30 Nov 2009 11:05:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752907AbZK3LEe (ORCPT ); Mon, 30 Nov 2009 06:04:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752929AbZK3LEe (ORCPT ); Mon, 30 Nov 2009 06:04:34 -0500 Received: from hera.kernel.org ([140.211.167.34]:47288 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752274AbZK3LEd (ORCPT ); Mon, 30 Nov 2009 06:04:33 -0500 Received: from htj.dyndns.org (localhost [127.0.0.1]) by hera.kernel.org (8.14.3/8.14.3) with ESMTP id nAUB2mgr023587 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 30 Nov 2009 11:02:50 GMT Received: from [192.168.0.5] (unknown [222.99.201.236]) by htj.dyndns.org (Postfix) with ESMTPSA id 011A91006C26C; Mon, 30 Nov 2009 20:02:54 +0900 (KST) Message-ID: <4B13A654.8030306@kernel.org> Date: Mon, 30 Nov 2009 20:02:44 +0900 From: Tejun Heo User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090915 SUSE/3.0b4-3.6 Thunderbird/3.0b4 MIME-Version: 1.0 To: Thomas Gleixner , Ingo Molnar CC: Avi Kivity , Peter Zijlstra , Jiri Slaby , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, mm-commits@vger.kernel.org, Marcelo Tosatti , kvm@vger.kernel.org, the arch/x86 maintainers Subject: [PATCH tip/sched/urgent] sched: revert 498657a478c60be092208422fefa9c7b248729c2 References: <200911250111.nAP1BFg5030254@imap1.linux-foundation.org> <4B0FEA3E.5050108@gmail.com> <1259335036.6483.440.camel@laptop> <4B1113C0.30505@redhat.com> <4B138950.9040905@kernel.org> <4B13A24E.1080100@kernel.org> In-Reply-To: <4B13A24E.1080100@kernel.org> X-Spam-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 72b1a10..736892c 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -105,6 +105,10 @@ struct preempt_notifier; * @sched_out: we've just been preempted * notifier: struct preempt_notifier for the task being preempted * next: the task that's kicking us out + * + * Please note that sched_in and out are called under different + * contexts. sched_in is called with rq lock held and irq disabled + * while sched_out is called without rq lock and irq enabled. */ struct preempt_ops { void (*sched_in)(struct preempt_notifier *notifier, int cpu); diff --git a/kernel/sched.c b/kernel/sched.c index 3c91f11..e36c868 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2758,9 +2758,9 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev) prev_state = prev->state; finish_arch_switch(prev); perf_event_task_sched_in(current, cpu_of(rq)); - fire_sched_in_preempt_notifiers(current); finish_lock_switch(rq, prev); + fire_sched_in_preempt_notifiers(current); if (mm) mmdrop(mm); if (unlikely(prev_state == TASK_DEAD)) {