Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp999377rwr; Fri, 5 May 2023 07:51:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fQmODS4pw7bKiJIPWJ90Q0sVtYwLRCtfsJQxlUWFb/onhvB33Xpgj/LV7Gc8fHzIHhhAI X-Received: by 2002:a17:903:192:b0:1ab:1260:19de with SMTP id z18-20020a170903019200b001ab126019demr2635337plg.11.1683298306745; Fri, 05 May 2023 07:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683298306; cv=none; d=google.com; s=arc-20160816; b=lChqUuzRSZ5ICCj31/1YWS/hUqMLB7/TI55VcX0VpNDX8c+fT8NbWsdk6TI4ZgpAyl Cweh93DQ38bRZ2HhVB4s96b5VUKmrFJEn81BhNSjrcRwUS5RYwRV59dUk4Q4MI3A0Pfh LDWCXZqR8vHyzvYcm1kg6RoS/xAJCIIlS6FFd8Ub+Y5HMmvfvtEVTdTltls4xiU+Duok nvyZuUltAeijr0gfhnSOARm8RpY7AdUK3AFVIdxyGn6tj3GhQ3IwfcSaSypCcRSaMQ1+ XuLizFCfj7mmCymzkSt7p8Bt+nHYGvJXG1Qt/gWaVkzQabnHqm2mc9kS7GUDGzwSmZAt vMbQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=7uZ9Wo7CeD6Rw8LQDbCCtgR0XxmeIlWTDK9V/AwSbjw=; b=rDrOFX3mnUc/fHWZnr+ihfMcea+ZYeDW/So/01WxXBlbKVqv04jWFojJTjIYS+is/z 7uR2kuts941QNkp+xwKY+v9TtjqY2UupmyI4+0Wm6QFt/67XO1uulFhofGKOkLOGeBnS RhloXNku18mvKYldWFBRJzURJCyxyvoA1yfJh7AvpSDlTzNFnTa+JTMzg7ghlF94gRnL 0Ea8W2AH2mEJT6kecd1H5r6ahmA2wE8JvPfh2DBRc2vukMJrbDyb7WNEWv1Uoz3Vpj7C jTOktSkxIx23stevlDhqs4+Iowb/aO6XgJvF4F0QVwnBEKlirkJ9ZPClCMaceeztAenj hOdg== ARC-Authentication-Results: i=1; mx.google.com; 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 l20-20020a170903005400b001a1f3916f4bsi517653pla.265.2023.05.05.07.51.30; Fri, 05 May 2023 07:51:46 -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; 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 S232229AbjEEO30 (ORCPT + 99 others); Fri, 5 May 2023 10:29:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230300AbjEEO3Y (ORCPT ); Fri, 5 May 2023 10:29:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E08741723; Fri, 5 May 2023 07:29:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B2A063E70; Fri, 5 May 2023 14:29:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 819AEC433EF; Fri, 5 May 2023 14:29:19 +0000 (UTC) Date: Fri, 5 May 2023 10:29:16 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Wander Lairson Costa , 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 , 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: <20230505102916.4aa664dd@gandalf.local.home> In-Reply-To: <20230505102602.2052c83a@gandalf.local.home> 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> <20230505133235.GG4253@hirez.programming.kicks-ass.net> <20230505102602.2052c83a@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, 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 Fri, 5 May 2023 10:26:02 -0400 Steven Rostedt wrote: > > > IIRC, the in_task() is there because preemptible() doesn't check if it > > > is running in interrupt context. > > > > #define preemptible() (preempt_count() == 0 && !irqs_disabled()) > > > > When in interrupt context preempt_count() will have a non-zero value in > > HARDIRQ_MASK and IRQs must be disabled, so preemptible() evaluates to > > (false && false), last time I checked that ends up being false. > > Interesting, I can't find v5 anywhere in my mail folders (but I have > v4 and v6!). Anyway, from just the context of this email, and seeing > IS_ENABLED(CONFIG_PREEMPT_RT), I'm guessing that in_task() returns false if > it's running in a interrupt thread, where preemtible() does not. But then I question, does it matter if it is running in an interrupt thread or not for put_task_struct()? -- Steve