Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp608579ybm; Wed, 27 May 2020 03:41:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU8efHBiw6eg3F+2YhARGE/E5CbMT6KVRfbIOF/Aj8WVhQHcIamq/BJn/KcyrPyljdqwsh X-Received: by 2002:a17:907:10c2:: with SMTP id rv2mr5219853ejb.309.1590576100516; Wed, 27 May 2020 03:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590576100; cv=none; d=google.com; s=arc-20160816; b=mIQ3offxFJRR5dFRuoAhDKIO8KPd2AQcoYtHt7Ra3NpvWL0GU+YC6Xb6N6RcV/MPP/ vFqaft20k1QBY3GzaFwt09b7GfanNVRSBZtOqqKqUQsRtMpnmI/yj47mcgOLkjtfCdfj Ku3T7w5XrTDLh9LXMg6jeVO2xFW297pWp4WXuMckpI6mA5qA9Z9+8NpgF/izrqf3sbAO JZbO/DGeW00SXOrv2c0u7bwuoQFoylDeiTgjy6YA/mbPb308CsyhMZ8IqNq3HKHofLJI WPvdtVw1jPoZDBg2GuZuSlLmptT/GzP8mLqVDjajh4etvJWmVJTC4T699sAe2wMgS3Dk VdAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zktQjkPIq8F7/eqX0nZqeVIC495NLQMSfws8aVeqIPI=; b=HXdi0GCHxGJuOIJ2uYG+WPTnhQBO7eNhIAK+GbI2bptV14bo6g+kP3PJmMP2MO4cJx WXDpCjOzKgjng2gIOWiDwaIhqEFwsWW7z68u0HC6eFlzqdBoqCZkdkePUlQgmnVgBDQ6 gmLS/wKdKMW7mMsh2qQxZ6ycjSBlsD0vVaxTROtJSG8NWGtGl9n784eNF9V35UqcGXv0 TtCwVsSLbx8w8Mqlums2z2/oBu2wdYkeifY6MxDa5QE2Ycdcdurp4VtUGpBZ3Hj3JneJ rrdFU947W7Fu/yAtBQL6vHUavYHjHr2RtTNFmaM7HEMVFGngm2Z5P0oKqSBX5GwszdSY eUIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@unikie-com.20150623.gappssmtp.com header.s=20150623 header.b=JMBYzYs7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt13si2189104ejc.368.2020.05.27.03.41.16; Wed, 27 May 2020 03:41:40 -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; dkim=pass header.i=@unikie-com.20150623.gappssmtp.com header.s=20150623 header.b=JMBYzYs7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387874AbgE0IRW (ORCPT + 99 others); Wed, 27 May 2020 04:17:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387776AbgE0IRV (ORCPT ); Wed, 27 May 2020 04:17:21 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAC64C03E97C for ; Wed, 27 May 2020 01:17:20 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id a2so26912718ejb.10 for ; Wed, 27 May 2020 01:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zktQjkPIq8F7/eqX0nZqeVIC495NLQMSfws8aVeqIPI=; b=JMBYzYs7GwNK/iQLl5zExv/dNJWSk8eC2CrzKLirhInzMYf5arbF0isOJqOaeueLUd WQjDXa1B8f9+HVHrLVufIHu+dElkGQ6p/ZTQ5a6nnQaiYzLGerknQoq+LMBze2hak29v IC/8KnaI+0R8PCj/M8ZJShEMJ6IMcCDL1LBhPNU4NJUAO7nflaGRb+5cJ6iQaMFHuWHb jvEG3hDzDFaG4RT86/EQVkvpEc+WGGQz7Zhe/vlFVjGQ//0Oh2UtsYkAtNn7tP+cYqtD mki4CXaDVkKqpAXapVMRQdz2D7MIpAehE7a5p/rnQLOdB5vMX4Rfz84w5bCX0LLLw7v6 ZEcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zktQjkPIq8F7/eqX0nZqeVIC495NLQMSfws8aVeqIPI=; b=jaBwVj8mW5WDxpfs1CHEl8mpsgsYE6UyI6prUlaRa7hTzR4iH8n3/CWq/Q0WA/V+q4 l887VkpXmhpNsteBzjMjGeWKPBIKRH9qACWLifI4OKVyTH/obBpzNHbpAx/A7imb7mgG b0wVzaAmcC1E1AZHOTQvfXpNhbvV+kfyTfwVU1rQZXWVbEbqFqE/RxMbat2+96lWKhBH c6KljSA+42t8/3G934zLJ/Jvn2Dm+k3VjzzvIQZBaEcNx5V7K5uwrb1SqpwWKs7Pg+VY UIAY+krzYaF/q0rurcOg9x/Hpn7jesEyApqkE3R2EIT+P37cfyZkx3H+p4XQEkeI/Jcv We7A== X-Gm-Message-State: AOAM532Py0Xrrk1STocombLKA4NDidW1HST4FmxaVsP8yp2/CMKLGZXN 8thFYMU8aaKwtjHp7Zq70dpM1kCjUnnRvltA4HfCPQ== X-Received: by 2002:a17:906:34c4:: with SMTP id h4mr5179696ejb.167.1590567439597; Wed, 27 May 2020 01:17:19 -0700 (PDT) MIME-Version: 1.0 References: <20200514092637.15684-1-John.Mathew@unikie.com> <20200514092637.15684-4-John.Mathew@unikie.com> <20200526102511.GA5681@linux.vnet.ibm.com> In-Reply-To: <20200526102511.GA5681@linux.vnet.ibm.com> From: John Mathew Date: Wed, 27 May 2020 11:17:08 +0300 Message-ID: Subject: Re: [RFC PATCH v5 3/3] docs: scheduler: Add introduction to scheduler context-switch To: Srikar Dronamraju 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 , Dietmar Eggemann , rostedt@goodmis.org, Benjamin Segall , mgorman@suse.de, bristot@redhat.com, tsbogend@alpha.franken.de, Lukas Bulwahn , x86@kernel.org, linux-mips@vger.kernel.org, tglx@linutronix.de, mostafa.chamanara@gmail.com, willy@infradead.org, Valentin Schneider , Randy Dunlap , Mostafa Chamanara , Oleg Tsymbal Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2020 at 1:26 PM Srikar Dronamraju wrote: > > * 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 Fixed in v6. > > > +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? I reworded the description in v6. > > > + 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. Yes, hopefully better described in the v6. Please review and ack. > > + > -- > Thanks and Regards > Srikar Dronamraju