Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6292388rwd; Mon, 19 Jun 2023 05:24:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bkxYHvAWZONwcJrCEFh3sbfrV6jC80TS24olu467S2tkbUInuGa5dHVRNKK1oaUW97IbK X-Received: by 2002:a17:90a:ea05:b0:25e:db78:3a1c with SMTP id w5-20020a17090aea0500b0025edb783a1cmr5501856pjy.39.1687177457230; Mon, 19 Jun 2023 05:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687177457; cv=none; d=google.com; s=arc-20160816; b=L6bNqj0lWsaivw+jUmGF4udFwVdxEqf7Bjb+6wW/P2Ea/HGDIcfmNQlaUSUArfgxgp UDexS6OEVDVw1SnfzsDDEVXz4ZhQmLvdXgKC3qhN390UBPPoOx+HfrKSpFNZdN2QOiXB 1m2GYnq8IfHWLyGkofuKAK8cizwEkVkM5K1uNow+4iuUPpAsxzDVVzfvuW5ylHd1PGZB +Ew+jdtjzovXRq0xKTi6/TWRdQaQD1XQXJT23wS9f6xNJc0iBtGUXq0a/n0CGaVr8J53 tLMBeD9Hiqg6IR3vURI9cN61f1paTcZjVoLY/p18MwA/6n4km0XOly+HBWdhQzbkzHZ4 SCNw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/HhEuG3WD10cmV7zC5BZSkc1uXyPlJle62QUY05GBXw=; b=GpVwKbiMWlxJ+CmfvVOcbPQDiLlEm+01nGTtz89Q72hFhjLq5uk2+FV46TaVgRaOQz YeT167MFRSNIYHKAWSlohXJ7zAWrZKsHsqAq1lGvC9BXDliAI5mATi9cbdtI0dHoLJyp /KT86PTglbebK/UDK3zXe/yXEMO58NrGq9AeeZjdPfBGGRsS92OgyIMm2WdVNqbZI1AG Rspt7hQcgChZmaa/aXVGv/YajZvNNAhegpx4U962M7VXc7nBnOntWBYaS2zDsyCXe7yI D3mNm8yCp8IWUk9BW6oyAmHN6zoykS+f06scWgDxV1XRrGUliioD6o0SUrnpS/37m9xg XiXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=TZ8tWpWB; 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 l63-20020a639142000000b005538432902asi5995601pge.129.2023.06.19.05.24.02; Mon, 19 Jun 2023 05:24:17 -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=TZ8tWpWB; 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 S229639AbjFSLqb (ORCPT + 99 others); Mon, 19 Jun 2023 07:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjFSLqa (ORCPT ); Mon, 19 Jun 2023 07:46:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC0A7DA for ; Mon, 19 Jun 2023 04:46:29 -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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/HhEuG3WD10cmV7zC5BZSkc1uXyPlJle62QUY05GBXw=; b=TZ8tWpWBQUdyITpxRFLYqMde5y 17Lmf+E9yHM8IbAY/ij0PCR29waBoVWnc7k8BJ1wgJkXhqlhnmLKC3bL5WyMbIKVSKFijTUc1yZd2 QFyKIHCG3jWk+k+R7qMHXm5A0ixVD5OB9Seu2B4gbSPUP8SSBwMD8siZYcUx2/9mIiTfKCABdQEiY TNRy0I2JWQ1f8PEI63pCvgZtM/f8A84p9iyWqsFpbhpgJJ1uEVP6kdg1ihvaB6IJ6gEpXL2xMA5Pz sz7NeHXQvuw0u+Xinc5bendR7L5YSvmY1wULViNs+oCCgFq/VZqEjd12UvrhLz81NC+H8hC16FmA+ 6HAb0Lkw==; 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 1qBDKD-00Bo8M-P6; Mon, 19 Jun 2023 11:45:39 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id AC84E3001E7; Mon, 19 Jun 2023 13:45:35 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 29484201B6401; Mon, 19 Jun 2023 13:07:00 +0200 (CEST) Date: Mon, 19 Jun 2023 13:07:00 +0200 From: Peter Zijlstra To: Wander Lairson Costa Cc: "Christian Brauner (Microsoft)" , "Michael S. Tsirkin" , Mike Christie , Kefeng Wang , Oleg Nesterov , Andrew Morton , "Liam R. Howlett" , Suren Baghdasaryan , Mathieu Desnoyers , Andrei Vagin , Nicholas Piggin , open list , Hu Chunyu , Valentin Schneider , Sebastian Andrzej Siewior , Paul McKenney , Steven Rostedt , Luis Goncalves Subject: Re: [PATCH v10 0/2] kernel/fork: beware of __put_task_struct calling context Message-ID: <20230619110700.GM4253@hirez.programming.kicks-ass.net> References: <20230614122323.37957-1-wander@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230614122323.37957-1-wander@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 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 Wed, Jun 14, 2023 at 09:23:20AM -0300, Wander Lairson Costa wrote: > Under PREEMPT_RT, __put_task_struct() indirectly acquires sleeping > locks. Therefore, it can't be called from an non-preemptible context. > > Instead of calling __put_task_struct() directly, we defer it using > call_rcu(). A more natural approach would use a workqueue, but since > in PREEMPT_RT, we can't allocate dynamic memory from atomic context, > the code would become more complex because we would need to put the > work_struct instance in the task_struct and initialize it when we > allocate a new task_struct. > > Wander Lairson Costa (2): > kernel/fork: beware of __put_task_struct calling context > sched: avoid false lockdep splat in put_task_struct() Thanks!