Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp593767pxk; Thu, 3 Sep 2020 07:49:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1DiF6n2WlCRsqulPl59NbhgHvyVTob5esdrGPnaTEgFdOVn6skxNQJoK6e1+Bq/EQxyiv X-Received: by 2002:a05:6402:3199:: with SMTP id di25mr3510603edb.315.1599144566853; Thu, 03 Sep 2020 07:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599144566; cv=none; d=google.com; s=arc-20160816; b=aYTmWWwLP25X5VozM4Zra147XqYPNJdbUl7mRVxHU3xsBxZO/q0Hu/mb/zxJimPhSs 6fKyDfG3di3qhcBu1mAPpYfnQ7YHXS/Ywlpdhc90CRP/tGd5wZowvI6WEVdglJPiv8fk Ed9Px7RR8mMqNU7PREU2i/GZ/1LvhF09MWq1XVthgvCVtSuZZoQhq2G2blw8zHkf2zyU EIOIfifZEG01BWXCUPy6j5jgSuZKZdkdzIxJYFooGfgp/Gn1d97gS2tpPGoyXeZJA2VW fMTI2yaRuKPApb51F6yzLfD9jDciybA7T1QYNaHxeNg1imhG2CEnfT6QoG7pQta3CrKf FPxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=91ijUty15Prtg/8b/t9+zr7UAa40xpsWcSzisd5H3Us=; b=Mxgb/AAbd86slrKcTMdu5L0iQJ4HX29Xnfsgh/QEK2RYEYNpn/RMdFgeyNm9rGmiA9 RgtHHTxLDPvziyvaPB2xrPbsGR0j+gHihihhNXX1t/sRo35E6rOszzzpP8GxH//MQ2mf lvlSkcb7KRWa6MYquKqzVkYUrGj3B0pUPSD8fp9lr1GLF4XPPnOxKDHoqmp/6cqW+x3u cxzzUZObDggP164IhdtHA+bcmMCQnidpp/vmzRRBm8dD+Ili1zELkueDN06gv7VlA1LH 7PFqspMdrhAIErfNT+SfuJ5ujjkpmeuAF80lp3pr/1TYTfiy0VA68lwCbdksHcOQYQo0 g47A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EzOVGVGV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co28si1840041edb.562.2020.09.03.07.49.04; Thu, 03 Sep 2020 07:49:26 -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=@redhat.com header.s=mimecast20190719 header.b=EzOVGVGV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729233AbgICOsd (ORCPT + 99 others); Thu, 3 Sep 2020 10:48:33 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:25703 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729078AbgICOWz (ORCPT ); Thu, 3 Sep 2020 10:22:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599142973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=91ijUty15Prtg/8b/t9+zr7UAa40xpsWcSzisd5H3Us=; b=EzOVGVGVwCgpOKoF2M0rU9CWi8VPtnOWKLoqMxWeVmFRgeVv7km4AZjP+v1qAvPW+VcDYB eEYB41koij1OHOcSKUYBv8JBi34Q23jKewwRlwa5nSyHqWCZX+CjT+/wW3VJcn7GBFubdm ZbZy0nDyfKdGMq63/T7LJhDvlbZ9Iks= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-06yz8j6xNA-U3FFxO-0Hyw-1; Thu, 03 Sep 2020 10:22:49 -0400 X-MC-Unique: 06yz8j6xNA-U3FFxO-0Hyw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A2E11084C89; Thu, 3 Sep 2020 14:22:47 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.114]) by smtp.corp.redhat.com (Postfix) with SMTP id 2FA455D9EF; Thu, 3 Sep 2020 14:22:43 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 3 Sep 2020 16:22:46 +0200 (CEST) Date: Thu, 3 Sep 2020 16:22:42 +0200 From: Oleg Nesterov To: Christian Brauner Cc: linux-kernel@vger.kernel.org, Christian Brauner , "Peter Zijlstra (Intel)" , Ingo Molnar , Thomas Gleixner , "Eric W. Biederman" , Kees Cook , Sargun Dhillon , Aleksa Sarai , linux-kselftest@vger.kernel.org, Josh Triplett , Jens Axboe , linux-api@vger.kernel.org, Jann Horn Subject: Re: [PATCH v2 2/4] exit: support non-blocking pidfds Message-ID: <20200903142241.GI4386@redhat.com> References: <20200902102130.147672-1-christian.brauner@ubuntu.com> <20200902102130.147672-3-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200902102130.147672-3-christian.brauner@ubuntu.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/02, Christian Brauner wrote: > > It also makes the API more consistent and uniform. In essence, waitid() is > treated like a read on a non-blocking pidfd or a recvmsg() on a non-blocking > socket. > With the addition of support for non-blocking pidfds we support the same > functionality that sockets do. For sockets() recvmsg() supports MSG_DONTWAIT > for pidfds waitid() supports WNOHANG. What I personally do not like is that waitid(WNOHANG) returns zero or EAGAIN depending on f_flags & O_NONBLOCK... This doesn't match recvmsg(MSG_DONTWAIT) and doesn't look consistent to me. Nevermind, the patch looks correct and if you think this can really help user-space I won't argue. Reviewed-by: Oleg Nesterov