Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3361268pxb; Mon, 17 Jan 2022 18:35:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzkfOV1T9zokctOtAImgV2aMB/tZ2jKmvkN4hrHOM4mh4sZqEUFCd9EBq2GsbhkX3hTEIg X-Received: by 2002:a17:902:aa43:b0:14a:ca21:979a with SMTP id c3-20020a170902aa4300b0014aca21979amr3933393plr.18.1642473356378; Mon, 17 Jan 2022 18:35:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642473356; cv=none; d=google.com; s=arc-20160816; b=jpjzy59E41KuhylXWcEkALV6IG8enooApsRunclEccyBN0811eLN+H8FzAW9R+POJZ o6mCDwVApx/jc3W3a7ZTzzAGRFt3FduutAELHLBqtrh1BBeAx9DkKWA20cjgOZQh+CHz khEt3fdcmyzHJjIK948amT+5dPNHK849VpDJne9RorDbN9sVhxCF2/2dSyVeCI2LmhTc JPkaMzCu4xWNdpoZDHBe0gcmhNtR8kF8b8f5AI5p21y9OUlvwkS5bqBbReMlaXjaNuSw SLRs/zUhctvs8rWPoh+EoPVBxKNkcimEMTVwDKJOgDIbqp8sNjno3TMJkfBF9CbkSTJ+ d/vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Upvi0XzdCvtFkL0JqzI8bfZ5QWNaqy4SwHM8pYcOg9o=; b=wtctnk0+WsKF6B+jsdG4lcs6v9thKJatMUAqw5ishqNziMTlhI0BbtUSygfJcW21/c igca4u5EQiJjMZSAwaa4qf2NeYEpc+YA+XhmXrTjz3nLINZRZb5Bc83LTe2fm8D4dBQ3 26sqg2h6W3o1eAVrnMftSL2IFr5ehdgZAB9JKvRLQqeOOY/UIVzHCta1mWmgH0H4yZur jg/yuhuX/u0S/AmXZCTlKmXTi+p3rfVkY0i81BIE4drsdvV7dwHIbloJdsNCIhw+lRxM mg8c5XvBsLHnnNrN/ymSZMrZBkzHhqElLS5JIpIQ2tGw56Hwg0bkd+FieLE3tX/GBI+0 9OQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Oo3Mrt6R; 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 p9si13512940plk.160.2022.01.17.18.35.44; Mon, 17 Jan 2022 18:35:56 -0800 (PST) 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=Oo3Mrt6R; 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 S240624AbiAQPoi (ORCPT + 99 others); Mon, 17 Jan 2022 10:44:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240621AbiAQPo2 (ORCPT ); Mon, 17 Jan 2022 10:44:28 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ADDFC061574 for ; Mon, 17 Jan 2022 07:44:28 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id b13so67558792edn.0 for ; Mon, 17 Jan 2022 07:44:28 -0800 (PST) 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=Upvi0XzdCvtFkL0JqzI8bfZ5QWNaqy4SwHM8pYcOg9o=; b=Oo3Mrt6RPkDmTxg2P0tYbcMjVUYNHyWStbREGMl4xyj/FFC8q9haK3chg8iL1KD2ud zHwjiryWVt8bDldfcWm8lrzXMaEqff9Ddyn7NFXmH/47eK6SxG1yw6DfhyjNZ2TgSbO2 pGHIQn1dTo8dLg4F2xKpbZeeTx7woU4UXsqgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Upvi0XzdCvtFkL0JqzI8bfZ5QWNaqy4SwHM8pYcOg9o=; b=3TfWCADPwv9ctnuH9Fxhw36Xs0E/VWj6iZxFdOGVG5B0UPy0Y6vSoj3lYg0kgiwTgH ID4ns2Rm0iDQi614CHhBb8j0KSUXtH9iWs2myOnCdH9/qk9LjzsjTPjj4ExscK4vN4/+ G//25ge1ouVAxM1ctQeMoOMBqj7JZ7Td0IaYa06FxYGjjQRiXvn3xvAVT1ZSRq1+z7zs kb375jY9yDkzH2Nszj+5kszMStzxz9k2FNochjbRMzJhCzeg3m2JbYa21IBfvWA/UI77 /1dcZ56JuAbFmk7+G07ySM9VWUKDdTCewO+saL4g5vol1n+C5oLnjSlXymo77Wl9ks5+ CcSw== X-Gm-Message-State: AOAM530KIgWlmjnpacQML2xET+R6pg696oMWMUJphY9ROnD/IGj3Yg7m Wb0I5EdTrgfsY9j9m97eQ+qnJ6aDCYqvA+Sf X-Received: by 2002:aa7:c609:: with SMTP id h9mr21831610edq.248.1642434266668; Mon, 17 Jan 2022 07:44:26 -0800 (PST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com. [209.85.128.42]) by smtp.gmail.com with ESMTPSA id k11sm2633627ejr.143.2022.01.17.07.44.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jan 2022 07:44:25 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id f141-20020a1c1f93000000b003497aec3f86so455899wmf.3 for ; Mon, 17 Jan 2022 07:44:25 -0800 (PST) X-Received: by 2002:a7b:ca42:: with SMTP id m2mr20661692wml.144.1642434264852; Mon, 17 Jan 2022 07:44:24 -0800 (PST) MIME-Version: 1.0 References: <878rvhlvh2.fsf@email.froward.int.ebiederm.org> <87bl0aidjv.fsf@email.froward.int.ebiederm.org> In-Reply-To: <87bl0aidjv.fsf@email.froward.int.ebiederm.org> From: Linus Torvalds Date: Mon, 17 Jan 2022 17:44:08 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] signal/exit/ptrace changes for v5.17 To: "Eric W. Biederman" Cc: Linux Kernel Mailing List , Alexey Gladkov , Al Viro , Kees Cook , Oleg Nesterov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 17, 2022 at 5:32 PM Eric W. Biederman wrote: > > I would like to have a version of pipe_write that sleeps in > TASK_KILLABLE. That would actually be horrible for another reason - now it would count towards the load average. That's another difference between interruptible waits and non-interruptible ones. Admittedly it's an entirely arbitrary one, but it's part of the whole semantic difference between TASK_INTERRUPTIBLE and TASK_UNINTERRUPTIBLE. You can play with TASK_NOLOAD of course, so it's something that can be worked around, but it gets a bit ugly. > I want the I/O wake-ups and I want the SIGKILL wake ups > but I don't want any other wake-ups. Unfortunately the I/O wake-ups in > the pipe code are sent with wake_up_interruptible. So a task sleeping > in TASK_KILLABLE won't get them. Yeah. The code *could* use the non-interruptible 'wake_up()', and everything should work - because waking things up too much doesn't change semantics, it's just a slight pessimization. Plus the whole "nested waitqueues" isn't actually any remotely normal case, so it doesn't really matter for performance either. But I really think it's wrong. You're trying to work around a problem the wrong way around. If a task is dead, and is dumping core, then signals just shouldn't matter in the first place, and thus the whole "TASK_INTERRUPTIBLE vs TASK_UNINTERRUPTIBLE" really shouldn't be an issue. The fact that it is an issue means there's something wrong in signaling, not in the pipe code. So I really think that's where the fix should be - on the signal delivery side. Linus