Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3314910rwb; Fri, 9 Dec 2022 12:48:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7UNmWj/9SOAlUkPkRuiS97plpF+qWJmbPSO85qP5ePxNAiT2gbgju2/oJ6UmysMaxa8xli X-Received: by 2002:a17:902:e30a:b0:189:deeb:8c94 with SMTP id q10-20020a170902e30a00b00189deeb8c94mr6577917plc.22.1670618925001; Fri, 09 Dec 2022 12:48:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670618924; cv=none; d=google.com; s=arc-20160816; b=fmcMoZOsLWypaQW3WtXFQkDg1mgCs3v1SAFY2ztwHoo6UMrS8WhU5wj2mHY8GFd2kq 29sV6KP/cZmXrAZkqX6sGVLerNQSs+aQQA4l9V5NMHPsYyrQ6tKBzudElShi/diNpcJH ULMGl68B+9UWjnO1ZypBiZoheiIh7+apkVgb5i4sSZXNPbBsnsmHu2+dscYIMLl7sfjN ZOeL0CQ4vDSYaQtxT5zUkd5sLT9TKw/nVtmGBv9aaIzCzu/Aw4bIHkC1m+Xb9WA/P9xQ c3tv3KdbK89ZBT/i7y0IQEJ4nlqvmQ+27jwqF2P4BFUnF3F28Fs4L7JZuOxdDtDRupnv 2g5A== 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=iYpdFoRCkH9e9VtD3teLjpREy8eAnPN93OGSQ63rdMc=; b=XUJNP6CKZjvoSdcG/wd1s26K/kd54ScLkjBS0OFGwF3t0e0RhqhWel+4T2u1cLwoPf bZ6ROQbWcD9/8INDsnCcGUi9Mp40yFdnsV9wnCd8yN5qZ83RvpTqHg1BQ3bQKum5Pkaz sUdZ2PIzNkrt7LDPQS37yfkvhN+5WEfH2Y9awmtOurKBRQlwZZN5ZEyqBJgAqph7Gc5M K9sZJBoib8kJtQivHNYKgreUVPt834K1ZSctskb82FAFYsN167EaXHldVUsdzSVTRWDy +SiQNSPy2EqxwxotBp+R/3fZxcuUEaeCml1qiEPES1BO8IgcX/ksGnlIENiCI0Y6cuQ5 g95Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rmHaN1N8; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a170903028300b001899e936c2csi2596388plr.531.2022.12.09.12.48.36; Fri, 09 Dec 2022 12:48:44 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=rmHaN1N8; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbiLIU1I (ORCPT + 74 others); Fri, 9 Dec 2022 15:27:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbiLIU1D (ORCPT ); Fri, 9 Dec 2022 15:27:03 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3D0B1649D; Fri, 9 Dec 2022 12:27:02 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9C8DEB82910; Fri, 9 Dec 2022 20:27:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7B92C433EF; Fri, 9 Dec 2022 20:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670617620; bh=VHSEcb2HPradXnz78wt3OItcWSye4V75Ag/bPnxxGbc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rmHaN1N8+v8nni6vfG+awJLvVJX0y4/Bs8g+Xhr3PTvXflh9b952JN+naqlXRWBDI P4NPqI+fUZ34srK2L/xHX7Rgu4iWLM2NC8P1Tg0jw6g25SSV1VWjKmF+EE3qC94Hn4 AJFQ56AaLZH7qcWEBlIrVwf1ymSuKLESxSVdRFJvTmc4UxJi0xKNA9oQeTo++F47IK etKWFSUm6SGX0JndXRDphB7wXeCYSti52SREXhSkMFVNHuUXRXKl5lxqvfe782igrJ t2nQrT3R6IK11QWajIAyrk8yXUDZAP2rBIs6+M03X3EGtwiNsgWNoCSg6jyohroe19 qG9yRMfP02RpQ== Date: Fri, 9 Dec 2022 21:26:56 +0100 From: Frederic Weisbecker To: Oleg Nesterov Cc: "Eric W. Biederman" , "Paul E . McKenney" , LKML , Neeraj Upadhyay , Pengfei Xu , Boqun Feng , Lai Jiangshan , rcu@vger.kernel.org Subject: Re: [PATCH 3/3] rcu-tasks: Fix synchronize_rcu_tasks() VS zap_pid_ns_processes() Message-ID: <20221209202656.GA1865787@lothringen> References: <20221125135500.1653800-1-frederic@kernel.org> <20221125135500.1653800-4-frederic@kernel.org> <871qpkqof8.fsf@email.froward.int.ebiederm.org> <20221206164927.GD3866@redhat.com> <20221207200155.GA1840475@lothringen> <20221207203859.GD5421@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221207203859.GD5421@redhat.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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, Dec 07, 2022 at 09:39:00PM +0100, Oleg Nesterov wrote: > On 12/07, Frederic Weisbecker wrote: > > > > On Tue, Dec 06, 2022 at 05:49:28PM +0100, Oleg Nesterov wrote: > > > > > > At least I think it should not wait for the tasks injected into this ns. > > > > > > Because this looks like a kernel bug even if we forget about this deadlock. > > > > > I think this was made that way on purpose, > > Well maybe. But to me we have this behaviour only because we (me at least) > do not know how to avoid the "hang" in this case. > > > see the comment in zap_pid_ns_processes(): > > Heh ;) I wrote this comment in a53b83154914 ("exit: pidns: fix/update the > comments in zap_pid_ns_processes()") exactly because I didn't like this > behaviour, but I thought it must be documented. Bah! I should have guessed ;-) > > > I can't say I like the fact that a parent not belonging to a new namespace > > can create more than one child within that namespace > > not sure I understand but this looks fine and useful to me, I mean if only one task could be injected within a new namespace, we could be sure that all subsequent tasks belonging to that namespace would be descendents of that first task (the same way that every task in the default namespace is a descendant of the real init_task) and thus we wouldn't be bothered with such deadlocks. But I guess namespaces aren't designed to work like that. I don't know much about them so what I'm saying is very likely irrelevant. > > but anyway this all look like an ABI that can't be reverted now. > > perhaps... But you know, I wrote my previous email because 2 weeks ago > I had to investigate a bug report which blamed the kernel, while the > problem (unkillable process sleeping in zap_pid_ns_processes) was caused > by the dangling zombie injected into that process's namespace. And I am > still trying to convince the customer they need to fix userspace. Heh :-/ I wish we could fix this but I have no idea how. I guess the child_reaper of an ns could avoid waiting for the rest of the ns and designate its parent as the new child reaper. Or we could arrange for all tasks in the ns to autoreap if they ever fall back to be reaped by their ns->child_reaper and that child_reaper is dead. But that would look like ABI breakages... Thanks.