Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp710807rwr; Thu, 4 May 2023 08:37:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wwNh8DRHkxiy+TL0+d31aIh+v8zVBFvaoj5nwbKnTtaj2UJmZCwATq2G/wcTbgksyZvFL X-Received: by 2002:a05:6a20:918a:b0:f5:35f2:3ff7 with SMTP id v10-20020a056a20918a00b000f535f23ff7mr3302813pzd.52.1683214671946; Thu, 04 May 2023 08:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683214671; cv=none; d=google.com; s=arc-20160816; b=ix+9LCpKqvqkjrDaMIyG2dX3uYmQbIy82N7Am4RKVK1HAfxhXBJ5HsDgR0tuwzyX+L cCDsBK1hRuVtF1bnZSYV6KNsB19US1QFJ0rNtdeXQHV1txPUEroQ6CF6mlw4SZb0cCbe EGj9bv01Y5G3sXBLENcfr2OGQAg07vF82CmzGx27x2FzspkRM6a9HfslAbFKCzA6EhA2 BNeCxuAhYpoiTkdKs1CHTHVCm3klfNM9+eVQPxy2pOgf95jU/sVsBXLdT57Ig+Jz7xD/ u8DmLrcPQU3tPy8wBKg55dBbLY+ejuj3xrNTXPc/Vyuk/+M24xbrsIBVNtqyEcqDqlGh xo1g== 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=zX4DJF+PwWblvm+wykuyM69Hc+yDwICH3hfz2Z5YxUA=; b=AhdQUVAmVYex/OocsPijwFdxoBW8NmS0teVMSVeY1XyZA8qIH6fI9VzHnWYJbUzuRc 9Qlw8y659SkndFRRclplz6ZsofBYJU00+P6cm1rTc9f6fnu7wy/E74swxq0S5UvTFV2D 8Offmpgh6MbiPw0l8lFy/kYaiwbfPFm1raHYnZoM7xFkSQNFAPb9fTUjNrQdgj+3/oXh pwqTXlp24r/1tf671t1RcWRGXtUOE+KVssXTyt7U/vVgkHVbuKCZkOsx8VuSAMerkcqz jPOZS7gSn3cHoBYeIW9+jLx/sOJNmGI/RCLbVJQb6gWlEsxgVYAp7eoWKKeoNm51PBdf l4RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=iagn8V3H; 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 t184-20020a6381c1000000b0051b3ea27f98si2918250pgd.629.2023.05.04.08.37.39; Thu, 04 May 2023 08:37:51 -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=iagn8V3H; 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 S230471AbjEDPZd (ORCPT + 99 others); Thu, 4 May 2023 11:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbjEDPZa (ORCPT ); Thu, 4 May 2023 11:25:30 -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 7717344A9; Thu, 4 May 2023 08:25:29 -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=zX4DJF+PwWblvm+wykuyM69Hc+yDwICH3hfz2Z5YxUA=; b=iagn8V3H/ViU6UBAW3QvY2VDmS 7r8yQMKFfDEj0r4m+r0l7q2MjBzsIfVtoqz3BQ8FZuJFc9Er+GUhBGPNJJD0B6zsL0FOSdzS2fHsM m24nPc2sDAKXt5Sr2hDNH3B3DPrCwvhv2RMqHtIUmoIr7uuobKPxp+uyPMwhVfWwh37LoiB7TB5VU 5XhaLX30+Nf71mfSgNXZ3Xeul58fwuM7C+oQyHWL8OZzaeMwcHkwy7+SlgDmobgD9m3rx9SnO1idn 3Mdsih0Iegc28wg9LlmmqRN/hm5Uf3pTPNdoaAtgDuu740bqIonmWEFr7oy0rWyOv5+a5JPQZOa4H citVwWUw==; 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 1puaoo-001lOu-20; Thu, 04 May 2023 15:24:30 +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 0E8FC3003CF; Thu, 4 May 2023 17:24:24 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C2E2224209FE5; Thu, 4 May 2023 17:24:24 +0200 (CEST) Date: Thu, 4 May 2023 17:24:24 +0200 From: Peter Zijlstra To: Wander Lairson Costa Cc: Oleg Nesterov , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Will Deacon , Waiman Long , Boqun Feng , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , "Eric W. Biederman" , Brian Cain , Kefeng Wang , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Christian Brauner , Andrei Vagin , Shakeel Butt , open list , "open list:PERFORMANCE EVENTS SUBSYSTEM" , Hu Chunyu , Paul McKenney , Thomas Gleixner Subject: Re: [PATCH v7 2/3] sched/task: Add the put_task_struct_atomic_safe() function Message-ID: <20230504152424.GG1744258@hirez.programming.kicks-ass.net> References: <20230425114307.36889-1-wander@redhat.com> <20230425114307.36889-3-wander@redhat.com> <20230504084229.GI1734100@hirez.programming.kicks-ass.net> <20230504122945.GA28757@redhat.com> <20230504143303.GA1744142@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, May 04, 2023 at 11:55:15AM -0300, Wander Lairson Costa wrote: > > Then I'm thinking something trivial like so: > > > > static inline void put_task_struct(struct task_struct *t) > > { > > if (!refcount_dec_and_test(&t->usage)) > > return; > > > > if (IS_ENABLED(CONFIG_PREEMPT_RT) && !preemptible()) > > call_rcu(&t->rcu, __put_task_struct_rcu); > > > > __put_task_struct(t); > > } > > > > That's what v5 [1] does. What would be the path in this case? Should I > resend it as v8? It's almost what v5 does. v5 also has a !in_task() thing. v5 also violates codingstyle :-) But yeah.. something like that.