From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C940AC77B7F for ; Fri, 5 May 2023 14:29:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232335AbjEEO31 (ORCPT ); Fri, 5 May 2023 10:29:27 -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 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