Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp935706rdb; Tue, 19 Sep 2023 15:07:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHqFjQmESXXVDupscO6NlgGpg8fobHW4zADH/P9wgTBzuiVTXoUTYSZ0mc2HOVmqgYTLxP X-Received: by 2002:a17:902:ed05:b0:1bf:25a1:9813 with SMTP id b5-20020a170902ed0500b001bf25a19813mr640541pld.6.1695161221287; Tue, 19 Sep 2023 15:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695161221; cv=none; d=google.com; s=arc-20160816; b=yC3Nbo9+YpSkUmoIjeGN1J6O90VqT1cZhOMshGj3HUFPkfNsGGH+QJpiUuJIM6mOjT rXz8ahuSviq/DvWIXP0PDGaSf0LSrWscTIi0wWGf7q58RYvrs9loPmyyP+oijcAkGjcx 1S3C7O1oosL0sI5iDV7zOD97xgeZsUCEZsL23yOngMnViB6VuPfn59E2zjC2Fpq9lBSK q5MBDGtKER7GUoU5K9mNbcUABlb8sCkHjuqQWsqv+6m0aqhTv3gkjT6t60BIfHESuQkd IO/UPF0O2Y0vx3+PwfX+oX3n7DfagvkHVfEUbqT7CHfAFBQy23Pp57gEFU25HxJv2j8l ElwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=4CskXmoiXW9hnAcfKU6exBcbR/GVhZTyuXSQTnBlnrc=; fh=RsskEE0tDL1Z2mntBMqQI1IL728T9/O4enOrSVUNBjg=; b=TL2tfr1kGKGDv3jU67HF7I1qLewcqqdAT97qjO/dWjveG3YQs1S0Rzw2nGc8VuV6qU +QUjHsIGMCcAITVbxAAC7fIVxempGSU9CAU3iDMHEe3tGiTwTWJ1WiVQndTLyf9NkbsG 3zB/VhteJ7yurEwtOgDMsp7wH5jQAwmAzkrZ1NfnD1yQtcalzXK7weBXPb3DghioAIg1 lHO4X0LXpGyKPjI4gTP5dDD6D3BY+5e3eoOGr0njoALUVNE1zumcXHvMBit3kGNn6YkG 29hFU2l/3SqLugbn/w/MLJdRWRatxsW9dtGdFP8bN1usoVxFd2mPybhU7c997FG7DhQP bTLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=J3Q4UeIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u15-20020a170902e5cf00b001c4605546b5si5940479plf.42.2023.09.19.15.07.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 15:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=J3Q4UeIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 98A1081D55C1; Tue, 19 Sep 2023 07:57:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232960AbjISO5l (ORCPT + 99 others); Tue, 19 Sep 2023 10:57:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232132AbjISO5j (ORCPT ); Tue, 19 Sep 2023 10:57:39 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42363DF for ; Tue, 19 Sep 2023 07:57:33 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-34e1757fe8fso4229165ab.0 for ; Tue, 19 Sep 2023 07:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1695135452; x=1695740252; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4CskXmoiXW9hnAcfKU6exBcbR/GVhZTyuXSQTnBlnrc=; b=J3Q4UeInizupUUgtJP6kaORNH5+Wpq1ulhd7sFqthUK+svYMNWVG3jOvkUSLtxrk1T JRm3TQ+EqNPRQ4Z3CHW2bS2uZrookiwvyLeUCiyhADMWVO0gOJz9EcOHWuMcw5l56J/D 3ogFwXHlJ1Ns89aHi8ioOHhiPft2tg4Y+lgvVXGzZI8eifecY/WcEcGcjii7Ise2yaYT azQhpLNGINHcVzZkulS1luo0T1/I7d5c6JQTs0bh5/5nr7f7FMcnpmV4attb0gX5q/bJ HaSUX9e2fDdIdDiBAy7fBBH18rX2UZlz6b93lQXvkbvmrQx/o2GUr/yCWOwHzVjck8xn mAZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695135452; x=1695740252; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4CskXmoiXW9hnAcfKU6exBcbR/GVhZTyuXSQTnBlnrc=; b=eBlmYo/vJF60bkBcOaksjvy0QSy/VSimZqWMhIu9mQpjg/IuhU02nyCZ4+m1Yy898n RWxN0rTrJJn++mKyUnhDZPtFHeU46O/swhhfRRqfRDXYVG0b9/SuO4W2juIyTMP73Dz6 03roRNxtZIIfXYqTTpG8MIj/aCWA7maNyKaL1HUhdxroYuJaSbFYrEb5f2KPsWgymU9m 2GPj9AdwYR3g/KhSCPicQ8ODQy8WfZz/K1UkALPhUA42ttcxAoRT+IUWFfs1e0lkCLv+ WdJuAnTXCp/hyCqJxLcpe3NNKftjLlq79JVHk2QPg7AjXneqYYClA3Dgm3CWzY0bm2sj SQFQ== X-Gm-Message-State: AOJu0Yx/wEP17uwcfNFd+BJVBo+Qn5b18w86uGUg619ccdR2VTomJxY+ +wq1x3hLsm/yH87WtwWTsJE8QXByN28bHY7jF+NtMA== X-Received: by 2002:a92:d5ce:0:b0:34f:b824:5844 with SMTP id d14-20020a92d5ce000000b0034fb8245844mr20914ilq.3.1695135452568; Tue, 19 Sep 2023 07:57:32 -0700 (PDT) Received: from [192.168.1.94] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id o16-20020a92dad0000000b0034ff5fd4ffesm1053313ilq.71.2023.09.19.07.57.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 07:57:31 -0700 (PDT) Message-ID: Date: Tue, 19 Sep 2023 08:57:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHSET v4 0/5] Add io_uring support for waitid To: Christian Brauner Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de, asml.silence@gmail.com References: <20230909151124.1229695-1-axboe@kernel.dk> <26ddc629-e685-49b9-9786-73c0f89854d8@kernel.dk> <20230919-beinen-fernab-dbc587acb08d@brauner> Content-Language: en-US From: Jens Axboe In-Reply-To: <20230919-beinen-fernab-dbc587acb08d@brauner> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 19 Sep 2023 07:57:48 -0700 (PDT) On 9/19/23 8:45 AM, Christian Brauner wrote: > On Tue, Sep 12, 2023 at 11:06:39AM -0600, Jens Axboe wrote: >> On 9/9/23 9:11 AM, Jens Axboe wrote: >>> Hi, >>> >>> This adds support for IORING_OP_WAITID, which is an async variant of >>> the waitid(2) syscall. Rather than have a parent need to block waiting >>> on a child task state change, it can now simply get an async notication >>> when the requested state change has occured. >>> >>> Patches 1..4 are purely prep patches, and should not have functional >>> changes. They split out parts of do_wait() into __do_wait(), so that >>> the prepare-to-wait and sleep parts are contained within do_wait(). >>> >>> Patch 5 adds io_uring support. >>> >>> I wrote a few basic tests for this, which can be found in the >>> 'waitid' branch of liburing: >>> >>> https://git.kernel.dk/cgit/liburing/log/?h=waitid >>> >>> Also spun a custom kernel for someone to test it, and no issues reported >>> so far. >> >> Forget to mention that I also ran all the ltp testcases for any wait* >> syscall test, and everything still passes just fine. > > I think the struct that this ends up exposing to io_uring is pretty ugly > and it would warrant a larger cleanup. I wouldn't be surprised if you > get some people complain about this. > > Other than that I don't have any complaints about the series. io_uring only really needs child_wait and wo_pid on the wait_opts side, for waitid_info it needs all of it. I'm assuming your worry is about the former rather than the latter. I think we could only make this smaller if we had a separate entry point for io_uring, which would then make the code reuse a lot smaller. Right now we just have __do_wait() abstracted out, and if we added a third struct that has child_wait/wo_pid and exposed just that, we could not share this infrastructure. So as far as I can tell, there's no way to make the sharing less than it is, at least not without adding cost of more code and less reuse. Shrug? -- Jens Axboe