Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3607616pxj; Tue, 1 Jun 2021 09:03:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeD2ERSWFl1cJeJnxqxAdvYj6j7e5M5qlf0n7INRiFCBZSwcXnDZxzspCmpknLmDuxgwuy X-Received: by 2002:a05:6602:2b8b:: with SMTP id r11mr21580371iov.129.1622563399324; Tue, 01 Jun 2021 09:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622563399; cv=none; d=google.com; s=arc-20160816; b=ePPFGbjdppyM+JHvWYd00kqS7TUVy12mRsgbAlcsxdGY1DS3eizWWSFhg1kPgie45r nDCXH6AbPJs7nfoy5QBfbS3rXuAcPGqe8LUZE607LgycUJRoh36MZ9FsINIRvlJ2n2hM Nu7m7d6PHkJRNH6jX74F57V/PKdC9iM1GglfvZwR7TNreYCZoJaJA4VlorBqgrn5yNum C/KxGwa1OzNRKY5iChW0aRIEQ918gEVyoLBMwBUOBytB+sNjSezciiDEDc0GE0WHaF4I eoVeUoKKd15Ab3TX2ueMCDQqcj8mJiw7nRVGI42TSxtGje0rclac8mezJnhVuP+w9u0k SaQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=WfmsydD/A8BiNqHr9XgI8dOVh8RAtY6UXqT7qqwK9X8=; b=pLfCsoKefFGZEyDW80kG09875ijOFNPEWheF40ZqCQ0auFUVHOgLEoO0b6Azlg8mqw f3kgyDLLALAh35XHDfCwHvRyEctzsogRIyBsEUaR8GuA5dmdLHwBldlT+ifaaY1NUFcT w+EtNV48y1ZBj+uGy+ea1UVujHyTosUgi80O9xED2Bgy6KqHonqo1xFAgAirR/HiO8zt T5IA4Ll2TrWrMmeYFxx9hvqnzcRqUzrVTGcAw7dlphD7NFA0ekPpfaQfDpubB2yfNPEV nSjFA0yQCyWBmsWpvezQSMoPnfbDoMkyBM0skhWBhX05T8uj50ja+22/0axxWcUErHHw i0lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=Sy4bUKJm; 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 s13si20199642ilu.55.2021.06.01.09.03.05; Tue, 01 Jun 2021 09:03:19 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=Sy4bUKJm; 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 S232592AbhFAQC4 (ORCPT + 99 others); Tue, 1 Jun 2021 12:02:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230288AbhFAQCz (ORCPT ); Tue, 1 Jun 2021 12:02:55 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3134C06174A for ; Tue, 1 Jun 2021 09:01:13 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id k16so15843424ios.10 for ; Tue, 01 Jun 2021 09:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WfmsydD/A8BiNqHr9XgI8dOVh8RAtY6UXqT7qqwK9X8=; b=Sy4bUKJmv2dkaIL+PnSyHaFU4M7Xr9P9mJvn6Azv/EzDtyYXU5e4kQOR/zL9HPytx0 QcZQLccBYF3AOuCjlwiEYrfJFwxCg4R6vAfYO+mdPKzZ2hKkN8+kW/pNfZ7fha7bGtc0 lReUE9y/DtyL5f1CPH7clx3gYrkTiss9eHWcVGYPQForWyzPVhp78WnxJWaFGW1TqTsF 8lHVKPkfU5w2+/d1Zo4pnXdREZrzedwCTGDFvTon+M39PGpyV3qjMH5WbP/+KOd8yVkS 9reEl/T7Ki7A5GhsHz7pTwnLguzyS4ZWpRxRhw497XP15S4nH6XiV3Ttf0fXoewKmIRj POzg== 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=WfmsydD/A8BiNqHr9XgI8dOVh8RAtY6UXqT7qqwK9X8=; b=HZhHatqolNI5sTjelyjlkFgHpFU4xeI58EGk3IxAz1dDQLBjJ7AqZxZfWSUuUR5oFz aGOWFa1gPMAZqfeTJefWCqsREU1Kd/z7XQQ6WkKR72GDRtNW1YrjyFcG8CmF52JQN34z 0fFMHdMHjKQwulOVUSH4DdDt4e3Koq9B6yIiVwy4IzMB8e6ovY9ziGo4N4NThLmidKE2 0nMdbYKEy25Ne5R72JvDNShaeinjKgCQiAD/0iGJl9TUnxq28Dfq4nif7q4DV2rJKK07 yRpEvwByH7+6VcbanFm5M1Yaz/4oflQylFJK3a4g4YhM8/1I7VpM2vMrspsQWOktJYDO MUQg== X-Gm-Message-State: AOAM531SRMEyh5gO6xDtPWMngbvDR4MXqWSWwuE/wD/jZFnEGLNffcPz AXgn4G9iDN9xoJc4G6qJt1mTkQv9W4nzqSoj X-Received: by 2002:a6b:690c:: with SMTP id e12mr21869176ioc.69.1622563272777; Tue, 01 Jun 2021 09:01:12 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id o2sm9978840ilt.73.2021.06.01.09.01.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Jun 2021 09:01:12 -0700 (PDT) Subject: Re: [RFC 4/4] io_uring: implement futex wait To: Pavel Begunkov , io-uring@vger.kernel.org Cc: Andres Freund , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , linux-kernel@vger.kernel.org References: <409a624c-de75-0ee5-b65f-ee09fff34809@gmail.com> From: Jens Axboe Message-ID: Date: Tue, 1 Jun 2021 10:01:11 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <409a624c-de75-0ee5-b65f-ee09fff34809@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/1/21 9:58 AM, Pavel Begunkov wrote: > On 6/1/21 4:45 PM, Jens Axboe wrote: >> On 6/1/21 8:58 AM, Pavel Begunkov wrote: >>> Add futex wait requests, those always go through io-wq for simplicity. >> >> Not a huge fan of that, I think this should tap into the waitqueue >> instead and just rely on the wakeup callback to trigger the event. That >> would be a lot more efficient than punting to io-wq, both in terms of >> latency on trigger, but also for efficiency if the app is waiting on a >> lot of futexes. > > Yes, that would be preferable, but looks futexes don't use > waitqueues but some manual enqueuing into a plist_node, see > futex_wait_queue_me() or mark_wake_futex(). > Did I miss it somewhere? Yes, we'd need to augment that with a callback. I do think that's going to be necessary, I don't see the io-wq solution working well outside of the most basic of use cases. And even for that, it won't be particularly efficient for single waits. -- Jens Axboe