Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp51724ybs; Tue, 26 May 2020 03:29:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTpVsGofp6cXeUR0kfk+KoZqsCkqSQORE+FzGOZNezcxlsq/i5H1t1bdRXVkd0tBSJQf4s X-Received: by 2002:a17:907:20e5:: with SMTP id rh5mr492389ejb.72.1590488976622; Tue, 26 May 2020 03:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590488976; cv=none; d=google.com; s=arc-20160816; b=YX2oI7iYS49T52DP+P3TaYWFCVDL4hCr8s0Hf6HQeaSomZu1XcvjBUviUD2ZCA69VT c++3PZUenXXecSLwv3zWxx4/Vek7tdassRwWm2BkoUtYjmKVVYKTKyRhEGEk/rbnaqWn X8Ndp90JOnqRrkNw2f2QGbTaIprUY+M5tYBsavCOEISPgKRVI5tj3qbtykzwVA5nYBW+ AQkVUM8+Sh8tKyOBQFXjzDBznimWPDyvVdbAjFmyHeT72ivyfbchKFgl+w2yUpcWnTjL t+rbI0W02aqz8576/ksN/UBYkBs7PKkr4B61sX5bWk4p3lYWNGmKH7+TMu+vfh7ouq81 NDTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=RvQw7zcn/jHFIn3a7BhipHi4tI/Fa6DCJj9mDA7d9yY=; b=pfjowYfIwCy0FbosTxiwqX1BXmNLCCL+DG9i1Z0xtsMNM5YuxZ4H0EG3yLAgC8anvx hTgkWZ7LhfofsFuU5BpEGF1KhMIhKzi10aj6dSAYGL0PTlG3XtdR+iRd1L279n1wlrGh d/tUjK61qH52U5VyjWGeSvPS/iQRHdlTZYPzsLN8vQhEThr98zf8XOH29ZrnuWeBu/B6 CO7JocdcpCKnA7/y8w0lby3EjmhldBFLDiYBiJFUM7aCPUlM7UUEu/bBFGA9zfUqVDrL tbfuBLr8KEOagdvC3rYJ3/MeuIGkIq/N/NVFuIJtCMLbZrUWaRoT9L20YbgWzeC5dkwO FOMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c21si11290463edv.154.2020.05.26.03.29.13; Tue, 26 May 2020 03:29:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731885AbgEZK1B (ORCPT + 99 others); Tue, 26 May 2020 06:27:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:31442 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731815AbgEZK1A (ORCPT ); Tue, 26 May 2020 06:27:00 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04QA5xxx057571; Tue, 26 May 2020 06:25:20 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 316wyrpry4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 May 2020 06:25:20 -0400 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04QALbLM089259; Tue, 26 May 2020 06:25:20 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 316wyrprxg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 May 2020 06:25:19 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 04QALwVn011238; Tue, 26 May 2020 10:25:18 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04fra.de.ibm.com with ESMTP id 316uf8a9qn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 May 2020 10:25:17 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04QAPFY2000510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 May 2020 10:25:15 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9FB46A404D; Tue, 26 May 2020 10:25:15 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2F65A4051; Tue, 26 May 2020 10:25:11 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Tue, 26 May 2020 10:25:11 +0000 (GMT) Date: Tue, 26 May 2020 15:55:11 +0530 From: Srikar Dronamraju To: john mathew Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, corbet@lwn.net, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, tsbogend@alpha.franken.de, lukas.bulwahn@gmail.com, x86@kernel.org, linux-mips@vger.kernel.org, tglx@linutronix.de, mostafa.chamanara@gmail.com, willy@infradead.org, valentin.schneider@arm.com, rdunlap@infradead.org, Mostafa Chamanara , Oleg Tsymbal Subject: Re: [RFC PATCH v5 3/3] docs: scheduler: Add introduction to scheduler context-switch Message-ID: <20200526102511.GA5681@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20200514092637.15684-1-John.Mathew@unikie.com> <20200514092637.15684-4-John.Mathew@unikie.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20200514092637.15684-4-John.Mathew@unikie.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-05-26_01:2020-05-26,2020-05-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 phishscore=0 adultscore=0 clxscore=1011 malwarescore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 spamscore=0 mlxscore=0 bulkscore=0 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005260073 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * john mathew [2020-05-14 12:26:37]: > + > +Context Switching > +----------------- > + > +Context switching, the switching from a running task to another, > +is done by the context_switch() function defined in kernel/sched.c. context_switch is defined in kernel/sched/core.c > +It is called by __schedule() when a new process has been selected to run. > +The execution flow is as follows: > + > + > + For a kernel task switching to a user task, switch_mm_irqs_off() > + replaces the address space of prev kernel task with the next from the user > + task. Same as for exiting process in this case, the context_switch() Did you mean existing instead of exiting? > + function saves the pointer to the memory descriptor used by prev in the > + runqueue???s prev_mm field and resets prev task active address space. > + -- Thanks and Regards Srikar Dronamraju