From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751570Ab0IHNI2 (ORCPT ); Wed, 8 Sep 2010 09:08:28 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:64798 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905Ab0IHNI0 (ORCPT ); Wed, 8 Sep 2010 09:08:26 -0400 From: fabio de francesco Organization: metanix.org To: LKML Subject: linux/kernel/sched.c: context_switch(). Date: Wed, 8 Sep 2010 15:08:29 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.35-tuxonice-r1-100826; KDE/4.4.5; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201009081508.30490.fabio@metanix.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There must be something I am missing in sched.c at context_switch() function definition. There I can read the following code: static inline void context_switch(struct rq *rq, struct task_struct *prev, struct task_struct *next) { ... struct mm_struct *mm; mm = next->mm; if (likely(!mm)) { next->active_mm = oldmm; atomic_inc(&oldmm->mm_count); enter_lazy_tlb(oldmm, next); } else switch_mm(oldmm, mm, next); ... } May someone please explain why the mm pointer is likely supposed to be NULL? Thanks in advance. fabio