Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1707685pxb; Wed, 30 Mar 2022 08:42:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/Lqyhlk1vrKhQVWkgnyXWyQLEbFnf9OmHIBWn6APzEONsn0idV2n1TD/Hz7vi4T/8QKwD X-Received: by 2002:a50:d4d2:0:b0:410:9fa2:60d6 with SMTP id e18-20020a50d4d2000000b004109fa260d6mr11330997edj.35.1648654974514; Wed, 30 Mar 2022 08:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648654974; cv=none; d=google.com; s=arc-20160816; b=0U/Dna6KWkODYSJ+cqOKC2MBu84R+kkNEXIFKfh6ELpNMcX6kaFDdQSVjQS7d5cUQr lZ1eIrsDLG7sm9YROSKo6SCgBCUj0yqA4lc4J3P354NOZgaksDGLjHfHnwNu1QrGhS9R uIebiE5NOWsbb/wvDVjQB5yVsG3lpdN8MVmUZAnneRMWEtthrwHrkid6/0VfrowqACNd CTK4vW2mPrLFWSUqObHN51Nlmkt12eYi3o9i3JQPcZm6aTLwSJRGDd8/rOQn/BYc4K21 84PO012UMi5732CqBae3/xi6V1jaFO/+l8BQayMUvdhGI1qtJ4eM4z8lUzgs2Bu0Vmt/ XPSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=McDUKcfokPW/6itfRQEgSMjRsvg3eg07/lKR8b8auz4=; b=FLS39fLNwYZDJjFyKw/mGG3YaIGnHXJrP6VZ0VfSRNZeNoIycuPlkvPlj0/CUTfOIb o3VqAb0Qyq8XjPY2ZLIRiYbdpnXH9m4z00kTNkT/YX1/kO3fZyNwTN95F8sFnfeVMlyY KWN/778M5IH/DIftp9y+6MmXKv8zEJOEHdWVbyMa7GthTUpcoaKo+TD4S3pFoZ2PjYMZ H+fs8hjNcB2aRmnCmfhJUV4yDkz0yofPbx9Hndt1tl1jWtNcZXVjgTWQTDuJ3d75uIF/ 8bLTkxe6ks2VmK6SgYcUrReinkisElpbWXWLSF3IRCJy13HFohdzb/qZxdOMxcM8IJP/ Fzbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="BKHan/P0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020a50ed17000000b00418ecb800bbsi20102853eds.118.2022.03.30.08.42.28; Wed, 30 Mar 2022 08:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="BKHan/P0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233926AbiC2O2I (ORCPT + 99 others); Tue, 29 Mar 2022 10:28:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbiC2O1w (ORCPT ); Tue, 29 Mar 2022 10:27:52 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EBA96FA1E for ; Tue, 29 Mar 2022 07:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648563968; x=1680099968; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y0Q8yMD+JJl3osszETSO8IwoxGDjW7MHZzj6dJbYL/g=; b=BKHan/P08LieBfEWBUVQlYD/Px0cFd99mzSt+zHY1HAM8jKmpg4Tpnjd uuHmsVvCsRhNrRyiNbQfVml3xVjg6nnQEDiFTiI5QMRaq8SXkbbEWP5My m90EFHXBf8tsozq+wdzHOqGw1hRV6s9xLJR2eDueadynB+HCtfVqH5o0Z +YEawazNEBA2fQdkrFBGbmYCpMABBBUDelj9HUoR9YhkvLIt5ucW6WwW0 /+lnqhrwfYCb4hbOmp5vafGEneQ9J1+QyMLAV7j3KyriDcgsAXPlTn3TS Yz3cO1ILd1f9R7kwh6ta2UprX8YM8ze9maOTifHbwuA7AtRNEcGrnq6bC Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10301"; a="259233288" X-IronPort-AV: E=Sophos;i="5.90,220,1643702400"; d="scan'208";a="259233288" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 07:26:06 -0700 X-IronPort-AV: E=Sophos;i="5.90,220,1643702400"; d="scan'208";a="518955505" Received: from schen9-mobl.amr.corp.intel.com ([10.212.200.19]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 07:26:05 -0700 Message-ID: Subject: Re: [PATCH 2/2] sched/fair: Simple runqueue order on migrate From: Tim Chen To: Abel Wu , Peter Zijlstra , Vincent Guittot , Ingo Molnar , Juri Lelli Cc: Yu Chen , Walter Mack , Mel Gorman , linux-kernel@vger.kernel.org Date: Tue, 29 Mar 2022 07:26:05 -0700 In-Reply-To: <3a24ba8c-b00d-2f9b-95c9-b8aba1b51493@bytedance.com> References: <3a24ba8c-b00d-2f9b-95c9-b8aba1b51493@bytedance.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2022-03-29 at 18:09 +0800, Abel Wu wrote: > > > > > > > +static void place_entity_migrate(struct cfs_rq *cfs_rq, struct sched_entity *se) > > +{ > > + if (!sched_feat(PLACE_MIGRATE)) > > + return; > > + > > + if (cfs_rq->nr_running < se->migrated) { > > + /* > > + * Migrated to a shorter runqueue, go first because > > + * we were under-served on the old runqueue. > > + */ > > + se->vruntime = cfs_rq->min_vruntime; > > + return; > > + } > > + > > + /* > > + * Migrated to a longer runqueue, go last because > > + * we got over-served on the old runqueue. > > + */ > > + se->vruntime = cfs_rq->min_vruntime + sched_vslice(cfs_rq, se); > > +} > > Should se->migrated be cleared after place_entity_migrate? > It is cleared in update_stats_curr_start() before we actually run the task. If the task gets migrated again before we run it, the se->migrated will also be updated in migrate_task_rq_fair(). Looks like there is no need to clear it here. Tim