Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2299985ybg; Thu, 30 Jul 2020 16:18:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4zAsPy9NKCo1Of095c3e1nmbI8xsdqUlNKVaM4r1Ph5DJvwEqqA/yW4/QYC4voXL3amxO X-Received: by 2002:a17:906:a219:: with SMTP id r25mr1414399ejy.201.1596151128400; Thu, 30 Jul 2020 16:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596151128; cv=none; d=google.com; s=arc-20160816; b=IDbXs8NTPTWFezjKg8OLI8xSEMi20ttOosxhqnWvntOWvbNf0HEaNL52m5usPocioZ z0tuPaQJLydx6U1VeNVw0eXANyAKfwvFtuNQjupGNJzZTydNCsWPbb5Il3sar5SZYU7z ZtGbTiJVrz02+KCbRoeZT8zU1UcLy3UUH0VT/ST1TWFmcvhp3lXZNrhLRIcJIA5ZY1Jg Khal+bwGtufDz6p7CibzpkmujXFTw++XKf7SwbGjOSmMO7K++qvmePHVICtxvwt8ap8E rJ1dJZuvL2zHX0XktjwPDsOrarB1CVKQbDJXR7GikatycwmpzhLjtdyd0UuMi0oVYaEV a1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IcsWvrkJmkldNkR7Og1fU1p0Fe8lfIhMHe3883Sw5AQ=; b=NBA7gnSvjiVl83N5XMghWYPsRRB4pXIA7oYMvHP8sEtQEsNJy6mrSvIY0u5b5+Vhix yKbgPwvT00HQKiWyxMck/UwZDCHgkWc/KbenL250g/76pf1EcWxnfQ3c6Cv5CEKMETfh lQ0NXXkz4RSg65HDM/OXQlHZIC5XPpDauL26ZuqDuNp71Skm+3gX7pr0y4R+liJBgg8a AEjfms9PWV1NN93nWmz53x1u6kEg3MEP8VaRKtu8/QScRhbUmHLIe0CC+OG++REgCNVt auieXJ10bbbEd0WyQt5cWmZ8vlvJHDdgrdbE0X0yAZ7Rx4bujnsMPYQ/xZj/hGa5Ic23 Tjsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Nm909XrN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf25si4065269ejb.419.2020.07.30.16.18.22; Thu, 30 Jul 2020 16:18:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Nm909XrN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730435AbgG3XSM (ORCPT + 99 others); Thu, 30 Jul 2020 19:18:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730269AbgG3XSL (ORCPT ); Thu, 30 Jul 2020 19:18:11 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C0E3C06174A for ; Thu, 30 Jul 2020 16:18:11 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id m15so15206898lfp.7 for ; Thu, 30 Jul 2020 16:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IcsWvrkJmkldNkR7Og1fU1p0Fe8lfIhMHe3883Sw5AQ=; b=Nm909XrN/coCOGd8NKEDwC2r1wN5HlmeeTd4TLu/lY7lxYEtvV8l3/MWkw25JWkeuz vwzFtNUPds+t9fEMHzEjWnOEgSL5KC4oxjOVwt2XDRCd6jcpauyB0qIQBwHI7GUnOnjP XPJEVJpi3F1oie4huDR1BAOZdqzlmzioLtKDI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IcsWvrkJmkldNkR7Og1fU1p0Fe8lfIhMHe3883Sw5AQ=; b=CTBU3yoT4mZ0QB0sPqR+k+5By0mWB/CiHLm4u8GwQL4sYcMQ9VUs8HDfgBvA6cKLdN 2MTDwIAg/Mno9fCL34zlnPl82xCSpUnx+R2Uiubwo3zA/RUxTNu2po2/Eah6CI9XR88G WEd5a9bWMC4gfYJ0Gw8rMLBAQvJ9LBfzQNSyu1V4aumwL0MsAXjph24KkFmCu9tCWmao m75jxNCKEDFUKRnPwvPurpE3V4n2GkaNGVVzushiCjMGDvRi8q21qC+xOGJv2eLCuQFL HQzpbrzytLjb4nLtZzMOcM5JHsPJDlfBqvTnjG34qD6Retn4H5oEfCX9Jl0gJFkU0sxX 6j1A== X-Gm-Message-State: AOAM531C07VgcyCOYnlO/cubgJr6SSYsBSKRgmyUAmi2JquuixqYLDHb SUZvHxwrlvfuk7zs0AHJeBT1pG/+nRw= X-Received: by 2002:a05:6512:3af:: with SMTP id v15mr447697lfp.79.1596151088645; Thu, 30 Jul 2020 16:18:08 -0700 (PDT) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id l22sm1561296lje.81.2020.07.30.16.18.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2020 16:18:07 -0700 (PDT) Received: by mail-lf1-f54.google.com with SMTP id j22so9980168lfm.2 for ; Thu, 30 Jul 2020 16:18:07 -0700 (PDT) X-Received: by 2002:a19:c206:: with SMTP id l6mr459435lfc.152.1596151086728; Thu, 30 Jul 2020 16:18:06 -0700 (PDT) MIME-Version: 1.0 References: <87h7tsllgw.fsf@x220.int.ebiederm.org> <87d04fhkyz.fsf@x220.int.ebiederm.org> <87h7trg4ie.fsf@x220.int.ebiederm.org> <878sf16t34.fsf@x220.int.ebiederm.org> <87pn8c1uj6.fsf_-_@x220.int.ebiederm.org> In-Reply-To: <87pn8c1uj6.fsf_-_@x220.int.ebiederm.org> From: Linus Torvalds Date: Thu, 30 Jul 2020 16:17:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH] exec: Conceal the other threads from wakeups during exec To: "Eric W. Biederman" Cc: Linux Kernel Mailing List , Kees Cook , Pavel Machek , "Rafael J. Wysocki" , linux-fsdevel , Oleg Nesterov , Linux PM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2020 at 4:00 PM Eric W. Biederman wrote: > > The key is the function make_task_wakekill which could probably > benefit from a little more review and refinement but appears to > be basically correct. You really need to explain a lot more why you think this is all a good idea. For example, what if one of those other threads is waiting in line for a critical lock, and the wait-queue you basically disabled was the exclusive wait after lock handoff? That means that the lock will now effectively be held by that thread. No, it wasn't woken up, but it had the lock handed to it, and it's now entirely unresponsive until it is killed. How is that different from the deadlocks you're actually trying to fix? These are the kinds of problems that the freezer() code had too, with freezing things that held locks etc. This approach does seem better than the freezer thing, and if I read it right it will gather things in the signal handler code, but it's not obvious that gathering them in random places where they sleep for random reasons is safe or a good idea. I can imagine _so_ many dead systems if you just basically froze something that holds the mmap lock and is sleeping on a page fault, for example. Maybe I'm missing something, but I really think your "let's freeze things" is seriously misguided. You're concentrating on some small problem and trying to solve that, and not seeign the HUGE HONKING problems that your approach is fundamentally introducing. Linus