Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1008656rwr; Thu, 4 May 2023 12:44:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Ky9aKe9NVdyebP7wvOzKItYxpqVSiK8nedcRVjhbh+pm88oYK8r88Gf5nbMsbxN5JQKzY X-Received: by 2002:a17:902:f80a:b0:1a2:749:5f1a with SMTP id ix10-20020a170902f80a00b001a207495f1amr4426540plb.26.1683229442647; Thu, 04 May 2023 12:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683229442; cv=none; d=google.com; s=arc-20160816; b=K1tSv7W6u86wEFZTLkdP/WKy/adAMgpy8srE2vFc1AbDwWsI3vjgfnYnaMGpoN7u1f DAbG6EbV5Bx0VCnNNSTTnB54BuQNZHT6pgsxG//bw7cQ+uSX2agGhU4yCYeEsU0FwqbB +lJb3bW1E8rrvkVZdbQFVkMmmicaIsuKVOU2efakYMDJZd0tYnMa5VZDVdh0z8GlBuCr s+DbtOxUGNsuWO6/IQNykvohTdH+KEsES2XdZBONv/AntR5zGR54u6ZgNb6rwEoxvsGT WDcbfBlotKcGzoYskkSf3+lsOuzrxe3aphkO0ln2rKweBzkFYsTr9c4pNqvZzZM6lXqi k6yg== 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=xVAk0B1QqY/UI3sXcpLYnSi0ySDnKl0NNcM0I1JlNjk=; b=IfLx98/C+gti3qV2CL83T9FaBhc7wxauvyx4Odw9wfGVZQV8bwK4L12NElIDzD3cN6 m/GNdEIs3HYaV3Y72Re2vo7H55F/pokfyoT5P5ICm30iLo2eebcfV13dyuZ/3zdJiPCj uOnYzohqr1x0ZmLYZAPA7bRa/cYdIiuNkTXTK3Btin28adAxEWigpYniN2pEg49yuzId SRY+s/c+CDNK9IgXnXaxAkPKpCiCCyUE7CWk2YRSkKNFPTIQl0Nb/wO4uTtIsxC+Z17f 35/xybGo3Z0LhhX/uUrGx6nCZ235e5BSm6QmQ0KSRoSocbOAj/8oharDlM0qWZjmof6d udUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cU94WEN3; 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 mj11-20020a17090b368b00b0024bfc621e23si1082842pjb.42.2023.05.04.12.43.26; Thu, 04 May 2023 12:44:02 -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=cU94WEN3; 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 S229684AbjEDTjP (ORCPT + 99 others); Thu, 4 May 2023 15:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjEDTjO (ORCPT ); Thu, 4 May 2023 15:39:14 -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 0F9305FF9 for ; Thu, 4 May 2023 12:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683229110; 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=xVAk0B1QqY/UI3sXcpLYnSi0ySDnKl0NNcM0I1JlNjk=; b=cU94WEN3Zhd9srOppON/pB92MY2OcMBeTpk09f6Sm+S+ARcuQLfCtGMpGRzPebWTgoz/7h R7V03fsGbaJREgAFJVVXLvCGMaxBl4E8qssRKRa7hSSB5vvCCoxHtchOIEiC80aDi68oMz m7C12u2m+1EG9nqyKPXaVtBFpeNhXNM= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-67-bjql6d30OgyPAOFFEANeJw-1; Thu, 04 May 2023 15:38:29 -0400 X-MC-Unique: bjql6d30OgyPAOFFEANeJw-1 Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-64115ef7234so10086192b3a.1 for ; Thu, 04 May 2023 12:38:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683229108; x=1685821108; 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=xVAk0B1QqY/UI3sXcpLYnSi0ySDnKl0NNcM0I1JlNjk=; b=LConiaJoQ5yGsSYYGSNFx5LX6vaURNg7ifRh1r9TB7oeRv2IEkjOF6+0MAQBfS7Uf9 jblzHj7IHaZfnZjq1T/dQJd7NMLeUfZQS19tSC1MiRaAAvCc1oiExGSyUAFaghBP/aK9 6VAVYxrBclwFEAUpoBA3W9SF2rVh0wSOsGWxgP+wLCkhW0E6C3cnziIhvYbGAyCrtA1T T/L9h5gVDvM8gUqraGhEObUCzUc9Ev2+Cn/QhqLoKw0imZX47WV88cSYUpXSCDcmgs1Q 5KxHuZYMELGiUNYHOuvc6XsdLOvsXmPiZpIRLas28XLudtSyBOkUZt2dxcvV2gA4vY2J baQg== X-Gm-Message-State: AC+VfDxROfDPugxrmaHBA/FLBG+xKbWF5hCr+Rotw+7+cPUo7SEEXz+5 jUnbAFcnVi3knKzC46Zhu+UF5EznR5cXjmjFLb3vvbydVTxusma3YM+SIZkwbTcIMD131AXyzYX 6tG0k3tehUvR6FJbt/oqxnlj4FpdjPFEhVQgDGqqq X-Received: by 2002:a17:90b:38c2:b0:24d:f67d:7177 with SMTP id nn2-20020a17090b38c200b0024df67d7177mr3649792pjb.20.1683229108018; Thu, 04 May 2023 12:38:28 -0700 (PDT) X-Received: by 2002:a17:90b:38c2:b0:24d:f67d:7177 with SMTP id nn2-20020a17090b38c200b0024df67d7177mr3649760pjb.20.1683229107692; Thu, 04 May 2023 12:38:27 -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> <20230504192246.GA4164@redhat.com> In-Reply-To: <20230504192246.GA4164@redhat.com> From: Wander Lairson Costa Date: Thu, 4 May 2023 16:38:16 -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=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 4, 2023 at 4:23=E2=80=AFPM Oleg Nesterov wrot= e: > > On 05/04, Wander Lairson Costa wrote: > > > > On Thu, May 4, 2023 at 12:23=E2=80=AFPM Oleg Nesterov = wrote: > > > > > > Yes, but as Sebastian explained CONFIG_PROVE_RAW_LOCK_NESTING won't l= ike 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. > > Sorry, I don't understand... perhaps I missed something. But iiuc > the problem is simple. > > So, this code > > raw_spin_lock(one); > spin_lock(two); > > is obviously wrong if CONFIG_PREEMPT_RT. > > Without PREEMPT_RT this code is fine because raw_spinlock_t and spinlock_= t > are the same thing. Except they have different lockdep annotations if > CONFIG_PROVE_RAW_LOCK_NESTING is true, LD_WAIT_SPIN and LD_WAIT_CONFIG. > > So if CONFIG_PROVE_RAW_LOCK_NESTING is set, lockdep will complain even > on the !PREEMPT_RT kernel, iow it checks the nesting as if the code runs > on with PREEMPT_RT. > > Cough... not sure my explanation can help ;) It looks very confusing when > I read it. > Thanks for the explanation. That's my understanding too. The part I don't get is why this would fail with a call_rcu() inside put_task_struct(). > Oleg. >