Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4293159rwb; Tue, 8 Nov 2022 15:07:24 -0800 (PST) X-Google-Smtp-Source: AMsMyM7wgEhULCCqD2QB9BSttmczj9Y2qK/XuURjOkeGFhpqGYEDVEeFfpl3kAUY+lCEme19b95S X-Received: by 2002:a05:6402:50c:b0:461:bc01:1828 with SMTP id m12-20020a056402050c00b00461bc011828mr58566621edv.64.1667948844539; Tue, 08 Nov 2022 15:07:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667948844; cv=none; d=google.com; s=arc-20160816; b=Csr403gGSMPG6eJBalTB5F612hAGYZUUvBQoSgE5ELOyKLb/hJNgP6cbqSOllQ8r9y FF8Tdv5Pr60B1a22fPNuKfUxt/lxl2o1u+RtAgnBlePFdAoUDghSlayMmDFYjDcKUecf GQ/XVp7ev11czZcMrV8xnnKpcbPlm1kcyBl15gqNqElCCLGeuNNayMzkjzK/gFIllLO1 crSsCGC4FvTq9FGZyaOYEvVk2WN2SnpcZdMUM6gVhxGl/g4ChEyYFdbA4b4K+p9UC0gn oRW7MwdLdoqKMakHtYLrbJa5h+Y30wsk2CSog+/7QfHI3pPbTbqRLluKdClIFTCIGFLh 4DSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=b/B2+o8hWx+Vy2/gk8SryrziA/1k8CwLOYbP1F5lrYU=; b=Tq2bldKmKrz++73RN1V7G8zySReaV7B8ZEar9exaW76jONur57alc2xVNdjOE/csVE pOoko1IR5Y3SE0gJTe/Pnfz1fKdXd02s6LUy2qAPIgpYyJmYZyS7Io/RN07sIbhiHAQi Zq/A3uapayzvoOJ8NnXUEYAZJcoo0q/Wm/w+3JBRtsEOLcVeExM5A93TJrbFDcWkCs6I VYkXhurysD1mzwNxnbPqhPIOJkhya27mdncIZN0+ge0RnVKMmZ4ok4uODEW8MFPfnae1 g6nJw8EcvryLbPKv5biAoHl3nT2C+L4Gx5Gu7AbLyrQTbftWSqbWOolxAr6/Ox3VHULo POSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="AEz/PuzK"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 11-20020a508e0b000000b004616acd9cbcsi14037251edw.360.2022.11.08.15.07.02; Tue, 08 Nov 2022 15:07:24 -0800 (PST) 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=@gmail.com header.s=20210112 header.b="AEz/PuzK"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbiKHWpn (ORCPT + 92 others); Tue, 8 Nov 2022 17:45:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbiKHWpk (ORCPT ); Tue, 8 Nov 2022 17:45:40 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4BBD63CE5 for ; Tue, 8 Nov 2022 14:45:37 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id fz10so9534464qtb.3 for ; Tue, 08 Nov 2022 14:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=b/B2+o8hWx+Vy2/gk8SryrziA/1k8CwLOYbP1F5lrYU=; b=AEz/PuzKz1OTr6hELS9WBy2xhyf4RDQLn1+30+wb5nF0GFNeAhvs/xiE5JHHi40EML NX4IrbG3OYnWy1jjdRnoM27jllftQGKac/ifgeDJEw55SU83fOMIwXnAW/Cc1Ptm+Jh1 CV9SUnSYkgw6hPpG631J+NjhTW+1uNQ4dLMM975HmabrQZPsvToPcsgZAdKcJz3ViwZy dJuouqQsT44LqcP3zV2p33W8vuGQlSBgSMaLbSJtidUmSd0HA7pu0rBFum7Xb06tdYfQ C+N0WkeXno0rBMeoIBe+1Lp4qbAiEK52mc7Eb0pt7FwU0X054E8inZF6z5v2Q5ftIqR8 BEYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b/B2+o8hWx+Vy2/gk8SryrziA/1k8CwLOYbP1F5lrYU=; b=TqloRLQoIkxAy4+kuVz2j6oTpyPQC7UwtyBk6m3064mnNeAuOmv+p7U28pEiL5e5AD torWQZEh0aKmkLiVI2MMaF3tD5ydkGiYTQsCrcE4CymjT3JZnLQWnY/5uNtbIVT2JEWN wZe1YFXf8rC0Cwxv4MVSTdR9cqBwtLCt/kUVs/oORajwTpIeARIAScFBo0tYDMkddR6E Q3VVz3iINud+WydIVk4qeEBuUUxzzTPjYEbCMXX6JJTsEFnp7cExhMDPiep14kktaA+Q pc+deiaRSJ0WbBDtsyBHZYgM+D7T/ZBBszEK4H7CMWKYa6KwMXIfpOwkGskHVUMDi7MQ Oofw== X-Gm-Message-State: ACrzQf1Z5UHOAtWZo85VOkbGsePxLLBmhffnI9XARFhMn5xMAT4wQG62 p3o04QngEz8NH0h72jQqTxAjODygPpg= X-Received: by 2002:a05:622a:1243:b0:3a5:4666:4122 with SMTP id z3-20020a05622a124300b003a546664122mr28328441qtx.230.1667947536908; Tue, 08 Nov 2022 14:45:36 -0800 (PST) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com. [209.85.219.173]) by smtp.gmail.com with ESMTPSA id y20-20020a37f614000000b006cfaee39ccesm9769226qkj.114.2022.11.08.14.45.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Nov 2022 14:45:36 -0800 (PST) Received: by mail-yb1-f173.google.com with SMTP id j130so19054325ybj.9 for ; Tue, 08 Nov 2022 14:45:35 -0800 (PST) X-Received: by 2002:a25:23d6:0:b0:6ca:7fd:d664 with SMTP id j205-20020a2523d6000000b006ca07fdd664mr56857635ybj.85.1667947535381; Tue, 08 Nov 2022 14:45:35 -0800 (PST) MIME-Version: 1.0 References: <20221030220203.31210-1-axboe@kernel.dk> <20221030220203.31210-7-axboe@kernel.dk> <4764dcbf-c735-bbe2-b60e-b64c789ffbe6@kernel.dk> <33832500-ddf3-dc2b-a765-046d46031991@kernel.dk> In-Reply-To: <33832500-ddf3-dc2b-a765-046d46031991@kernel.dk> From: Willem de Bruijn Date: Tue, 8 Nov 2022 17:44:58 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 6/6] eventpoll: add support for min-wait To: Jens Axboe Cc: Willem de Bruijn , Soheil Hassas Yeganeh , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Shakeel Butt Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 8, 2022 at 5:30 PM Jens Axboe wrote: > > On 11/8/22 3:25 PM, Willem de Bruijn wrote: > >>> This would be similar to the approach that willemb@google.com used > >>> when introducing epoll_pwait2. > >> > >> I have, see other replies in this thread, notably the ones with Stefan > >> today. Happy to do that, and my current branch does split out the ctl > >> addition from the meat of the min_wait support for this reason. Can't > >> seem to find a great way to do it, as we'd need to move to a struct > >> argument for this as epoll_pwait2() is already at max arguments for a > >> syscall. Suggestions more than welcome. > > > > Expect an array of two timespecs as fourth argument? > > Unfortunately even epoll_pwait2() doesn't have any kind of flags > argument to be able to do tricks like that... But I guess we could do > that with epoll_pwait3(), but it'd be an extra indirection for the copy > at that point (copy array of pointers, copy pointer if not NULL), which > would be unfortunate. I'd hate to have to argue that API to anyone, let > alone Linus, when pushing the series. I did mean for a new syscall epoll_pwait3. But not an array of pointers, an array of structs. The second arg is then mandatory for this epoll_pwait_minwait variant of the syscall. It would indeed have been nicer to be able to do this in epoll_pwait2 based on a flag. It's just doubling the size in copy_from_user in get_timespec64. Btw, when I added epoll_pwait2, there was a reasonable request to also update the manpages and add a basic test to tools/testing/selftests/filesystems/epoll. That is some extra work with a syscall based approach.