Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp955083rwr; Thu, 4 May 2023 11:54:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jMuVeOjZcp5Vztyhi98nMZphKuhkBGBx1R64ZzfkfFiEw8zgvCPZ9mmStCBm+lLpVWFEs X-Received: by 2002:a17:90a:d202:b0:24d:fb8c:5ab3 with SMTP id o2-20020a17090ad20200b0024dfb8c5ab3mr3035168pju.24.1683226474106; Thu, 04 May 2023 11:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683226474; cv=none; d=google.com; s=arc-20160816; b=M/SW9ffBBcSrvc5Qke5O4INQkN1sbcvOgyKQ7MW8zwWYMZcQajxBmRAcSrR0rByTpS UtYnSGEqVNRXE0th13rpwILewXSDesLJSXNDLh9fYiDBmVkPLVTNfHh3Js/pt/XdnOis y7oE3dLRv9eD9hjaGDhayyIjGgH3SSxzxSDMAFix4nhVPADh2ufWgEFw51shXI+iAdYD mCaNY9fpiBKSTeyM8EuJpPvqJ72nTDDp+fc+fdqpgf/BxjofcPnxqFxRtH7bss1t3VCy ld9MwQZ9Tyx0S3JUkmJx3MLNMiQ3qRy3GyAwGL1Mh3FEGolfJsnW1P3JivH1sNgaHDf5 jn0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+ahqT2qK2HP6aaU8/Xb1AjQNrt44RhqBn093YYa9pWY=; b=DS7IS4qKtc6Vhhlb5j3uJoTPX2hw5uQ5tQ2FM4lCdJJGxAJpi2g43vMRedKa38zdd9 XdcGsO5w7NOCuafbXQwQNlVE+hGPPw6hGGAYvLY+z/m0yuaCco/3SmCL8IanNKaN2L4R YkzRxnBUy8O05Jht6TgCnmdq0MRlasWFH04gR9RBSlWQjSv6A0dOAV0EPAWcPPgZ92CT ptfa06cCMu0TaSbJMMKMEn8zeBPi/IjROn4j9Dh9dWLT5wDbIdvGo7d0FkP7ZoZ6XYkk 9YfrLISV/rbTvUr3sDtdIM0iwvHkgPK/oTmvGMxKMWaLqnHzvil39qUanTsKSOlCiahW PxbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=egspf4s2; 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 v16-20020a63b950000000b00524d6cd6415si53069pgo.665.2023.05.04.11.54.19; Thu, 04 May 2023 11:54:34 -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=egspf4s2; 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 S229795AbjEDSaF (ORCPT + 99 others); Thu, 4 May 2023 14:30:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbjEDSaD (ORCPT ); Thu, 4 May 2023 14:30:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99C3C2D5F for ; Thu, 4 May 2023 11:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683224957; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ahqT2qK2HP6aaU8/Xb1AjQNrt44RhqBn093YYa9pWY=; b=egspf4s2QR5Qj4h4UXCtntUg6D7Mfox3w7c/lzuDQp/1YbL50QVIOQ4Iox0/99gtbQfwHP aEX5dAhNazS/yJ9C9D0Sdp4HFDjmOj/dC95QyUE3nUu94Tqj/dmEeylIj6zMwjM6FbAigy BP0laOELjuoixNfkpgYutyfFOq5ElGY= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-E5968vG1P7aTe2Za06Z8Ig-1; Thu, 04 May 2023 14:29:16 -0400 X-MC-Unique: E5968vG1P7aTe2Za06Z8Ig-1 Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-64115e69e1eso9869168b3a.0 for ; Thu, 04 May 2023 11:29:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683224956; x=1685816956; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+ahqT2qK2HP6aaU8/Xb1AjQNrt44RhqBn093YYa9pWY=; b=V9/PRSOvTAiGuuIq1kOfjSKtMkspiWpOkMxACVFpPLu9dw8l2bQQYN7yemF5fG69W0 A51kajdfOOLZ217cbRYflaidTnCVZuBaiydB8gd/sJ742D9MCSopyHeyKXwZlfrQk/hO e1iq5833K+r4lllUHthVEkl1AmO6/ii9ccGKOq8dpqC+sJulo8/YhIDLEodG+xaE3wxb 7aWjqfhsZ/D7BjE626u3H9CL8gZFuwS6BIfllyEq1IcwmZHh6gs2UF8GgtgpckeO9HVW l8EWofEKiZm5DF+3qQWffg3tkvOiYBdii3vN44KxLLMIOzSJ7r8jOCGrOTIt4jABNuA1 h8JQ== X-Gm-Message-State: AC+VfDxONUWPwGAT1bV9wmEwfoB/9mpAix0+O2aJFbD+45Q38TocRU8O LajxMM9XNPCyWEQIrelnE9+EWxTp/76pXXf00gkJ1krWindOzrUS3QV8Lkbo+lFf0DIGDfr9Sp8 yDS3k1xx0Jh8dQ56l/S9mLXfNvaOYUnR6KdR4e6bt X-Received: by 2002:a17:90a:ec01:b0:24e:1ca6:2206 with SMTP id l1-20020a17090aec0100b0024e1ca62206mr3556597pjy.8.1683224955640; Thu, 04 May 2023 11:29:15 -0700 (PDT) X-Received: by 2002:a17:90a:ec01:b0:24e:1ca6:2206 with SMTP id l1-20020a17090aec0100b0024e1ca62206mr3556573pjy.8.1683224955310; Thu, 04 May 2023 11:29:15 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <20230504152306.GA1135@redhat.com> From: Wander Lairson Costa Date: Thu, 4 May 2023 15:29:04 -0300 Message-ID: Subject: Re: [PATCH v7 2/3] sched/task: Add the put_task_struct_atomic_safe() function To: Oleg Nesterov Cc: Peter Zijlstra , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 4, 2023 at 12:23=E2=80=AFPM Oleg Nesterov wro= te: > > On 05/04, Wander Lairson Costa wrote: > > > > On Thu, May 4, 2023 at 11:34=E2=80=AFAM 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. > > https://lore.kernel.org/all/Y+zFNrCjBn53%2F+Q2@linutronix.de/ > I think that was my confusion in that thread. My understanding is that CONFIG_PROVE_RAW_LOCK_NESTING will check lock ordering but not context. I feel my ignorance is blocking me from seeing something that is obvious to everyone else :/ > Oleg. >