Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp2774328rwl; Sat, 5 Nov 2022 11:31:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46Sdqk+Ue+4HK73MNuInDXhTHf7eSX6s1XjxZ12rOeRSV4K9Xr9AgrXDyDnswmFoxxw1tW X-Received: by 2002:a65:62c7:0:b0:463:9c67:5fe2 with SMTP id m7-20020a6562c7000000b004639c675fe2mr35432907pgv.443.1667673085098; Sat, 05 Nov 2022 11:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667673085; cv=none; d=google.com; s=arc-20160816; b=kBKnOW5W1irxE8xvztSurQtLcxAUogT1sp36/dh0GE2nj+fu4dqw1kHvjwOPicibeB SlEVkDuZWnpWEBQGABUfOAVuv6tTYZhy/hSWaOYcEBFrOqQg8apkWQ0NFHxS2tBoqEZ4 yh1cHayDxvh/t87VVIPxdVodv6SexL0FL5BFT9HBTG+iQrb6ET5gYY4ocUhn9Q/BUESy hzZcgxzlw6KArJTWo6+fr5p8upJFsGXsyCNnsZbYw3oxY7Ue9WpRRynsC0YkJP6l/tNo veLA2fSD30AfAspvU6w9axZ7kSF/kFozVd31j7AFJ7n7iqE1dYW0+cuEJgyUm9dPtt9L VTsA== 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=QVXj0cLL9VUphH0bgK54o5rYv0DrN8lZjO0Vg0C726g=; b=bTSVcEVgKzf0pU++pAoe23vAgFcWM4AUthmGd6r22ULRHgPwXYF6E3w5GoKizVOeNv 1cS1DSU1B0isclq/v9reh5nSFoC/PfG9kCF1Gjm5FQCk3S17SuHCc1CmJmY2rCMc1lW0 qNYVGMMLLGiXKRh0aVY/n91wc/vxpbPa/KViIhg7cIPk8R1s84ScT2Ervg010jBC5WWj Q7HKH3l7+uEChmUN4e1E7C2By0i8PrhbLJulr9uxy9Cxd3hTcftYnW5/nOdw3DUaojhs 5Eaa8SoWrM4UxgTGHPlHB3HpfjYX6QQs2HBLT3OXXhkedt/Bp3Xty6R3BgpjXn59v5tE 1b1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BiWqOqpP; 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 k29-20020a63561d000000b0046f75bc3a0fsi4252074pgb.568.2022.11.05.11.31.12; Sat, 05 Nov 2022 11:31:25 -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=@gmail.com header.s=20210112 header.b=BiWqOqpP; 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 S230054AbiKESGZ (ORCPT + 96 others); Sat, 5 Nov 2022 14:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbiKESGU (ORCPT ); Sat, 5 Nov 2022 14:06:20 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 876A812D09 for ; Sat, 5 Nov 2022 11:06:14 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id x21so5146711qkj.0 for ; Sat, 05 Nov 2022 11:06:14 -0700 (PDT) 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=QVXj0cLL9VUphH0bgK54o5rYv0DrN8lZjO0Vg0C726g=; b=BiWqOqpPR07eLTLe6T5V72Y9xGIsPmkwMbeqbdJI+puK8c9LIXxNrw3cBq8D1NOQuQ pJAo1Am+vhs2mPh44VnFCaOf/bPGjWGgUGvIUZGM5ZyxOFAC9ctuTinIwdqjqf8e/+Oh zszIk7RIyfcGhJ2qo9t79gizH+wXzLk0Rme42YB++2Np66N+AS1lZh5mWgKCvTL3MXkG IroGDXKDgdShBjiGiZjOoQb51+O4x47utL/pDgknyokKrwmVyCvjvq6zXYAtCtqhz/aH Ayrr65bsaXYcR6RqK22dn9qNoe8iDNfts2eAAfn9pZJm5cU/ksSijDS3FPNr7M24NIUm TXPQ== 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=QVXj0cLL9VUphH0bgK54o5rYv0DrN8lZjO0Vg0C726g=; b=o5rezjn1t27rLubYEW2jZHVg+9O9EeOgunFPchLtqq/wtjnAnvV+cu1RL0xcEGCqN6 oyMmfp2rnfPX7nRUbrOHctV/c2/cN6LxPgM28m6vumR0cv49SuVkOt8BC/+Y2kcjKPRN 16qdvlONlOfVCEDG0xaw7gY4y1nWRV3ntGVbxl6dWJF1cPZJnT5o5TSIV1Qykdu0iA2N I7P1bHQcAu6p8Y9so4bYtuOenlol886p2kc9Wcgi8PDukZ8wugn+EWi0OK+fZ+7MOGBz Hj1aNAJDjui9AyLRQeenN9ZlOT16WkBHPsRRW1ew2pJct8bFfGxJDx45rV3nDMN6PQzb RvPQ== X-Gm-Message-State: ACrzQf2WfzqyTM/RdXeyVKDVd+ysF7YcXwoUQapnlWkU89n32Nac7JU6 bcOEdB1omMuFPjdsvDG2YQSSodPdiTg= X-Received: by 2002:a05:620a:2587:b0:6cf:7ece:e1f9 with SMTP id x7-20020a05620a258700b006cf7ecee1f9mr29557260qko.182.1667671573510; Sat, 05 Nov 2022 11:06:13 -0700 (PDT) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com. [209.85.219.174]) by smtp.gmail.com with ESMTPSA id bw21-20020a05622a099500b003a50b9f099esm2258234qtb.12.2022.11.05.11.06.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Nov 2022 11:06:12 -0700 (PDT) Received: by mail-yb1-f174.google.com with SMTP id e123so4976938ybh.11 for ; Sat, 05 Nov 2022 11:06:12 -0700 (PDT) X-Received: by 2002:a25:f89:0:b0:6bc:1488:2f93 with SMTP id 131-20020a250f89000000b006bc14882f93mr495714ybp.85.1667671572356; Sat, 05 Nov 2022 11:06:12 -0700 (PDT) MIME-Version: 1.0 References: <20221030220203.31210-1-axboe@kernel.dk> <02e5bf45-f877-719b-6bf8-c4ac577187a8@kernel.dk> <88353f13-d1d8-ef69-bcdc-eb2aa17c7731@kernel.dk> <46cb04ca-467c-2e33-f221-3e2a2eaabbda@kernel.dk> In-Reply-To: From: Willem de Bruijn Date: Sat, 5 Nov 2022 14:05:35 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHSET v3 0/5] Add support for epoll min_wait To: Jens Axboe Cc: Willem de Bruijn , linux-kernel@vger.kernel.org, netdev@vger.kernel.org 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 Sat, Nov 5, 2022 at 1:39 PM Jens Axboe wrote: > > >> FWIW, when adding nsec resolution I initially opted for an init-based > >> approach, passing a new flag to epoll_create1. Feedback then was that > >> it was odd to have one syscall affect the behavior of another. The > >> final version just added a new epoll_pwait2 with timespec. > > > > I'm fine with just doing a pure syscall variant too, it was my original > > plan. Only changed it to allow for easier experimentation and adoption, > > and based on the fact that most use cases would likely use a fixed value > > per context anyway. > > > > I think it'd be a shame to drop the ctl, unless there's strong arguments > > against it. I'm quite happy to add a syscall variant too, that's not a > > big deal and would be a minor addition. Patch 6 should probably cut out > > the ctl addition and leave that for a patch 7, and then a patch 8 for > > adding a syscall. > I split the ctl patch out from the core change, and then took a look at > doing a syscall variant too. But there are a few complications there... > It would seem to make the most sense to build this on top of the newest > epoll wait syscall, epoll_pwait2(). But we're already at the max number > of arguments there... > > Arguably pwait2 should've been converted to use some kind of versioned > struct instead. I'm going to take a stab at pwait3 with that kind of > interface. Don't convert to a syscall approach based solely on my feedback. It would be good to hear from others. At a high level, I'm somewhat uncomfortable merging two syscalls for behavior that already works, just to save half the syscall overhead. There is no shortage of calls that may make some sense for a workload to merge. Is the quoted 6-7% cpu cycle reduction due to saving one SYSENTER/SYSEXIT (as the high resolution timer wake-up will be the same), or am I missing something more fundamental?