Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5711984rwl; Tue, 4 Apr 2023 02:27:45 -0700 (PDT) X-Google-Smtp-Source: AKy350ZSgp6GxL6uF/JM0Rn17iv+Tlt12ZJ/lq1sdlC/7zARWYhRebuYOGhi9zU+cvaivz38zX8P X-Received: by 2002:a17:906:5a5a:b0:948:b300:6e9a with SMTP id my26-20020a1709065a5a00b00948b3006e9amr1548172ejc.32.1680600465120; Tue, 04 Apr 2023 02:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680600465; cv=none; d=google.com; s=arc-20160816; b=lOOQAd5hhpMQxMR5qFmabml8jAPPnLSA5Xq1Ji/zAeN2WQjg4KU08hP4sq4kFbi3He /wwu7TmArxxYekfZxwbcq+txEe+7g9YlCLe55Eh9rcdfq1E9E+7PVkl2fXLE4HFJoCx6 +m/Bw4Kx5b0Hd4Dtf9dQBlvU8g1MxjjKo4g1ub8RQOnHQKGymLg8g5h6Ta2nteZgoPAG N57+sQx1O0B/SxnrNgcPpYs0n3xaHrHYYZAuxPz/ZsCOSsaOLeNSr7ggQqoRagwX8bqC D3H4qoiAu8WwM3f43qh6WH6kW4ftpGkMECjZRwWYJWfX7mTRy1p0b+rTE7ISYsLTVNZn GQsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=r5aK41JlmJ+wuIMmAeBq19Fz0dTVrVv8FNnEIqiUcs0=; b=LxZ4kDOmnt8oZJoqejZCGnGmGIIA0rU8u1IDD+KXjHIju+iDrDcc5m0cEvsmvKlsEp 0Tq6u8eia39/UhaoLoO1gCDWJTehknh1M64YqAGX7c6tLJD57O71h3EJItSvAQZLI0vc rHaLV2i808V3Mb2khc9hecWcCByBm4wceu90ckhJMuJiOrE7RxqgFGgAEQg/eXoEreOO 95LSr+BRExtdJuoM0WPIyooBL53ZNOmlVArT1bVWbaVGJ5cU0A45p2bNnkhnTRExJjCa 3ldzhteM+W3YkNku6xOAX1o8QJa7UiSLaIFLyS+fPKSlu23OMeUpFXUorLeiKjO4s9RG w8BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="pl/uWVk2"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kw7-20020a170907770700b0093959594e50si407802ejc.248.2023.04.04.02.27.17; Tue, 04 Apr 2023 02:27:45 -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=@infradead.org header.s=desiato.20200630 header.b="pl/uWVk2"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234146AbjDDJWC (ORCPT + 99 others); Tue, 4 Apr 2023 05:22:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234140AbjDDJWA (ORCPT ); Tue, 4 Apr 2023 05:22:00 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A97D11981 for ; Tue, 4 Apr 2023 02:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=r5aK41JlmJ+wuIMmAeBq19Fz0dTVrVv8FNnEIqiUcs0=; b=pl/uWVk2g8WaNL+TeyByZcKuir 2DhHktRl0GxFg6D/gKiUOa+lBtcN+ihigAqKadwxiR09f1nXVr6oRt3mZGaqo1BvONkvcPAdf6tGs So9RcovZCAfF2R4Y1t3nFMJ6sEtr3DnLSqrg6Hq/D3CewOnF/IBhK/Mo7QDEj8tARvn2vNzje1hsO oew2b1plv8AQOVXAxhM7iP0LstnQ+Uy5uQnx6m7/NdpH3hykhXNFPw9VPdoYX+YmVBT+crgeWeCWH E4pqwkR3vxzrfnNYZ4JXL4+h7SxtbcTZFVbPQnmkrWzf04t1prmj1/LHdZd2IeRrNkhiOYHAbt5oD cmDUX0aQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pjcrN-009DaY-1x; Tue, 04 Apr 2023 09:21:49 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 992A930003A; Tue, 4 Apr 2023 11:21:48 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7F113242109F9; Tue, 4 Apr 2023 11:21:48 +0200 (CEST) Date: Tue, 4 Apr 2023 11:21:48 +0200 From: Peter Zijlstra To: Mathieu Desnoyers Cc: linux-kernel@vger.kernel.org, Aaron Lu Subject: Re: [RFC PATCH] sched: Fix performance regression introduced by mm_cid Message-ID: <20230404092148.GC284733@hirez.programming.kicks-ass.net> References: <20230403181342.210896-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230403181342.210896-1-mathieu.desnoyers@efficios.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Mon, Apr 03, 2023 at 02:13:42PM -0400, Mathieu Desnoyers wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 0d18c3969f90..775c7da6ec7f 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -2326,16 +2326,20 @@ static inline bool is_cpu_allowed(struct task_struct *p, int cpu) > static struct rq *move_queued_task(struct rq *rq, struct rq_flags *rf, > struct task_struct *p, int new_cpu) > { > + int cid; > + > lockdep_assert_rq_held(rq); > > deactivate_task(rq, p, DEQUEUE_NOCLOCK); > set_task_cpu(p, new_cpu); > + cid = sched_mm_cid_migrate_from(rq, p); > rq_unlock(rq, rf); > > rq = cpu_rq(new_cpu); > > rq_lock(rq, rf); > WARN_ON_ONCE(task_cpu(p) != new_cpu); > + sched_mm_cid_migrate_to(rq, p, cid); > activate_task(rq, p, 0); > check_preempt_curr(rq, p, 0); > I can't find more uses? Yet there are a ton more ways to actually migrate tasks.