Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2545327rwd; Fri, 2 Jun 2023 10:51:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XcC0s2m107HcqbX1abjcY9KOelOT+8SAl6WpPXPDj7AVy8n+42j5yBVruR7n41IuSyGdF X-Received: by 2002:a05:6358:93a5:b0:121:c4a9:aeb2 with SMTP id h37-20020a05635893a500b00121c4a9aeb2mr11505732rwb.28.1685728310754; Fri, 02 Jun 2023 10:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685728310; cv=none; d=google.com; s=arc-20160816; b=CYNE88/ThxCJNbgjh1YBrw+7eeDtXoqq0AMTrodn54F4poiTC36HQkF9X9hbAoinRh 7p0Ir8HmGlP/47e34etVPHMQ+ZNY40GUrGyJa4MbX2tnctCHt0prOWGJE2XcQ+YM3gcL /HbeIOLBOu0zfSR9GEypgLHR5pETD0Kmb/CJ17jJ60xK+XxicVydGl7qZvI77StUT8zR ciKJH1/3LVPWMoiF4+s2atuiyKqlLVY6WWZH8yUTCbdNuljHghD4Hi2QR1QOze99h/Vx scfrnYsxV7R9jTk/MrfSn6dK6hZ/JGeQtebB54NbIdrQRq47kTxQf+Y8rNigqMRn5hLZ A/ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3PAxK3OYzW8C69fcto6JNmEVTmcoLKNZnfsVaisr9bw=; b=iynBq35pSLmmHyFNPycD9JjUf558njTOxXhbV1jbOAGOhDGj546eXr2yWQ/X0yR0yO C/NMvY7YdFqWqqZKgfPjZxjVZeSmTK2WIWFxmPnkS+jjodY1H3jMFzEdw7zLcoNEfNaK RFpzHZUbz5ejbMtSVXsocaI0Yglz2Wu+tZei997MtqvTpHqN26H8SoQeHeSaYTzH2bey J3LTd0HuCzjgdAt2y+zlie14kHuNjXufz8+jmkRkInq8qiArJNz273rQ+2oVrOwlMvBO 9GudQCsTLFJ4xKY7/Hx65qtB+zKbc5iPsbHJY2BOGaj114uNzC0Yw3upvMr97n4K/2SJ ToXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AAFZp+w5; 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 131-20020a630489000000b005369f4111aesi1285115pge.849.2023.06.02.10.51.37; Fri, 02 Jun 2023 10:51:50 -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=AAFZp+w5; 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 S236644AbjFBRf3 (ORCPT + 99 others); Fri, 2 Jun 2023 13:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236155AbjFBRf0 (ORCPT ); Fri, 2 Jun 2023 13:35:26 -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 AEC3C1B9 for ; Fri, 2 Jun 2023 10:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685727278; 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=3PAxK3OYzW8C69fcto6JNmEVTmcoLKNZnfsVaisr9bw=; b=AAFZp+w5TRBQabBSpMJp2A3LEcCSKOvSWjeFn4uffL6/QjybXCwEJzaKz0kezlcu+xgSFZ VWn9MkytOPfuPtQm+0ch3J5jUe/aKe3Rsn5R4RDtBnD830OHwnPIXe5BEkLCt+d1kSY0tR NBAWZuKANKqgK/4iT+8BDq0e4TCTT2o= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-136-NMRqwF-0N8ulOHV2USx8XA-1; Fri, 02 Jun 2023 13:34:34 -0400 X-MC-Unique: NMRqwF-0N8ulOHV2USx8XA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E01031C05158; Fri, 2 Jun 2023 17:34:32 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.50]) by smtp.corp.redhat.com (Postfix) with SMTP id BE7AA1121314; Fri, 2 Jun 2023 17:34:26 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 2 Jun 2023 19:34:11 +0200 (CEST) Date: Fri, 2 Jun 2023 19:34:04 +0200 From: Oleg Nesterov To: Wander Lairson Costa Cc: "Russell King (Oracle)" , Brian Cain , Michael Ellerman , Stafford Horne , Kefeng Wang , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , "Matthew Wilcox (Oracle)" , "Eric W. Biederman" , Andrei Vagin , Peter Zijlstra , "Paul E. McKenney" , Daniel Bristot de Oliveira , Yu Zhao , Alexey Gladkov , Mike Kravetz , Yang Shi , open list , Hu Chunyu , Valentin Schneider , Sebastian Andrzej Siewior , Steven Rostedt , Luis Goncalves Subject: Re: [PATCH v9] kernel/fork: beware of __put_task_struct calling context Message-ID: <20230602173302.GA32644@redhat.com> References: <20230516191441.34377-1-wander@redhat.com> <20230517152632.GC1286@redhat.com> <20230529122256.GA588@redhat.com> <20230601181359.GA23852@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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, 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 06/01, Wander Lairson Costa wrote: > > On Thu, Jun 1, 2023 at 3:14 PM Oleg Nesterov wrote: > > > > > but only in the RT kernel > > > > this again suggests that your testing was wrong or I am totally confused (quite > > possible, I know nothing about RT). I did the testing without CONFIG_PREEMPT_RT. > > > > Hrm, could you please share your .config? Sure. I do not want to spam the list, I'll send you a private email. Can you share your kernel module code? Did you verify that debug_locks != 0 as I asked in my previous email ? > > > But running the reproducer for put_task_struct(), works fine. > > > > which reproducer ? > > > > Only now I noticed I didn't add the reproducer to the commit message: > > while true; do > stress-ng --sched deadline --sched-period 1000000000 > --sched-runtime 800000000 --sched-deadline 1000000000 --mmapfork 23 -t > 20 > done Cough ;) I think we need a more simple one to enssure that refcount_sub_and_test(nr, &t->usage) returns true under raw_spin_lock() and then __put_task_struct() actually takes spin_lock(). Oleg.