Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3347231rwr; Sat, 22 Apr 2023 03:45:43 -0700 (PDT) X-Google-Smtp-Source: AKy350a3qeMx0u9RgdIJ/yqUu0T6zhihgzc0erP7nIBnxpVk7/NDM8l1Adq7KRZftCZMJLnRpqaQ X-Received: by 2002:a17:902:f690:b0:1a9:581b:fbaa with SMTP id l16-20020a170902f69000b001a9581bfbaamr3558047plg.2.1682160343207; Sat, 22 Apr 2023 03:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682160343; cv=none; d=google.com; s=arc-20160816; b=b8kqLHTCDrydpqqmjYIRjW3lxRBPTZztrp5WrzlmtNaHK5QjQobJX1W2kI45gQdB0j XglAa7HjfI2Z5OUXdKOD71dlkMLA97mGGi9IwPCIFhQ6LtZYJuMvduZu/N7MU99NjFOR SaH8ry//gfN/ulWodNAJJx92LsfG6Hgbd0o0M1RGBF/jydglHvYaE7PM2mp2MBhD4Bs9 lnNpw5Bw8N8CjnwTTprkTN7wbNg6kwkRxc9gjcySgRCAA6zQ4hv/oPP9E7Ktpzd4qFYO tVxoM2u6vOx2vHhUOSoTERqQhS/putPITnCapzbv2WMOZvT0NcONXoJG9nWhLbhLDF1b dD6Q== 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=nTBRzrCFMJSyQV3xF+3c2r7V805pGMBvCif9qSRYP6U=; b=Ht87azCz5XvW9xaJ/rWKHdHTm0RL7gTUnIPwOo02T7UMgBR4B9PfI++K6aYMEYo86F ad1T/cR9xt4KLm2sDE0xHpXAgPdE61clViQkutXxEn/3QZ8Zp+UxY2ynCZ/V8Zu1VP4C kSupaJvT9TekSFfWtCxrBLn1eNuQPl0IdZxVz1JPwltHKPIj509zkK2z/uxYhfKrfBOB eMpm8JyeM9QaRbSLM44L9xY0dvVgnTwi4SsifpSEKaBZeYhB+0YEAYoI8GDlCFtpB5at cOGtqB3OLl7GvGhkg678dt30EKWUatMk09RKhvlNQlukmdQa/gPzgyCgCMcWTCMzOyUT c58A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="I/OmNk/6"; 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 lh11-20020a170903290b00b001a533803d60si5988976plb.652.2023.04.22.03.45.29; Sat, 22 Apr 2023 03:45:43 -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="I/OmNk/6"; 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 S229794AbjDVKmX (ORCPT + 99 others); Sat, 22 Apr 2023 06:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbjDVKmV (ORCPT ); Sat, 22 Apr 2023 06:42:21 -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 035FC171C for ; Sat, 22 Apr 2023 03:42:21 -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=nTBRzrCFMJSyQV3xF+3c2r7V805pGMBvCif9qSRYP6U=; b=I/OmNk/6ia8kuizDRcqmISarq/ VI0CPyYAQ7iK6sj2K5lj7lMZFE5+Pg/gGC1/l89ozHCejHiF8CuqzyDCOfrI9In/SGG5sJIyF3ssn oWsir7QQ4RERRTuEt0jH5N5TTyi7fi+mz0RcGrdWD3Rhc7vij+gl2Wxy1pGM5r9REXZU9fgO0Cnqd pqSb4b5Tyd4fvSy50oNu5eXVvS3sTtjTAst/qJpmSOA3ToWhNz6KHxJ+2DDptnRAq1ooifILq469S Epkp6h5eD1AU74CyqFeoPrvdM668A0Hrpb3L/Vdul6/owy87NG8MJVpO/H/9MfYJNJkflaJuLpPY0 D7UyHKtQ==; 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 1pqAgv-006D2A-36; Sat, 22 Apr 2023 10:42:06 +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 6F62D3000DC; Sat, 22 Apr 2023 12:42:05 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2CA2E206D2924; Sat, 22 Apr 2023 12:42:05 +0200 (CEST) Date: Sat, 22 Apr 2023 12:42:05 +0200 From: Peter Zijlstra To: John Stultz Cc: LKML , Joel Fernandes , Qais Yousef , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Mel Gorman , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , "Paul E . McKenney" Subject: Re: [PATCH v3 08/14] sched: Replace rq->curr access w/ rq_curr(rq) Message-ID: <20230422104205.GF1214746@hirez.programming.kicks-ass.net> References: <20230411042511.1606592-1-jstultz@google.com> <20230411042511.1606592-9-jstultz@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230411042511.1606592-9-jstultz@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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, Apr 11, 2023 at 04:25:05AM +0000, John Stultz wrote: > +static inline struct task_struct *rq_curr(struct rq *rq) > +{ > + return rq->curr_exec; > +} > + > +static inline struct task_struct *rq_curr_rcu(struct rq *rq) > +{ > + return rcu_dereference(rq->curr_exec); > +} > + > +static inline struct task_struct *rq_curr_once(struct rq *rq) > +{ > + return READ_ONCE(rq->curr_exec); > +} > + > +static inline void rq_set_curr(struct rq *rq, struct task_struct *task) > +{ > + rcu_assign_pointer(rq->curr_exec, task); > +} > + > +/* > + * XXX jstultz: seems like rcu_assign_pointer above would also > + * work for this, but trying to match usage. > + */ > +static inline void rq_set_curr_rcu_init(struct rq *rq, struct task_struct *task) > +{ > + RCU_INIT_POINTER(rq->curr_exec, task); > +} > +static inline struct task_struct *rq_selected(struct rq *rq) > +{ > + return rq->curr_sched; > +} > + > +static inline struct task_struct *rq_selected_rcu(struct rq *rq) > +{ > + return rcu_dereference(rq->curr_sched); > +} > + > +static inline struct task_struct *rq_selected_once(struct rq *rq) > +{ > + return READ_ONCE(rq->curr_sched); > +} > + > +static inline void rq_set_selected(struct rq *rq, struct task_struct *t) > +{ > + rcu_assign_pointer(rq->curr_sched, t); > +} How is any of that helping? That's just making it harder to read. Can we please just keep it rq->curr and rq->proxy and stop this wrapper fettish.