Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3318257ybc; Thu, 14 Nov 2019 07:20:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzkT9je95JvhoBZ1vPWTCfJK1uE7MjCdJ8NahLatcWiawIJxZFGIxI+Wd/Cg4Je84DvsFqP X-Received: by 2002:a17:906:8606:: with SMTP id o6mr9358027ejx.202.1573744831713; Thu, 14 Nov 2019 07:20:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573744831; cv=none; d=google.com; s=arc-20160816; b=bQVKckvg5CBuIZ5v6hpUduaxvYMIWjqc79TNStDGb3NJOk7j6dMC9W29QcSEqDL6SK 0KInofTwTiRv9MlkpFbmT6ZsumYkt1KGU5XtQ99EFlkgqYj9nliox5iGqTgoAYMtosDR vQcmWc2Nl4g6LddKzNBxnKzDEnLnrLLkRS7NhAXDzilzJBWkx1P5e5j0qzcuShlIJ1DV ekq7sgt2bcJFky8m6//9LT8mT/7OuTvCBM5wfzZ36hahezKLE1aPdkpugvocpHCaaBuL aPPbzZLVilgUcdMErN4OcdZiZaL8RNTRbcX/beVeLtRsNUmtodUJUgBiQS7HKHLyOgj6 2i7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=0NujF1wAXF2JIet6WLIXpPzdUrZwekW5h9mwXEr+UsI=; b=qd6axzkQBkzDlumk03kMrEq8VIUOV9nV3NZVqKMdAGVPbfPV5J6ZdJhMlp18LNZutf sPwDewcr7MLx+G6v8BvNe7QwAdj75/ExkUeeHcyYdH2nyS+D7hnEEKL4Z5S6jNu5iGML sFEYiAgHNA+BCFTW7go/iAYyIiuAuFEWtfWq1MR2N9wtl3rH4gpz4vUeBB1HcKCRec1c MjjMvoa5FF7VWj8TsDbdtD9qUUy+R3bH89bR5dIKaIj3tgsHdbcSip76++4AOl2fcsLs d+dz80meaqOVtWvLQ0kw6eu2e1filhOyJv5dy8aXfDHjMdmC3zXtnloDhDPJXvtbsoYE +MWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=YYwFxPD3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si3487008ejp.287.2019.11.14.07.20.06; Thu, 14 Nov 2019 07:20:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=YYwFxPD3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbfKNPTR (ORCPT + 99 others); Thu, 14 Nov 2019 10:19:17 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:38210 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726598AbfKNPTQ (ORCPT ); Thu, 14 Nov 2019 10:19:16 -0500 Received: by mail-lf1-f66.google.com with SMTP id q28so5371798lfa.5 for ; Thu, 14 Nov 2019 07:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0NujF1wAXF2JIet6WLIXpPzdUrZwekW5h9mwXEr+UsI=; b=YYwFxPD3YUR34X4oiPjQohfpHR/s6FaTBaPnReoMP4yFgx+sgW1owlBpyNaD7rIfGC dUvFhybflk2eHVZjavhYVj1WfcrmNApq6bpHyo8ZFaCaCCVJM+KgpIN6Ce+wLeFSMwnh TcererLhO0iEEubqeqd2PNcozCbdt1Rb7va+s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0NujF1wAXF2JIet6WLIXpPzdUrZwekW5h9mwXEr+UsI=; b=CIKeG2ybu9DZm9R3Sv9h9b6LJcILyzLyUuJfcrrkOK2+w9D1HHo6tYv+fejVBuWgk8 8u2qpNYJB8G7nxr+Zsa0pVZPoV4dO5fGYitnLO6EV99CqGu3eJ1G39Rf3ie5VCUpU2CL KTG6WYubfeaA7Fev3SK9ZhMXTIeOQGOuV5VlyH3NTyGP90F4ihJK0BDTHOMSK3ksdtVe RogcCCT3OihmMov11Xl+KcTu9t70dIVezSIHKMdlfrT1P/h7OuTu3tjvuk1NNQm3JH8n 1uWUu9zPtXTIXi5qDx9C5QnG+27142jp+Bgt8NqSuV2wqhA8NeA5SfHz8F86tElI1bzr i58A== X-Gm-Message-State: APjAAAUut/5MmfOw4Ibww3MQ6svif7fYjMwPs3C0pS1LdOqeLDfdWggJ ArzFYa6WCX8j7nXONjutdnJ9XA== X-Received: by 2002:a05:6512:21e:: with SMTP id a30mr7682656lfo.76.1573744752947; Thu, 14 Nov 2019 07:19:12 -0800 (PST) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id a28sm2842754lfk.29.2019.11.14.07.19.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2019 07:19:12 -0800 (PST) Subject: Re: [PATCH RFC] io_uring: make signalfd work with io_uring (and aio) POLL To: Jens Axboe , Jann Horn Cc: io-uring@vger.kernel.org, "linux-kernel@vger.kernel.org" , Alexander Viro , Andrew Morton , linux-fsdevel , Christoph Hellwig References: <58059c9c-adf9-1683-99f5-7e45280aea87@kernel.dk> <58246851-fa45-a72d-2c42-7e56461ec04e@kernel.dk> From: Rasmus Villemoes Message-ID: <0f74341f-76fa-93ee-c03e-554d02707053@rasmusvillemoes.dk> Date: Thu, 14 Nov 2019 16:19:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/11/2019 16.09, Jens Axboe wrote: > On 11/14/19 7:12 AM, Rasmus Villemoes wrote: >> So, I can't really think of anybody that might be relying on inheriting >> a signalfd instead of just setting it up in the child, but changing the >> semantics of it now seems rather dangerous. Also, I _can_ imagine >> threads in a process sharing a signalfd (initial thread sets it up and >> blocks the signals, all threads subsequently use that same fd), and for >> that case it would be wrong for one thread to dequeue signals directed >> at the initial thread. Plus the lifetime problems. > > What if we just made it specific SFD_CLOEXEC? O_CLOEXEC can be set and removed afterwards. Sure, we're far into "nobody does that" land, but having signalfd() have wildly different semantics based on whether it was initially created with O_CLOEXEC seems rather dubious. I don't want to break > existing applications, even if the use case is nonsensical, but it is > important to allow signalfd to be properly used with use cases that are > already in the kernel (aio with IOCB_CMD_POLL, io_uring with > IORING_OP_POLL_ADD). Alternatively, if need be, we could add a specific > SFD_ flag for this. Yeah, if you want another signalfd flavour, adding it via a new SFD_ flag seems the way to go. Though I can't imagine the resulting code would be very pretty. Rasmus