Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp335102rdb; Thu, 21 Dec 2023 10:23:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+Zfgth3QrzTsVrsoHqVwVsEeF1MZ9PXmoscdGclluDAHA9hZa4ngIvQDyL6rtB2vBDEg2 X-Received: by 2002:a05:6e02:3a86:b0:35f:6607:28e4 with SMTP id cr6-20020a056e023a8600b0035f660728e4mr47073ilb.48.1703183027304; Thu, 21 Dec 2023 10:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703183027; cv=none; d=google.com; s=arc-20160816; b=DMn+hH1bhpi+uT565lEWoYcH0loViXiSYrpPflI+Tsb9NSvb4XewpkfjsMFZHSjDqv r0De3weFL110t0Hk8plmsM1C7W7jd222mnZ+i3fR/gevvatouAffNEi5IbUiX6J4lyI0 Pho5UHrWeykfmzU0qqWOjlMIcGoA5wrX6GIzVmvRgKBQpWoBsi2/IHug+7F079EJYERd zHqXiGximivi1fAHGeQ7NhbYOz6zcm6y41SjqlFGxhwCVcCa0My+aO7eVa00Uo2o3yKA j6gHWeN0Mc5nJ6Cf0mjx77GUP7S/XsZ7Lg9mUih9QFou+kq+vbnsoH7hoVaciUZIGd8G fR1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=ji2hJdOh2AMJJzZjAydWcJirZrXR1RsLO+qH+PANSOc=; fh=bngxneGgce/nOiBOUPF0Z6VS1/aZBlGK3ulUq+ceMBc=; b=cvFRxObfmuNwIwboT0ki3mBcSFfk7sVrCvAeuqsWtPbBnnMsRISmDn86I5eZUV3LJH /JriY84u+KTcOwbjXOo48QCbIDSRLnpFAcF7y5DSFrpkemmKBaRnetXzuZ1dxyzF4Jmt ddd9txeMkuIbvUBYsT8DVWvA5fB5IKJM3K2tOP5uJ0oItItYx9aPZzX0VX0RTAgetRyA vBevTfuBx7ALCj6IQvMUbAD+f+tbOKiItlgcLOkxnZKccAXNK6Vc3V/f0JzdiTpu8Sc5 pfqvuubqSDDmbUw7xkmqVuFXIPSQv1lqqlzLvcC8AOMAzH16d7iuso10W5jDAuUgSB+u EUXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rAQ34tOX; spf=pass (google.com: domain of linux-kernel+bounces-8911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id by38-20020a056a0205a600b005ab2613a571si2095128pgb.495.2023.12.21.10.23.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:23:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rAQ34tOX; spf=pass (google.com: domain of linux-kernel+bounces-8911-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B8012284FE2 for ; Thu, 21 Dec 2023 18:23:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 329D96351E; Thu, 21 Dec 2023 18:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rAQ34tOX" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC9C4634F5 for ; Thu, 21 Dec 2023 18:23:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-54744e66d27so1094a12.0 for ; Thu, 21 Dec 2023 10:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703183020; x=1703787820; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ji2hJdOh2AMJJzZjAydWcJirZrXR1RsLO+qH+PANSOc=; b=rAQ34tOXylN1QgtOwDMs1bnacBzdvfq240g00qbC/Xb1YKCKOVsG6EaQKlBAXpFgiQ E300t4yIjSjfbHZmMDnE93sca0mn+/1PFLRv3eUKfYnOw4SYsM0lDVKktWEBIPfUBRel ulm5LVuNF+8sL2aGuW4Hk+YR6qEjk8yQqP6sz8+ulLrpoVkYCBs7beROOtMSs68bWh1z iQkqPp9lK0cvna9TuXV/l0TM0MOy0FjDqRKxXaIkCKyS1YJeYOz/Dg9yWQCWK5fotofl FnmOdfjdlLVDTtSJLV3QlKaLMPRVKLTMnp92U6zZg2EPHTNzuKNLf1gZoSf62OzY6pJv jTkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703183020; x=1703787820; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ji2hJdOh2AMJJzZjAydWcJirZrXR1RsLO+qH+PANSOc=; b=KgKeCJfDgRun9rfDUVnlNUmUzY7+uFyvb3E3lxwaj8ZqlCgDwFpfBa7zujvoM0tpD2 WhFL/8K6qrj/tlORGmagJ/na4M9+EEX7l+5iaPU+rptUxDyy/7HngK32byJXb2IIkDjv /ZgiLdLH2ZShHqVgyyaFhFTInQJZfjH168YYLe2iTI4JCfL9G7HRkyhCoYBz4mdxUX+R vo5jWVTeSfbRaJfe2PZtgCXh3yPy3DEUuV1C/Wq1hSIEWSVaiQDmgcoLfImLtNavxqQI SFtflBgMSKZahPTjbShJZKTOr9OVk+uktO/SfDukxUvzHIvR615QSsLiOdOY7v9KMRwK xsuw== X-Gm-Message-State: AOJu0YydxY7TbM8v9NvHXE6MWkIeLNftUJYVdPG/oHiVJfn2sA6qpBQC 7o88ArPhagPkFscCV14Yp/AHD1DQ8VyEcnvbJy2v2WRnk4M= X-Received: by 2002:a50:c109:0:b0:551:9870:472 with SMTP id l9-20020a50c109000000b0055198700472mr123135edf.1.1703183020025; Thu, 21 Dec 2023 10:23:40 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231220001856.3710363-1-jstultz@google.com> <20231220001856.3710363-9-jstultz@google.com> In-Reply-To: From: John Stultz Date: Thu, 21 Dec 2023 10:23:26 -0800 Message-ID: Subject: Re: [PATCH v7 08/23] sched: Split scheduler and execution contexts To: Metin Kaya Cc: LKML , Peter Zijlstra , Joel Fernandes , Qais Yousef , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Youssef Esmat , Mel Gorman , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Xuewen Yan , K Prateek Nayak , Thomas Gleixner , kernel-team@android.com, "Connor O'Brien" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 21, 2023 at 2:44=E2=80=AFAM Metin Kaya wro= te: > > On 20/12/2023 12:18 am, John Stultz wrote: > > From: Peter Zijlstra > > > > Let's define the scheduling context as all the scheduler state > > in task_struct for the task selected to run, and the execution > > context as all state required to actually run the task. > > > > Currently both are intertwined in task_struct. We want to > > logically split these such that we can use the scheduling > > context of the task selected to be scheduled, but use the > > execution context of a different task to actually be run. > > Should we update Documentation/kernel-hacking/hacking.rst (line #348: > :c:macro:`current`) or another appropriate doc to announce separation of > scheduling & execution contexts? So I like this suggestion, but the hacking.rst file feels a little too general to be getting into the subtleties of scheduler internals. The splitting of the scheduler context and the execution context really is just a scheduler detail, as everything else will still deal just with the execution context as before. So it's really only for scheduler accounting that we utilize the "rq_selected" scheduler context. Maybe something under Documentation/scheduler/ would be more appropriate? Though the documents there are all pretty focused on particular sched classes, and not much on the core logic that is most affected by this conceptual change. I guess maybe adding sched-core.txt document might be useful to have for this sort of detail (though a bit daunting to write from scratch). thanks -john