Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp928467rwr; Thu, 4 May 2023 11:27:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5aDkKQFujQBr4AVZ69SV4P2pyLwS+hRODZ4MYTyeIEsHJggvDi5ZKfIW0iULATE9c8r6Fv X-Received: by 2002:a05:6a20:a691:b0:f2:57da:7f45 with SMTP id ba17-20020a056a20a69100b000f257da7f45mr3474045pzb.8.1683224865613; Thu, 04 May 2023 11:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683224865; cv=none; d=google.com; s=arc-20160816; b=W+iN2Nc5e/sgxdUNoO/Oq+UuoRSaZk6wvZsqvtaqExps+MWFQlnLpHfCKy2q4TBUAv nyxvW3HfjE7/6xs6yrlC+ve2pSQuo4X5fdx2Ap9x524vYT/s2ysFPFeLAFgIpX0L3FFB zdRZ+vxOa/VgZ6xRkgPwzt43ZMpjVL5y10hAUUFtSR7+Y8a2k/ikGq2v/hRZYeNgUzIp 9J8wRAvdAOKBAc75ejK8wDvEjuavtsKd52ZZH5k5kIxDlhzF9v8fNJ81MPVG5o8rjIKF sqYtr+d4si5TGdkd9Q32D9OR7Bnb3HJz+v6V6GQAac8k2xfUIbpdQdsuv4nCsGBPLlf1 NEtA== 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=xk9N1SAae40jiJ+7feKN65ej6E8xOtfFm29HAuZRStU=; b=NDng5DQPGUnl2f5cvZLuerPLdUcVRAhZ41k4wVyBp2FUEm8IIYn1NsWFbOnIz8jNsB Isyxj/lnEg8t+oIEGHCaJHpcmup666/l3ZcGjo+nad93nkupEHemahvWTmAk9ul4ik+h MDH0kxrm4mLcfIJLvgegJUhKhj00wVeHnA1ipeiWhGHjzV8SYnTpaOCYQ06eD6XC2e0K K0VWexL/ozyKNwE/txLCgFSYzdgFddJ9GB/JzXlIG3PrnYE5HLaDSh1J3TMVOsAaemkT b9SaQPSTfc+nOONN55a2o8NDFMBhueQZ7r0NcyhDGiL+Yi/Da3IG4Ns+d4a9BG7u1qyH DJ2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gHNxPSGa; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a637f11000000b0051b1966e41asi30319pgd.523.2023.05.04.11.27.33; Thu, 04 May 2023 11: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=@redhat.com header.s=mimecast20190719 header.b=gHNxPSGa; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbjEDSWF (ORCPT + 99 others); Thu, 4 May 2023 14:22:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbjEDSWD (ORCPT ); Thu, 4 May 2023 14:22:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 745051700 for ; Thu, 4 May 2023 11:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683224485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xk9N1SAae40jiJ+7feKN65ej6E8xOtfFm29HAuZRStU=; b=gHNxPSGaUCJ7J5kbkiFUf1y1yAxJumQQMhwfQOauWkuKCjhXeXpSodPTQocH978h7N7j4e JwlHnh8bzFevbSJ/OGEIxIbz2+f4trxkTewiTi3Phyz5B0U3ebhNQCSnF9OuKGt/m9cpEz 6F7xxDil7T1J3Ndh1jxy8PcCLFbTbmk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-151-qpzBBuZNPiaemdq36FY2fw-1; Thu, 04 May 2023 14:21:21 -0400 X-MC-Unique: qpzBBuZNPiaemdq36FY2fw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 17A9538149A8; Thu, 4 May 2023 18:21:20 +0000 (UTC) Received: from fedora (unknown [10.22.9.13]) by smtp.corp.redhat.com (Postfix) with SMTP id AE10940BC79A; Thu, 4 May 2023 18:21:12 +0000 (UTC) Date: Thu, 4 May 2023 15:21:11 -0300 From: Wander Lairson Costa To: Peter Zijlstra 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: 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> <20230504152424.GG1744258@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230504152424.GG1744258@hirez.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Thu, May 04, 2023 at 05:24:24PM +0200, Peter Zijlstra wrote: > 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 :-) IIRC, the in_task() is there because preemptible() doesn't check if it is running in interrupt context. > > But yeah.. something like that. >