Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp712536rwr; Thu, 4 May 2023 08:39:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41yxO3cGDSmcoCqvl5g8fzwZZE0drwt4K39HR473Clvq/BdxCxID7kyvlYAK0DxtbiRmyK X-Received: by 2002:a17:90a:d197:b0:24e:2759:8dbe with SMTP id fu23-20020a17090ad19700b0024e27598dbemr2916930pjb.7.1683214756977; Thu, 04 May 2023 08:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683214756; cv=none; d=google.com; s=arc-20160816; b=pQStqlFI1kBnYFANLNR96EA6OcE/n/AHXKBZLr3G78iIEQ1ip2BWa3mjxYOjUbHPPU T3LmADET1IgDiQoxqdVzusJMhelH2ACunjReNUGEuGDX709eLGUKS82pbDoH3E86uudb nZss5+fBtpee1Fs2ULZctckvd6UOOm/ty2R8rQNld5+qdzbOSaRja0NFWIsRWafN3LhU eeK9GshQDFn8QXFSVP839CluiZ1FnByfbCcRPZH9bZvYg15NNQ8/D9sKcqtt53JjVDc6 6xN7widd1DJlBKEvbDD0QR8M/HjI5ZmiW+fAKubJaCwjy/ae5VXBl7vK0rep9gwlW3rd TIYg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IIgIxNOgGajHepSM7/pf7gMv4ELrvOiprsqpPtX5j30=; b=y9jevHe0PnzR0UDtxV/aB/d1v7Sk/5jAx81z3KFE3F6aLxYiDSU0BkzG5yoSh30QdI XP0pCKuO1j6Ab5ni6hP9Kj/+Nl04708e64H9lOObkclbT9mL7W7tA2LjKjF35BQamVSM xRlFcLAnLdvzKQyu9OXVIlZ0f0VnZWBAdGYbn/XfDaBdDs5PytyWErbqugz+et9flEBv Cl4ukAhuZ4K2xMMi5mQ7NAdSffmPhcUiPX/3eJj7cHrote+B3sxo0hWEjgVGNh4h2vyy VyoIcWfoOGt85N4VfbyqrsM91lAsVrWMFconIgLdOY9mAg6OeGVrn7AK9MXfAEvXrx3l pJlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=B1XmU+s2; 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 s23-20020a632c17000000b004fc274006ddsi36872151pgs.670.2023.05.04.08.39.05; Thu, 04 May 2023 08:39:16 -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=casper.20170209 header.b=B1XmU+s2; 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 S231387AbjEDPb5 (ORCPT + 99 others); Thu, 4 May 2023 11:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbjEDPbz (ORCPT ); Thu, 4 May 2023 11:31:55 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C051D1BE4; Thu, 4 May 2023 08:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=IIgIxNOgGajHepSM7/pf7gMv4ELrvOiprsqpPtX5j30=; b=B1XmU+s26pWozDj4BUvpHNS0Jz +RQJ0DU8BucpVqaYBl7JlhMjdzIigHBLi/LSa/4NxWRc6+IpkYTFATw3/8ljZerMtuCByt62ElNa3 Z+lh5u+4c7//dpiYmUvcsgd/dQfg+N+dBkRMV2/97CuO7jtmAwfFlrXtubc9g2+SsBqxNe/gTyIeV tAh6xuKmmhM1kj3BlgfWzVqARuar4UnoyCi0atp6ivVK19HLgt2MSHhnAQbnKSHJE0iKxe/Gm1IUQ EExxjNgb4+v2c/6chk61uUE7O6DVJ71DxLpMDpdozmL/KZK2fReRB4+dOIK0InCznAUCHKLf9GJ0m v44CuJXA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1puav4-00AikD-4J; Thu, 04 May 2023 15:30:58 +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 643E7305ECF; Thu, 4 May 2023 17:30:57 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 458FD2418C43F; Thu, 4 May 2023 17:30:57 +0200 (CEST) Date: Thu, 4 May 2023 17:30:57 +0200 From: Peter Zijlstra To: Oleg Nesterov Cc: Wander Lairson Costa , 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: <20230504153057.GI1744258@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> <20230504152306.GA1135@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230504152306.GA1135@redhat.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 Thu, May 04, 2023 at 05:23:07PM +0200, Oleg Nesterov wrote: > On 05/04, Wander Lairson Costa wrote: > > > > On Thu, May 4, 2023 at 11:34 AM Peter Zijlstra wrote: > > > > > > 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. > > Yes, but as Sebastian explained CONFIG_PROVE_RAW_LOCK_NESTING won't like it. This can help: https://lkml.kernel.org/r/168303194177.404.8610123576035502891.tip-bot2@tip-bot2