Message ID | 20221201181156.848373-1-axboe@kernel.dk |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp412246wrr; Thu, 1 Dec 2022 10:13:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf5yTAs7+gXeJU4sEAYwbB7qq3tgsR3HxUfuRe333hHLGUtcDlXSI3r3rJ0ItsghI+X0AGum X-Received: by 2002:a17:906:cb92:b0:7c0:bd2f:a3a6 with SMTP id mf18-20020a170906cb9200b007c0bd2fa3a6mr660701ejb.401.1669918407999; Thu, 01 Dec 2022 10:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669918407; cv=none; d=google.com; s=arc-20160816; b=DijI/9KyNMDK5ThNtHMbav6S5D0wPy5lJKeWGp/YUg2mcVTspxy302Mlkr4pO6EPfj 4cyPG7ASpJ4Ihwh+EC9/OkuVwHXC6PwJBFDjG4qJbSLz5+PWn8xmhiHG2adK/M1L2B0M eOSGZsc5Jl7N//ewwdmtJNeEfmW5fkJA8CRdN0URb64m6WMyRS7CMuwdwTEFdfro0xRR yJdsqy/cp+UOeqC8XXu/MYQO9XUl3EHUODqGlcXLbmlpuevI1vwa2yv3mApr+XipFpFE JrMtOp1rZqfy75wSHuk/r+t+VS+R2IeOSzmUVqJgsGt4qjrQGzcYlw4+k8soGTUWfb2v 9wgw== 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=l3glljPevHLdaoBzLBWNwFXRN7RcGOCNYiinqEgq4/0=; b=Byl8Dhl/Cb66XrOD76RtS1g6GEwuBD3iZrZYmXHx4LRUokzpLj9dsu00qOkvEswudk qMj9hm2FceuHXnBByim4UKq75CrtIm+3E3vgwgWf5jLXUqufBQtiougpVBTO5FFEKRIc bC3UlT3dgtr6hhLnhepfUoDLb1E3rQW8wch7cTpwXIoSWnB/gUD2/KK8W2qrigGOGPaT sbj2mCk9KBEb6uJrufDDPxhjdLhbXX8bP9d7QMQnd0cyL4UQb1CwE7IiAtztT/Tu9TA4 WY17HNA1rED8hm4rllrxe3lHCZ71NKKpSu7WfEZVcAE0i/U6ounxhoTrANZscSC2KaXE PAmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=JS8Sj1+i; 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 hv9-20020a17090760c900b007ae127c6c7asi4578648ejc.176.2022.12.01.10.13.04; Thu, 01 Dec 2022 10:13:27 -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=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=JS8Sj1+i; 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 S230080AbiLASMH (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Thu, 1 Dec 2022 13:12:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbiLASMF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 1 Dec 2022 13:12:05 -0500 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F15CCB7DE2 for <linux-kernel@vger.kernel.org>; Thu, 1 Dec 2022 10:12:04 -0800 (PST) Received: by mail-il1-x12b.google.com with SMTP id x16so1093741ilm.5 for <linux-kernel@vger.kernel.org>; Thu, 01 Dec 2022 10:12:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=l3glljPevHLdaoBzLBWNwFXRN7RcGOCNYiinqEgq4/0=; b=JS8Sj1+i5nHW2tpMIxi+z4ilQRStIWB7+Fq6pamNnjajP6dr9/CgROQGQANaTp+NvE SWwAYvEE97hgruJDAF80n93mtjhVOSPt7U+JNdZXvaU4JqVKkOoTfEHXsrqgJmwux2Qp GOXX+lv/d/Tvwzwfwj/lbas8EMhh1NwFms182hiED2Dctmrq5ct6SkMTOprnCc0i6OEg iZz5BFRfhv5O8M20rbdKm4MJQ4ixmUi7JRnyp3aHONC9CstCIo5h9g3B5Ma0PhJv9eFf NC+Y+6k5pNvTLu5pmD0Rk0XeetV0HA5cFFn53D9IOIkSSHBNKnepm784rDG/MAd1U5hh rtGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=l3glljPevHLdaoBzLBWNwFXRN7RcGOCNYiinqEgq4/0=; b=QjPrrLKsjjuhmKTTN3ZwRDbyL841UIgiLbmYxlVaxK2WIGgPL2koKop2Ss+pUPSzZ1 jbIN1OURnKjav/rRd+O1vXRrotLTp2+TyVx5C+a239xi4PFFTIEhUEBsLzhT60gGLvgO h/rg8f5AsUqXlfZ0lnokWO0acarMMxeun9a6rFVpymZallcr8Tl5YOpzm6nLSh24L3k2 Ea3EeUAJFGV5pTnDcUZK3kM8iZE/RAbn/qSaWgY1skUYCdwJLuNeM6lcs+1GzepHqVVz UNnzwP5ZeCH1Fmxcqc+wOQ4U/AVcQ3efFG86AgOfgSbN/VHQfsBXBD5DWYBa8vNsijZJ wSkQ== X-Gm-Message-State: ANoB5pmVtu01lIfeiRQWHa4nC8+7w/Z87Cl+WAK4176nKA8ieLxIeyXY yKo0U0kI7EvCXYg7RmMEfl8u5glkshClPuh6 X-Received: by 2002:a05:6e02:1a63:b0:302:a682:485e with SMTP id w3-20020a056e021a6300b00302a682485emr21887861ilv.168.1669918324027; Thu, 01 Dec 2022 10:12:04 -0800 (PST) Received: from m1max.localdomain ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id y21-20020a027315000000b00374fe4f0bc3sm1842028jab.158.2022.12.01.10.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 10:12:03 -0800 (PST) From: Jens Axboe <axboe@kernel.dk> To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: soheil@google.com, willemdebruijn.kernel@gmail.com, stefanha@redhat.com Subject: [PATCHSET v4 0/7] Add support for epoll min_wait Date: Thu, 1 Dec 2022 11:11:49 -0700 Message-Id: <20221201181156.848373-1-axboe@kernel.dk> X-Mailer: git-send-email 2.35.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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751036364510724932?= X-GMAIL-MSGID: =?utf-8?q?1751036364510724932?= |
Series |
Add support for epoll min_wait
|
|
Message
Jens Axboe
Dec. 1, 2022, 6:11 p.m. UTC
Hi, tldr - we saw a 6-7% CPU reduction with this patch. See patch 6 for full numbers. This adds support for EPOLL_CTL_MIN_WAIT, which allows setting a minimum time that epoll_wait() should wait for events on a given epoll context. Some justification and numbers are in patch 6, patches 1-5 are really just prep patches or cleanups, and patch 7 adds the API to set min_wait. I've decided against adding a syscall for this due to the following reasons: 1) We, Meta, don't need the syscall variant. 2) It's unclear how best to do a clean syscall interface for this. We're already out of arguments with the pwait/pwait2 variants. With the splitting of the API into a separate patch, anyone who wishes to have/use a syscall interface would be tasked with doing that themselves. No real changes in this release, just minor tweaks. Would appreciate some review on this so we can get it moving forward. I obviously can't start real deployments at Meta before I have the API upstream, or at least queued for upstream. So we're currently stuck in limbo with this. Also available here: https://git.kernel.dk/cgit/linux-block/log/?h=epoll-min_ts Since v3: - Split the ctl addition into separate patch - Gate setup of min_wait on !ewq.timed_out - Add comment on calling ctl with wait == 0 is a no-op