From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1529DC4708F for ; Tue, 1 Jun 2021 16:01:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA6FC6108D for ; Tue, 1 Jun 2021 16:01:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234438AbhFAQC5 (ORCPT ); Tue, 1 Jun 2021 12:02:57 -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-Google-Smtp-Source: ABdhPJy6KabpoFyW9fLH+Ch6zAs6yTCUjvg/QYLvTXzSZ2XwGs30TbFV6J3nia2b9uGkivg2kyHWQw== 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