Message ID | 20230711204352.214086-1-axboe@kernel.dk |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp735178vqm; Tue, 11 Jul 2023 13:50:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHcznAEcRq0LmsFLTfnxYZXYi3PJCqZLB67DCCF6FD6CuiRShjpIGktGLteB2LD2cY+7qjQ X-Received: by 2002:a17:907:7253:b0:975:63f4:46 with SMTP id ds19-20020a170907725300b0097563f40046mr17404305ejc.57.1689108652899; Tue, 11 Jul 2023 13:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689108652; cv=none; d=google.com; s=arc-20160816; b=RiLrO4zKdGKI24LGjPd/BDyXDDMqKRuXGIqHx8lpJVD/XUtQLoLPJryC3RLly5uatb gfMWU6mZFWQVt4BeKifaC+B0HVi/IAr2LihteALjxTKyMBFg9BYHOQunm4ixpL0r7JW9 c2Hw3KUQ2e+XX9l/+slEcFLDgL+UlsvaLysarXTXJkGq2gtvAgQxj7zOLi/7HmhBKHS9 L6rUL7/IyST2RjCAV7AWCfPN57hLrY+1cP9BMPsSwVc42ds7mjPANYsXEFHonhZNpSSK fyppPn2O7kIh1fu9f9/DBlZB1xvFk3hsVq2OK9LpP/KbntVw/cCnLgB0hTRbDNR3oKiU hCAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MjESMioTk0k963l+dIJZ6fHN9PlUT4kb3GUAAzx+6ok=; fh=xY0VmqRb/OwVaUU/BARE6avnVxISkXqM+VA223N/o5g=; b=LJz2KlwMiE2aZe21y4Cl4aI4heJWvZUSjlmmVcs6pvYWavL1nRN093jJnvayd3jkQn 08CCCsQ12T7azhdfeO+juGSwrYMGvL0ZbdJw1zE56+tgZFmMU48VnVN7Wgp8Iwb4nEOR DQPLDO6syBQV3xHif0LYo/akhfNnFiMx1n2B5EFCnY05rD3kqE0HSU4hBNrMHbjw2u1r +kn7xIcWDxOmij0f7vm4eVqQSpyMkYBTXlV2q3MdD2GTK78Cpw9m2hovkzIiJWDKg4ry Y894n65ns2McOnPbpIZLvCG29zZfhqB4sPNS8IxtkFSyx90Dyl4iy4VX7A2Fqw1wZyJ2 cnNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=lIvIGhlL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qx26-20020a170906fcda00b009925f1a32f8si2787095ejb.400.2023.07.11.13.50.29; Tue, 11 Jul 2023 13:50:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=lIvIGhlL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229801AbjGKUoB (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Tue, 11 Jul 2023 16:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjGKUn7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 11 Jul 2023 16:43:59 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38A43195 for <linux-kernel@vger.kernel.org>; Tue, 11 Jul 2023 13:43:59 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-682ae5d4184so1334049b3a.1 for <linux-kernel@vger.kernel.org>; Tue, 11 Jul 2023 13:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1689108238; x=1691700238; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MjESMioTk0k963l+dIJZ6fHN9PlUT4kb3GUAAzx+6ok=; b=lIvIGhlLp7xDZ3mlK6uVQ5LC/2MBJlp4mO63BiMRZ2Oq4WrMmWrZGiXfaMBnXYxAwp qJuwXJCt58ZHsXkmYQOYmYu64jWejHPc+eHjrMmNC/6WnZBOd8icpbZnuRs79/dlQ92t 80B57VDMSwqyiOR7+aKoiNIKyr/8puY9XJ4bvs4ORpdjMHUYJ+Ro+MPxVe5rB9VVrDmx 3v2P3e9cxvjizOKAFhuGsPhsSoN+INImmxuQx5ksmR+lNFshWozIrVaVu6ae0LkPfYLi Maz3Y2fwIkmnWz/criwg3WFvaMBunj8S4Z/FK7LOIOG/xHgwk8o4yyixG+jggDd3Zglv x0/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689108239; x=1691700239; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MjESMioTk0k963l+dIJZ6fHN9PlUT4kb3GUAAzx+6ok=; b=ix4yF6s+MJqvl0r9mn2b0ghpRLzUitsVtWpwFUn2Vo74fdgjl+IdrMsOZsbVlCIzPD oE2EJEtAUse+vr71AnW/yaV/ysj0C3+lNyDY9RJBrzzqA12yYnBmbskY/u4bsHnqOxdK 656cshmpgspRtrMx3t3NOqSazFKfJflKpxMj7trycOjyTEDVQb6m29KW9t07ZSjW+7W0 G99i+JtFogJrkhmr02/UGZ0N4G0gnXDf5XjyweR1fX4QbKY42FDUG8tnvrffopNN0FMt 7Z1gwBPbGwDVZw371gtsLAs5MzrcKHowMHBIJvzZGEkItdSgpLEWir7OWj9EgOYnEbFA N+Rw== X-Gm-Message-State: ABy/qLbluJcXO0fDioiYygegqDjUMBdaNBPRA6JXrhqAQTqqVMeIXpT/ QwGJDWPA/LSScmP+Ps7lncsHKA== X-Received: by 2002:a05:6a00:3a2a:b0:675:8521:ddc7 with SMTP id fj42-20020a056a003a2a00b006758521ddc7mr19669642pfb.0.1689108238650; Tue, 11 Jul 2023 13:43:58 -0700 (PDT) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id f7-20020aa78b07000000b00640ddad2e0dsm2124461pfd.47.2023.07.11.13.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 13:43:58 -0700 (PDT) From: Jens Axboe <axboe@kernel.dk> To: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Cc: brauner@kernel.org, arnd@arndb.de Subject: [PATCHSET 0/5] Add io_uring support for waitid Date: Tue, 11 Jul 2023 14:43:47 -0600 Message-Id: <20230711204352.214086-1-axboe@kernel.dk> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771158794566780982 X-GMAIL-MSGID: 1771158794566780982 |
Series |
Add io_uring support for waitid
|
|
Message
Jens Axboe
July 11, 2023, 8:43 p.m. UTC
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 include/linux/io_uring_types.h | 2 + include/uapi/linux/io_uring.h | 2 + io_uring/Makefile | 2 +- io_uring/cancel.c | 5 + io_uring/io_uring.c | 3 + io_uring/opdef.c | 9 ++ io_uring/waitid.c | 271 +++++++++++++++++++++++++++++++++ io_uring/waitid.h | 15 ++ kernel/exit.c | 132 +++++++++------- kernel/exit.h | 30 ++++ 10 files changed, 411 insertions(+), 60 deletions(-) The code can also be found here: https://git.kernel.dk/cgit/linux/log/?h=io_uring-waitid